diff --git a/android/.gitignore b/android/.gitignore index 6f56801..55afd91 100644 --- a/android/.gitignore +++ b/android/.gitignore @@ -7,7 +7,7 @@ gradle-wrapper.jar GeneratedPluginRegistrant.java # Remember to never publicly share your keystore. -# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +# See https://flutter.dev/to/reference-keystore key.properties **/*.keystore **/*.jks diff --git a/android/app/build.gradle b/android/app/build.gradle index 1758083..0cefe94 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -1,67 +1,44 @@ plugins { id "com.android.application" id "kotlin-android" + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. id "dev.flutter.flutter-gradle-plugin" } -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - android { - namespace "com.example.zontreck" - compileSdk flutter.compileSdkVersion - ndkVersion flutter.ndkVersion + namespace = "dev.zontreck.zontreck" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 } kotlinOptions { - jvmTarget = '1.8' - } - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' + jvmTarget = JavaVersion.VERSION_1_8 } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.example.zontreck" + applicationId = "dev.zontreck.zontreck" // You can update the following values to match your application needs. - // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. - minSdkVersion flutter.minSdkVersion - targetSdkVersion flutter.targetSdkVersion - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName + // For more information, see: https://flutter.dev/to/review-gradle-config. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName } buildTypes { release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug + signingConfig = signingConfigs.debug } } } flutter { - source '../..' + source = "../.." } - -dependencies {} diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 123dcaf..aacd5f7 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -7,6 +7,7 @@ android:name=".MainActivity" android:exported="true" android:launchMode="singleTop" + android:taskAffinity="" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" @@ -31,7 +32,7 @@ android:value="2" /> diff --git a/android/app/src/main/kotlin/com/example/zontreck/MainActivity.kt b/android/app/src/main/kotlin/dev/zontreck/zontreck/MainActivity.kt similarity index 75% rename from android/app/src/main/kotlin/com/example/zontreck/MainActivity.kt rename to android/app/src/main/kotlin/dev/zontreck/zontreck/MainActivity.kt index fd7436a..6a20d58 100644 --- a/android/app/src/main/kotlin/com/example/zontreck/MainActivity.kt +++ b/android/app/src/main/kotlin/dev/zontreck/zontreck/MainActivity.kt @@ -1,4 +1,4 @@ -package com.example.zontreck +package dev.zontreck.zontreck import io.flutter.embedding.android.FlutterActivity diff --git a/android/build.gradle b/android/build.gradle index bc157bd..d2ffbff 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -5,12 +5,12 @@ allprojects { } } -rootProject.buildDir = '../build' +rootProject.buildDir = "../build" subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" } subprojects { - project.evaluationDependsOn(':app') + project.evaluationDependsOn(":app") } tasks.register("clean", Delete) { diff --git a/android/gradle.properties b/android/gradle.properties index 598d13f..2597170 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,3 +1,3 @@ -org.gradle.jvmargs=-Xmx4G +org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true android.enableJetifier=true diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index e1ca574..7bb2df6 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip diff --git a/android/settings.gradle b/android/settings.gradle index 1d6d19b..b9e43bd 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -5,10 +5,9 @@ pluginManagement { def flutterSdkPath = properties.getProperty("flutter.sdk") assert flutterSdkPath != null, "flutter.sdk not set in local.properties" return flutterSdkPath - } - settings.ext.flutterSdkPath = flutterSdkPath() + }() - includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") repositories { google() @@ -19,8 +18,8 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "7.3.0" apply false - id "org.jetbrains.kotlin.android" version "1.7.10" apply false + id "com.android.application" version "8.1.0" apply false + id "org.jetbrains.kotlin.android" version "1.8.22" apply false } include ":app" diff --git a/images/nbteditor_icon.png b/images/nbteditor_icon.png new file mode 100644 index 0000000..5a225eb Binary files /dev/null and b/images/nbteditor_icon.png differ diff --git a/images/nbteditor_menu.png b/images/nbteditor_menu.png new file mode 100644 index 0000000..3cb30d6 Binary files /dev/null and b/images/nbteditor_menu.png differ diff --git a/images/nbteditor_snbt.png b/images/nbteditor_snbt.png new file mode 100644 index 0000000..53e182d Binary files /dev/null and b/images/nbteditor_snbt.png differ diff --git a/images/nbteditor_tagdisplay.png b/images/nbteditor_tagdisplay.png new file mode 100644 index 0000000..bcb9f2f Binary files /dev/null and b/images/nbteditor_tagdisplay.png differ diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index ef040bf..0a630bb 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -368,7 +368,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.zontreck; + PRODUCT_BUNDLE_IDENTIFIER = dev.zontreck.zontreck; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; @@ -384,7 +384,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.zontreck.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = dev.zontreck.zontreck.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -401,7 +401,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.zontreck.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = dev.zontreck.zontreck.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; @@ -416,7 +416,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.zontreck.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = dev.zontreck.zontreck.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; @@ -547,7 +547,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.zontreck; + PRODUCT_BUNDLE_IDENTIFIER = dev.zontreck.zontreck; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -569,7 +569,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.zontreck; + PRODUCT_BUNDLE_IDENTIFIER = dev.zontreck.zontreck; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift index 70693e4..6266644 100644 --- a/ios/Runner/AppDelegate.swift +++ b/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ -import UIKit import Flutter +import UIKit -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/lib/Constants.dart b/lib/Constants.dart index a133c66..aeae1c1 100644 --- a/lib/Constants.dart +++ b/lib/Constants.dart @@ -8,9 +8,9 @@ class Constants { static const DRAWER_COLOR = Color.fromARGB(148, 0, 97, 97); static const PORTFOLIO_CARD_COLOR = Color.fromARGB(255, 0, 71, 97); - static const VERSION = "Version 1.0.082424+0827"; + static const VERSION = "Version 1.0.013025+2009"; static const COPYRIGHT = - "Copyright 2024 - Piccari Creations. All rights Reserved"; + "Copyright 2024-2025 - Piccari Creations. All rights Reserved"; static const CLIENTPSK = "f5c6caf3efe1ec5aa4b7c572f92aa14782b7be34b4c7844fa9c6d47fdf94246"; diff --git a/lib/pages/Main.dart b/lib/pages/Main.dart index 3f648a1..cd28c8c 100644 --- a/lib/pages/Main.dart +++ b/lib/pages/Main.dart @@ -8,6 +8,7 @@ import 'package:zontreck/pages/OpenSim.dart'; import 'package:zontreck/pages/Portfolio.dart'; import 'package:zontreck/pages/RegisterAccount.dart'; import 'package:zontreck/pages/libac.dart'; +import 'package:zontreck/pages/nbt/NBTEditor.dart'; class MainPage extends StatelessWidget { const MainPage({super.key}); @@ -22,7 +23,8 @@ class MainPage extends StatelessWidget { "/opensim/login": (context) => const LoginAccountPage(), "/portfolio": (context) => const PortfolioPage(), "/portfolio/coun": (context) => const CardsOfUtterNonsense(), - "/portfolio/libac": (context) => const LibACAbout() + "/portfolio/libac": (context) => const LibACAbout(), + "/portfolio/nbteditor": (context) => AboutNBTEditor() }, theme: ThemeData.dark(), ); diff --git a/lib/pages/Portfolio.dart b/lib/pages/Portfolio.dart index 7a78ba2..c86fabc 100644 --- a/lib/pages/Portfolio.dart +++ b/lib/pages/Portfolio.dart @@ -37,7 +37,7 @@ class PortfolioPage extends StatelessWidget { PortfolioEntry( title: const Text("Zontreck.com"), body: const Text( - ("This website, which is written entirely in Flutter, with some supporting API files in PHP")), + ("Hey! It's me! Written entirely in Flutter, with some supporting API files in PHP")), onTap: () {}), PortfolioEntry( title: const Text("Minecraft Modding"), @@ -55,7 +55,10 @@ class PortfolioPage extends StatelessWidget { title: const Text("NBT Editor"), body: const Text( "This utilizes the NBT implementation in LibAC. It's a Named Binary Tag editor written entirely in dart or flutter."), - onTap: () {}) + onTap: () { + Navigator.pushNamed( + context, "/portfolio/nbteditor"); + }) ], ), ), diff --git a/lib/pages/nbt/NBTEditor.dart b/lib/pages/nbt/NBTEditor.dart new file mode 100644 index 0000000..aaf5dee --- /dev/null +++ b/lib/pages/nbt/NBTEditor.dart @@ -0,0 +1,120 @@ +import 'package:flutter/material.dart'; +import 'package:libac_dart/nbt/SnbtIo.dart'; +import 'package:libac_dart/nbt/impl/CompoundTag.dart'; +import 'package:libac_dart/nbt/impl/IntTag.dart'; +import 'package:libac_dart/nbt/impl/ShortTag.dart'; +import 'package:libac_dart/nbt/impl/StringTag.dart'; +import 'package:zontreck/Constants.dart'; + +class AboutNBTEditor extends StatelessWidget { + TextStyle style = TextStyle(fontSize: 18); + CompoundTag ct = CompoundTag(); + + @override + Widget build(BuildContext context) { + if (ct.isEmpty) { + ct.put("sample", ShortTag.valueOf(4)); + CompoundTag ct2 = CompoundTag(); + ct2.put("intTest", IntTag.valueOf(8891)); + ct2.put("name", StringTag.valueOf("str")); + ct.put("sample_nested", ct2); + } + return Scaffold( + appBar: AppBar( + title: Text("Project: Named Binary Tag Editor"), + backgroundColor: Constants.TITLEBAR_COLOR), + body: Padding( + padding: EdgeInsets.all(4), + child: SingleChildScrollView( + child: Column( + children: [ + Row( + children: [ + SizedBox( + width: 600, + child: ListTile( + title: Text("About the NBT Editor"), + ), + ), + Image.asset( + "images/nbteditor_icon.png", + width: 128, + height: 128, + ) + ], + ), + Text( + "This editor began out of a need for being able to edit NBT data on a Linux system. I could not find a single editor for Linux. All of them required either outdated versions of Java and were unmaintained with poor interfaces, or required Wine and were barely even usable, if at all.", + style: style, + ), + Text( + "As I explore my options, I decided on one thing: Cross Platform. You see, every editor up to this point was designed with one platform in mind, Windows. I wanted mine to be independent of all platforms.", + style: style, + ), + Text( + "How did I accomplish this though?", + style: style, + ), + Text( + "That answer is simple. I decided on Flutter. It has a programming language that was easy to pick up. One code base for all platforms, and on top of all of that, the language is similar to others I already knew. I was sold. So i began to learn the ins and outs of Dart. I quickly discovered however, that no NBT Library existed for Dart.. This would be a problem. So, to solve this problem, I created a brand new NBT library. I designed it based upon my knowledge and experience of coding Minecraft Mods. I knew how i expected the API to work, so i based it upon that. Now to make a Compound Tag, it is literally as simple as `CompoundTag ct = CompoundTag()`. The difference here between my implementation and Mojang's is significant, but the usage of the API is near identical. You just leave out the 'new' keyword as Dart does not require it.", + style: style, + ), + SizedBox( + height: 40, + ), + Text( + "So, next we come across the first significant hurdle in this entire project. Java's implementation of UUIDs. NBT allows serializing a UUID and deserializing it using helper methods. If my implementation was to be truely compatible, I would require a UUID implementation that was identical. So my painful journey began, I researched how Java's UUID worked, looked through Java source code. Finally after much trial and error, the library had a fully functional UUID implementation with a working generator that could actually accept two longs. See in Java, a UUID constists of two long values 'MSB' and 'LSB'. And dart's internal implementation does not expose these values, if it even uses them at all. The only problem is dart's web code does not actually support MSB and LSB. I had to create a secondary uuid class just for the web which operates on strings instead of the proper implementation using two long values.", + style: style), + SizedBox( + height: 40, + ), + Text( + "The next challenge in my project was SNBT. This came with a significant number of problems. For one, the SNBT protocol is completely undocumented. Which meant much trial and error, saving SNBT documents from a sample minecraft mod, testing import, etc. I had to get everything just right. The tag element below is infact a SNBT tag.", + style: style), + ListTile( + title: Text("Sample SNBT"), + subtitle: Text(SnbtIo.writeToString(ct)), + ), + SizedBox( + height: 40, + ), + Text( + "The next challenge was the layout of the editor and the tag icons! I quickly grabbed the public domain icons for the tags from the Minecraft Wiki, then proceeded to embed them. And have a look below, You be the judge on if I accomplished my task.", + style: style), + Image.asset( + "images/nbteditor_tagdisplay.png", + width: 1024, + height: 1024, + ), + Image.asset( + "images/nbteditor_menu.png", + width: 1024, + height: 1024, + ), + Row(children: [ + Expanded( + child: Text( + "And finally.. now that everything was in place, it was time to add the NBT Editor's raw data editor... which lets you edit it as SNBT!", + style: style, + ), + ), + Image.asset( + "images/nbteditor_snbt.png", + width: 800, + height: 800, + ) + ]), + SizedBox( + height: 40, + ), + Text( + "Now.. it is important to edit this off with a note. This project is far from complete. I am a single person who made something I care deeply about, a utility for linux. I am not a UX designer. This was the best I could do with the limited knowledge on UX design that i have. I am far better at backend coding where I do not need to give the user any amount of controls or info. That being said, my CI server builds changes to the editor with every commit. Builds are produced for Windows and Linux, but not for Mac at this time. An android build is produced, but that is mostly as a for fun type of deal, as it is fairly useless on a phone without open or save functionality.", + style: style, + ) + ], + ), + ), + ), + ); + } +} diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt index 8234f28..1890be1 100644 --- a/linux/CMakeLists.txt +++ b/linux/CMakeLists.txt @@ -1,5 +1,5 @@ # Project-level configuration. -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.13) project(runner LANGUAGES CXX) # The name of the executable created for the application. Change this to change @@ -7,7 +7,7 @@ project(runner LANGUAGES CXX) set(BINARY_NAME "zontreck") # The unique GTK application identifier for this application. See: # https://wiki.gnome.org/HowDoI/ChooseApplicationID -set(APPLICATION_ID "com.zontreck.zontreck") +set(APPLICATION_ID "dev.zontreck.zontreck") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. @@ -54,25 +54,8 @@ add_subdirectory(${FLUTTER_MANAGED_DIR}) find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) -add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") - -# Define the application target. To change its name, change BINARY_NAME above, -# not the value here, or `flutter run` will no longer work. -# -# Any new source files that you add to the application should be added here. -add_executable(${BINARY_NAME} - "main.cc" - "my_application.cc" - "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" -) - -# Apply the standard set of build settings. This can be removed for applications -# that need different build settings. -apply_standard_settings(${BINARY_NAME}) - -# Add dependency libraries. Add any application-specific dependencies here. -target_link_libraries(${BINARY_NAME} PRIVATE flutter) -target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) +# Application build; see runner/CMakeLists.txt. +add_subdirectory("runner") # Run the Flutter tool portions of the build. This must not be removed. add_dependencies(${BINARY_NAME} flutter_assemble) diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index e71a16d..f6f23bf 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -6,6 +6,10 @@ #include "generated_plugin_registrant.h" +#include void fl_register_plugins(FlPluginRegistry* registry) { + g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); + url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); } diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index 2e1de87..f16b4c3 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + url_launcher_linux ) list(APPEND FLUTTER_FFI_PLUGIN_LIST diff --git a/linux/runner/CMakeLists.txt b/linux/runner/CMakeLists.txt new file mode 100644 index 0000000..e97dabc --- /dev/null +++ b/linux/runner/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.13) +project(runner LANGUAGES CXX) + +# Define the application target. To change its name, change BINARY_NAME in the +# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer +# work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} + "main.cc" + "my_application.cc" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add preprocessor definitions for the application ID. +add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") + +# Add dependency libraries. Add any application-specific dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter) +target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) + +target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") diff --git a/linux/main.cc b/linux/runner/main.cc similarity index 100% rename from linux/main.cc rename to linux/runner/main.cc diff --git a/linux/my_application.cc b/linux/runner/my_application.cc similarity index 93% rename from linux/my_application.cc rename to linux/runner/my_application.cc index 60ae14c..6827c07 100644 --- a/linux/my_application.cc +++ b/linux/runner/my_application.cc @@ -117,6 +117,12 @@ static void my_application_class_init(MyApplicationClass* klass) { static void my_application_init(MyApplication* self) {} MyApplication* my_application_new() { + // Set the program name to the application ID, which helps various systems + // like GTK and desktop environments map this running application to its + // corresponding .desktop file. This ensures better integration by allowing + // the application to be recognized beyond its binary name. + g_set_prgname(APPLICATION_ID); + return MY_APPLICATION(g_object_new(my_application_get_type(), "application-id", APPLICATION_ID, "flags", G_APPLICATION_NON_UNIQUE, diff --git a/linux/my_application.h b/linux/runner/my_application.h similarity index 100% rename from linux/my_application.h rename to linux/runner/my_application.h diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 724bb2a..997e35d 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -6,7 +6,9 @@ import FlutterMacOS import Foundation import shared_preferences_foundation +import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) + UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) } diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index 0c2a2d0..cd7ea1a 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -385,7 +385,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.zontreck.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = dev.zontreck.zontreck.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/zontreck.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/zontreck"; @@ -399,7 +399,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.zontreck.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = dev.zontreck.zontreck.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/zontreck.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/zontreck"; @@ -413,7 +413,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.zontreck.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = dev.zontreck.zontreck.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/zontreck.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/zontreck"; diff --git a/macos/Runner/AppDelegate.swift b/macos/Runner/AppDelegate.swift index d53ef64..b3c1761 100644 --- a/macos/Runner/AppDelegate.swift +++ b/macos/Runner/AppDelegate.swift @@ -1,9 +1,13 @@ import Cocoa import FlutterMacOS -@NSApplicationMain +@main class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/macos/Runner/Configs/AppInfo.xcconfig b/macos/Runner/Configs/AppInfo.xcconfig index 5eb3c6b..94e89f6 100644 --- a/macos/Runner/Configs/AppInfo.xcconfig +++ b/macos/Runner/Configs/AppInfo.xcconfig @@ -8,7 +8,7 @@ PRODUCT_NAME = zontreck // The application's bundle identifier -PRODUCT_BUNDLE_IDENTIFIER = com.example.zontreck +PRODUCT_BUNDLE_IDENTIFIER = dev.zontreck.zontreck // The copyright displayed in application information -PRODUCT_COPYRIGHT = Copyright © 2024 com.example. All rights reserved. +PRODUCT_COPYRIGHT = Copyright © 2025 dev.zontreck. All rights reserved. diff --git a/macos/RunnerTests/RunnerTests.swift b/macos/RunnerTests/RunnerTests.swift index 5418c9f..61f3bd1 100644 --- a/macos/RunnerTests/RunnerTests.swift +++ b/macos/RunnerTests/RunnerTests.swift @@ -1,5 +1,5 @@ -import FlutterMacOS import Cocoa +import FlutterMacOS import XCTest class RunnerTests: XCTestCase { diff --git a/pubspec.yaml b/pubspec.yaml index d9ab350..f9ba474 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,8 +1,8 @@ name: zontreck -description: "A new Flutter project." +description: "The zontreck.com website" # The following line prevents the package from being accidentally published to # pub.dev using `flutter pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev +publish_to: "none" # Remove this line if you wish to publish to pub.dev # The following defines the version and build number for your application. # A version number is three numbers separated by dots, like 1.2.43 @@ -19,7 +19,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.082924+0758 environment: - sdk: '>=3.3.4 <4.0.0' + sdk: ^3.6.1 # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions @@ -31,18 +31,17 @@ dependencies: flutter: sdk: flutter - # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.6 + cupertino_icons: ^1.0.8 libac_dart: hosted: https://git.zontreck.com/api/packages/AriasCreations/pub/ - version: ^1.2.082924+0756 - dio: ^5.4.3+1 - shared_preferences: ^2.2.3 + version: ^1.4.012225+0413 + dio: ^5.8.0+1 + shared_preferences: ^2.5.1 footer: ^0.0.4 - crypto: ^3.0.3 - url_launcher: ^6.3.0 + crypto: ^3.0.6 + url_launcher: ^6.3.1 dev_dependencies: flutter_test: @@ -53,19 +52,24 @@ dev_dependencies: # activated in the `analysis_options.yaml` file located at the root of your # package. See that file for information about deactivating specific lint # rules and activating additional ones. - flutter_lints: ^3.0.0 + flutter_lints: ^5.0.0 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec # The following section is specific to Flutter packages. flutter: - # The following line ensures that the Material Icons font is # included with your application, so that you can use the icons in # the material Icons class. uses-material-design: true + assets: + - images/nbteditor_icon.png + - images/nbteditor_tagdisplay.png + - images/nbteditor_menu.png + - images/nbteditor_snbt.png + # To add assets to your application, add an assets section, like this: # assets: # - images/a_dot_burr.jpeg diff --git a/web/index.html b/web/index.html index 2f638e6..3797c90 100644 --- a/web/index.html +++ b/web/index.html @@ -18,10 +18,10 @@ - + - + @@ -29,10 +29,10 @@ - Zontreck.com + zontreck.com - + diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 8b6d468..4f78848 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -6,6 +6,9 @@ #include "generated_plugin_registrant.h" +#include void RegisterPlugins(flutter::PluginRegistry* registry) { + UrlLauncherWindowsRegisterWithRegistrar( + registry->GetRegistrarForPlugin("UrlLauncherWindows")); } diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index b93c4c3..88b22e5 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + url_launcher_windows ) list(APPEND FLUTTER_FFI_PLUGIN_LIST diff --git a/windows/runner/Runner.rc b/windows/runner/Runner.rc index 0a34f0c..6c9fdc0 100644 --- a/windows/runner/Runner.rc +++ b/windows/runner/Runner.rc @@ -89,11 +89,11 @@ BEGIN BEGIN BLOCK "040904e4" BEGIN - VALUE "CompanyName", "com.example" "\0" + VALUE "CompanyName", "dev.zontreck" "\0" VALUE "FileDescription", "zontreck" "\0" VALUE "FileVersion", VERSION_AS_STRING "\0" VALUE "InternalName", "zontreck" "\0" - VALUE "LegalCopyright", "Copyright (C) 2024 com.example. All rights reserved." "\0" + VALUE "LegalCopyright", "Copyright (C) 2025 dev.zontreck. All rights reserved." "\0" VALUE "OriginalFilename", "zontreck.exe" "\0" VALUE "ProductName", "zontreck" "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0" diff --git a/windows/runner/runner.exe.manifest b/windows/runner/runner.exe.manifest index a42ea76..153653e 100644 --- a/windows/runner/runner.exe.manifest +++ b/windows/runner/runner.exe.manifest @@ -9,12 +9,6 @@ - - - - - - diff --git a/windows/runner/utils.cpp b/windows/runner/utils.cpp index b2b0873..3a0b465 100644 --- a/windows/runner/utils.cpp +++ b/windows/runner/utils.cpp @@ -45,13 +45,13 @@ std::string Utf8FromUtf16(const wchar_t* utf16_string) { if (utf16_string == nullptr) { return std::string(); } - int target_length = ::WideCharToMultiByte( + unsigned int target_length = ::WideCharToMultiByte( CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, -1, nullptr, 0, nullptr, nullptr) -1; // remove the trailing null character int input_length = (int)wcslen(utf16_string); std::string utf8_string; - if (target_length <= 0 || target_length > utf8_string.max_size()) { + if (target_length == 0 || target_length > utf8_string.max_size()) { return utf8_string; } utf8_string.resize(target_length);