├── .github └── FUNDING.yml ├── .gitignore ├── .gitmodules ├── .metadata ├── LICENSE ├── README.md ├── analysis_options.yaml ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ ├── AndroidManifest.xml │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-ldpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ └── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── jniLibs │ │ │ ├── arm64-v8a │ │ │ │ ├── libopenssl.so │ │ │ │ ├── libpython3.8.so │ │ │ │ └── libtor.so │ │ │ ├── armeabi-v7a │ │ │ │ ├── libopenssl.so │ │ │ │ ├── libpython3.8.so │ │ │ │ └── libtor.so │ │ │ ├── x86 │ │ │ │ ├── libopenssl.so │ │ │ │ ├── libpython3.8.so │ │ │ │ └── libtor.so │ │ │ └── x86_64 │ │ │ │ ├── libopenssl.so │ │ │ │ ├── libpython3.8.so │ │ │ │ └── libtor.so │ │ ├── kotlin │ │ │ └── in │ │ │ │ └── canews │ │ │ │ └── zeronetmobile │ │ │ │ ├── MainActivity.kt │ │ │ │ └── MyApplication.kt │ │ └── res │ │ │ ├── drawable-anydpi-v24 │ │ │ └── ic_bg_service_small.xml │ │ │ ├── drawable-hdpi │ │ │ └── ic_bg_service_small.png │ │ │ ├── drawable-mdpi │ │ │ └── ic_bg_service_small.png │ │ │ ├── drawable-v21 │ │ │ └── launch_background.xml │ │ │ ├── drawable-xhdpi │ │ │ └── ic_bg_service_small.png │ │ │ ├── drawable-xxhdpi │ │ │ └── ic_bg_service_small.png │ │ │ ├── drawable │ │ │ ├── app_icon.png │ │ │ ├── launch_background.xml │ │ │ └── logo.png │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-ldpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── values-night │ │ │ └── styles.xml │ │ │ ├── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ │ └── xml │ │ │ └── file_provider_paths.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── arm │ ├── .gitignore │ ├── build.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ └── assets │ │ └── site_packages_arm.zip ├── arm64 │ ├── .gitignore │ ├── build.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ └── assets │ │ └── site_packages_arm64.zip ├── arm64_tor │ ├── .gitignore │ ├── build.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ └── assets │ │ └── tor_arm64.zip ├── arm_tor │ ├── build.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ └── assets │ │ └── tor_arm.zip ├── build.gradle ├── common │ ├── .gitignore │ ├── build.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ └── assets │ │ └── zeronet_py3.zip ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── nativelibs_tor │ ├── .gitignore │ ├── build.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ └── jniLibs │ │ ├── arm64-v8a │ │ └── libtor.so │ │ ├── armeabi-v7a │ │ └── libtor.so │ │ └── x86_64 │ │ └── libtor.so ├── settings.gradle ├── settings_aar.gradle ├── x86 │ ├── .gitignore │ ├── build.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ └── assets │ │ └── site_packages_x86.zip ├── x86_64 │ ├── .gitignore │ ├── build.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ └── assets │ │ └── site_packages_x86_64.zip ├── x86_64_tor │ ├── .gitignore │ ├── build.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ └── assets │ │ └── tor_x86_64.zip └── x86_tor │ ├── .gitignore │ ├── build.gradle │ └── src │ └── main │ ├── AndroidManifest.xml │ └── assets │ └── tor_x86.zip ├── assets ├── app_icon.ico ├── developers │ ├── canewsin.jpg │ └── pramukesh.jpg ├── filters │ ├── filters-tmp.json │ ├── filters.json │ ├── sites-miners.json │ ├── sites-porn.json │ ├── users-porn.json │ └── users-spamlist.json ├── icons │ ├── facebook.png │ ├── facebook_dark.png │ ├── github.png │ ├── github_dark.png │ ├── twitter.png │ └── twitter_dark.png └── logo.png ├── buildapk.bat ├── buildtools ├── compile.bat └── utils.dart ├── fastlane └── metadata │ └── android │ └── en-US │ ├── changelogs │ └── 70.txt │ ├── full_description.txt │ ├── images │ ├── featureGraphic.png │ ├── icon.png │ └── phoneScreenshots │ │ ├── 1.png │ │ ├── 2.png │ │ ├── 3.png │ │ ├── 4.png │ │ ├── 5.png │ │ └── 6.png │ ├── short_description.txt │ ├── title.txt │ └── video.txt ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-1024x1024@1x.png │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ └── Icon-App-83.5x83.5@2x.png │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── Runner-Bridging-Header.h ├── lib ├── controllers │ ├── strings.dart │ ├── uicontroller.dart │ └── varcontroller.dart ├── imports.dart ├── main.dart ├── models │ ├── enums.dart │ └── models.dart ├── others │ ├── common.dart │ ├── constants.dart │ ├── extensions.dart │ ├── native.dart │ ├── utils.dart │ ├── zeronet_isolate.dart │ ├── zeronet_service.dart │ └── zeronet_utils.dart └── widgets │ └── loading_page.dart ├── linux ├── .gitignore ├── CMakeLists.txt ├── flutter │ ├── CMakeLists.txt │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ └── generated_plugins.cmake ├── main.cc ├── my_application.cc └── my_application.h ├── pubspec.yaml ├── shorebird.yaml ├── version.properties └── windows ├── .gitignore ├── CMakeLists.txt ├── flutter ├── CMakeLists.txt ├── generated_plugin_registrant.cc ├── generated_plugin_registrant.h └── generated_plugins.cmake └── runner ├── CMakeLists.txt ├── Runner.rc ├── flutter_window.cpp ├── flutter_window.h ├── main.cpp ├── resource.h ├── resources └── app_icon.ico ├── runner.exe.manifest ├── utils.cpp ├── utils.h ├── win32_window.cpp └── win32_window.h /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: canewsin 4 | patreon: # Replace with a single Patreon username e.g., user1 5 | open_collective: # Replace with a single Open Collective username e.g., user1 6 | ko_fi: canewsin 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: canewsin 10 | issuehunt: # Replace with a single IssueHunt username e.g., user1 11 | otechie: # Replace with a single Otechie username e.g., user1 12 | custom: ['https://paypal.me/PramUkesh'] 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | .vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | /build/ 32 | libOld/ 33 | .project 34 | .classpath 35 | *.prefs 36 | pubspec.lock 37 | 38 | # Web related 39 | lib/generated_plugin_registrant.dart 40 | 41 | # Exceptions to above rules. 42 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 43 | 44 | # Android related 45 | # **/android/**/gradle-wrapper.jar 46 | **/android/.gradle 47 | **/android/captures/ 48 | # **/android/gradlew 49 | # **/android/gradlew.bat 50 | **/android/local.properties 51 | **/android/key.properties 52 | **/android/**/GeneratedPluginRegistrant.java 53 | 54 | # iOS/XCode related 55 | **/ios/**/*.mode1v3 56 | **/ios/**/*.mode2v3 57 | **/ios/**/*.moved-aside 58 | **/ios/**/*.pbxuser 59 | **/ios/**/*.perspectivev3 60 | **/ios/**/*sync/ 61 | **/ios/**/.sconsign.dblite 62 | **/ios/**/.tags* 63 | **/ios/**/.vagrant/ 64 | **/ios/**/DerivedData/ 65 | **/ios/**/Icon? 66 | **/ios/**/Pods/ 67 | **/ios/**/.symlinks/ 68 | **/ios/**/profile 69 | **/ios/**/xcuserdata 70 | **/ios/.generated/ 71 | **/ios/Flutter/App.framework 72 | **/ios/Flutter/Flutter.framework 73 | **/ios/Flutter/Generated.xcconfig 74 | **/ios/Flutter/app.flx 75 | **/ios/Flutter/app.zip 76 | **/ios/Flutter/flutter_assets/ 77 | **/ios/ServiceDefinitions.json 78 | **/ios/Runner/GeneratedPluginRegistrant.* 79 | **/macos/Flutter/GeneratedPluginRegistrant.* 80 | **/flutter_export_environment.sh 81 | **/Flutter-Generated.xcconfig 82 | 83 | # Exceptions to above rules. 84 | !**/ios/**/default.mode1v3 85 | !**/ios/**/default.mode2v3 86 | !**/ios/**/default.pbxuser 87 | !**/ios/**/default.perspectivev3 88 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 89 | 90 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "android/common_python"] 2 | path = android/common_python 3 | url = https://github.com/canewsin/common_python.git 4 | [submodule "android/arm_python"] 5 | path = android/arm_python 6 | url = https://github.com/canewsin/arm_python.git 7 | [submodule "android/arm64_python"] 8 | path = android/arm64_python 9 | url = https://github.com/canewsin/arm64_python.git 10 | [submodule "android/x86_64_python"] 11 | path = android/x86_64_python 12 | url = https://github.com/canewsin/x86_64_python.git 13 | [submodule "android/x86_python"] 14 | path = android/x86_python 15 | url = https://github.com/canewsin/x86_python.git 16 | [submodule "lib/dashboard"] 17 | path = lib/dashboard 18 | url = https://github.com/ZeroNetX/Dashboard-Engine.git 19 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled. 5 | 6 | version: 7 | revision: 84a1e904f44f9b0e9c4510138010edcc653163f8 8 | channel: stable 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: 84a1e904f44f9b0e9c4510138010edcc653163f8 17 | base_revision: 84a1e904f44f9b0e9c4510138010edcc653163f8 18 | - platform: android 19 | create_revision: 84a1e904f44f9b0e9c4510138010edcc653163f8 20 | base_revision: 84a1e904f44f9b0e9c4510138010edcc653163f8 21 | 22 | # User provided section 23 | 24 | # List of Local paths (relative to this file) that should be 25 | # ignored by the migrate tool. 26 | # 27 | # Files that are not part of the templates will be ignored by default. 28 | unmanaged_files: 29 | - 'lib/main.dart' 30 | - 'ios/Runner.xcodeproj/project.pbxproj' 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ZeroNet Mobile 2 | [![Codemagic build status](https://api.codemagic.io/apps/5f755f0647fecf7a4f25751a/5f75609747fecf958ea171b0/status_badge.svg)](https://codemagic.io/apps/5f755f0647fecf7a4f25751a/5f75609747fecf958ea171b0/latest_build) 3 | 4 | ZeroNet Mobile is an Android Client for [ZeroNet](https://zeronet.dev), a platform for decentralized websites using Bitcoin crypto and the BitTorrent network. you can learn more about ZeroNet at https://zeronet.dev/. 5 | 6 | [Download from Google Play](https://play.google.com/store/apps/details?id=in.canews.zeronetmobile) 9 | 10 | ## Installation 11 | 12 | ### From Google PlayStore : 13 | #### Android (arm, arm64, x86) 14 | - minimum Android version supported 16 (JellyBean). 15 | - Google Play Store Link https://play.google.com/store/apps/details?id=in.canews.zeronetmobile 16 | 17 | #### Compiling Source : 18 | 19 | You need Flutter Framework to compile this App from Source. 20 | 21 | #### Installing Flutter : https://flutter.dev/docs/get-started/install 22 | 23 | ``` 24 | git clone https://github.com/canewsin/zeronet_mobile.git 25 | cd zeronet_mobile 26 | flutter packages get 27 | ``` 28 | 29 | After that create a file named `key.properties` in `android` directory 30 | and fill the below details, which are in capital letters, with your details. 31 | ``` 32 | storeFile=ANDROID_KEY_STORE_FILE_PATH 33 | storePassword=KEY_STORE_PASSWORD 34 | keyAlias=KEY_ALIAS 35 | keyPassword=KEY_PASSWORD 36 | ``` 37 | 38 | in root folder 39 | 40 | to build apk 41 | ``` 42 | flutter build apk --no-shrink 43 | ``` 44 | 45 | to build appbundle 46 | ``` 47 | flutter build appbundle --no-shrink 48 | ``` 49 | 50 | to run the app in Android Device / Emulator 51 | 52 | ``` 53 | flutter run 54 | ``` 55 | 56 | ## Donate 57 | BTC(Preferred) : 58 | 59 | `1ZeroNetyV5mKY9JF1gsm82TuBXHpfdLX` 60 | 61 | ETH : 62 | 63 | `0xa81a32dcce8e5bcb9792daa19ae7f964699ee536` 64 | 65 | UPI(Indian Users) : 66 | 67 | `pramukesh@upi` 68 | 69 | Liberapay : 70 | 71 | `https://liberapay.com/canews.in/donate` 72 | 73 | ## Contribute 74 | If you want to support project's further development, you can contribute your time or money, If you want to contribute money you can send bitcoin or other supported crypto currencies to above addresses or buy in-app purchases, if want to contribute translations or code. 75 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | #include: package:flutter_lints/flutter.yaml 11 | 12 | #linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | #rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | !gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | # /gradlew 5 | # /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | /build/ 9 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def versionProperties = new Properties() 10 | def versionPropertiesFile = rootProject.file('../version.properties') 11 | if (versionPropertiesFile.exists()) { 12 | versionPropertiesFile.withReader('UTF-8') { reader -> 13 | versionProperties.load(reader) 14 | } 15 | } 16 | 17 | def flutterRoot = localProperties.getProperty('flutter.sdk') 18 | if (flutterRoot == null) { 19 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 20 | } 21 | 22 | def flutterVersionCode = versionProperties.getProperty('flutter.versionCode') 23 | if (flutterVersionCode == null) { 24 | flutterVersionCode = '1' 25 | } 26 | 27 | def flutterVersionName = versionProperties.getProperty('flutter.versionName') 28 | if (flutterVersionName == null) { 29 | flutterVersionName = '1.0' 30 | } 31 | def keystoreProperties = new Properties() 32 | def keystorePropertiesFile = rootProject.file('key.properties') 33 | if (keystorePropertiesFile.exists()) { 34 | keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) 35 | } 36 | apply plugin: 'com.android.application' 37 | apply plugin: 'kotlin-android' 38 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 39 | apply plugin: 'com.jeppeman.locallydynamic' 40 | 41 | android { 42 | compileSdkVersion 34 43 | 44 | sourceSets { 45 | main.java.srcDirs += 'src/main/kotlin' 46 | } 47 | 48 | lintOptions { 49 | disable 'InvalidPackage' 50 | } 51 | 52 | defaultConfig { 53 | applicationId "in.canews.zeronetmobile" 54 | minSdkVersion 21 55 | targetSdkVersion 34 56 | versionCode flutterVersionCode.toInteger() 57 | versionName flutterVersionName 58 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 59 | manifestPlaceholders['foregroundServiceType'] = 'dataSync' 60 | } 61 | 62 | compileOptions { 63 | sourceCompatibility JavaVersion.VERSION_11 64 | targetCompatibility JavaVersion.VERSION_11 65 | } 66 | 67 | signingConfigs { 68 | release { 69 | keyAlias keystoreProperties['keyAlias'] 70 | keyPassword keystoreProperties['keyPassword'] 71 | storeFile file(keystoreProperties['storeFile']) 72 | storePassword keystoreProperties['storePassword'] 73 | } 74 | } 75 | 76 | buildTypes { 77 | 78 | release { 79 | signingConfig signingConfigs.release 80 | minifyEnabled = false 81 | shrinkResources = false 82 | } 83 | 84 | debug { 85 | applicationIdSuffix '.debug' 86 | signingConfig signingConfigs.release 87 | locallyDynamic { 88 | enabled = false 89 | throttleDownloadBy = 1000 90 | } 91 | defaultConfig.ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86_64' 92 | } 93 | } 94 | dynamicFeatures = [":arm64", ":arm", ":common", ":x86", ":x86_64", 95 | ":arm64_python", ":arm_python", ":common_python", ":x86_python", ":x86_64_python", 96 | ":arm64_tor", ":arm_tor", ":x86_tor", ":x86_64_tor" 97 | ] 98 | 99 | 100 | } 101 | 102 | flutter { 103 | source '../..' 104 | } 105 | 106 | dependencies { 107 | // def billing_version = '4.0.0' 108 | // implementation "com.android.billingclient:billing:$billing_version" 109 | 110 | def work_version = "2.7.0" 111 | // Force WorkManager 2.6.0 for transitive dependency 112 | implementation("androidx.work:work-runtime-ktx:$work_version") { 113 | force = true 114 | } 115 | 116 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 117 | implementation 'com.google.android.gms:play-services-base:17.6.0' 118 | 119 | //Duplicate Classes Issue https://stackoverflow.com/a/60492942 120 | // implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava' 121 | 122 | debugImplementation 'com.jeppeman.locallydynamic:locallydynamic-debug:0.3' 123 | releaseImplementation 'com.jeppeman.locallydynamic:locallydynamic:0.3' 124 | 125 | // testImplementation 'junit:junit:4.12' 126 | // androidTestImplementation 'androidx.test:runner:1.2.0' 127 | // androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' 128 | } 129 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/debug/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/app/src/debug/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/debug/res/mipmap-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/app/src/debug/res/mipmap-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/debug/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/app/src/debug/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/debug/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/app/src/debug/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/debug/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/app/src/debug/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/debug/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/app/src/debug/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 27 | 35 | 36 | 37 | 38 | 39 | 40 | 43 | 45 | 48 | 51 | 56 | 57 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /android/app/src/main/jniLibs/arm64-v8a/libopenssl.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/app/src/main/jniLibs/arm64-v8a/libopenssl.so -------------------------------------------------------------------------------- /android/app/src/main/jniLibs/arm64-v8a/libpython3.8.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/app/src/main/jniLibs/arm64-v8a/libpython3.8.so -------------------------------------------------------------------------------- /android/app/src/main/jniLibs/arm64-v8a/libtor.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/app/src/main/jniLibs/arm64-v8a/libtor.so -------------------------------------------------------------------------------- /android/app/src/main/jniLibs/armeabi-v7a/libopenssl.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/app/src/main/jniLibs/armeabi-v7a/libopenssl.so -------------------------------------------------------------------------------- /android/app/src/main/jniLibs/armeabi-v7a/libpython3.8.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/app/src/main/jniLibs/armeabi-v7a/libpython3.8.so -------------------------------------------------------------------------------- /android/app/src/main/jniLibs/armeabi-v7a/libtor.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/app/src/main/jniLibs/armeabi-v7a/libtor.so -------------------------------------------------------------------------------- /android/app/src/main/jniLibs/x86/libopenssl.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/app/src/main/jniLibs/x86/libopenssl.so -------------------------------------------------------------------------------- /android/app/src/main/jniLibs/x86/libpython3.8.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/app/src/main/jniLibs/x86/libpython3.8.so -------------------------------------------------------------------------------- /android/app/src/main/jniLibs/x86/libtor.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/app/src/main/jniLibs/x86/libtor.so -------------------------------------------------------------------------------- /android/app/src/main/jniLibs/x86_64/libopenssl.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/app/src/main/jniLibs/x86_64/libopenssl.so -------------------------------------------------------------------------------- /android/app/src/main/jniLibs/x86_64/libpython3.8.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/app/src/main/jniLibs/x86_64/libpython3.8.so -------------------------------------------------------------------------------- /android/app/src/main/jniLibs/x86_64/libtor.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/app/src/main/jniLibs/x86_64/libtor.so -------------------------------------------------------------------------------- /android/app/src/main/kotlin/in/canews/zeronetmobile/MyApplication.kt: -------------------------------------------------------------------------------- 1 | package `in`.canews.zeronetmobile 2 | 3 | import android.app.Activity 4 | import android.content.Context 5 | import com.google.android.play.core.splitcompat.SplitCompat 6 | import com.google.android.play.core.splitcompat.SplitCompatApplication 7 | import io.flutter.FlutterInjector 8 | 9 | 10 | internal class MyApplication : SplitCompatApplication() { 11 | 12 | override fun onCreate() { 13 | super.onCreate() 14 | FlutterInjector.instance().flutterLoader().startInitialization(this) 15 | } 16 | 17 | private var mCurrentActivity: Activity? = null 18 | 19 | fun getCurrentActivity(): Activity? { 20 | return mCurrentActivity 21 | } 22 | 23 | fun setCurrentActivity(mCurrentActivity: Activity?) { 24 | this.mCurrentActivity = mCurrentActivity 25 | } 26 | 27 | override fun attachBaseContext(base: Context?) { 28 | super.attachBaseContext(base) 29 | SplitCompat.install(base!!) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-anydpi-v24/ic_bg_service_small.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 7 | 9 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-hdpi/ic_bg_service_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/app/src/main/res/drawable-hdpi/ic_bg_service_small.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-mdpi/ic_bg_service_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/app/src/main/res/drawable-mdpi/ic_bg_service_small.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 11 | 14 | 15 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xhdpi/ic_bg_service_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/app/src/main/res/drawable-xhdpi/ic_bg_service_small.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxhdpi/ic_bg_service_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/app/src/main/res/drawable-xxhdpi/ic_bg_service_small.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/app/src/main/res/drawable/app_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 13 | 14 | 16 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/app/src/main/res/drawable/logo.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/app/src/main/res/mipmap-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Arm64 Binaries 3 | Arm Binaries 4 | Common Binaries 5 | x86 Binaries 6 | x86_64 Binaries 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/main/res/xml/file_provider_paths.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/arm/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /android/arm/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.dynamic-feature' 2 | 3 | android { 4 | compileSdkVersion 31 5 | 6 | 7 | defaultConfig { 8 | minSdkVersion 21 9 | 10 | } 11 | 12 | compileOptions { 13 | sourceCompatibility JavaVersion.VERSION_11 14 | targetCompatibility JavaVersion.VERSION_11 15 | } 16 | 17 | } 18 | 19 | dependencies { 20 | implementation fileTree(dir: 'libs', include: ['*.jar']) 21 | implementation project(':app') 22 | } 23 | -------------------------------------------------------------------------------- /android/arm/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 7 | 8 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /android/arm/src/main/assets/site_packages_arm.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/arm/src/main/assets/site_packages_arm.zip -------------------------------------------------------------------------------- /android/arm64/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /android/arm64/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.dynamic-feature' 2 | 3 | android { 4 | compileSdkVersion 31 5 | 6 | 7 | defaultConfig { 8 | minSdkVersion 21 9 | 10 | } 11 | 12 | compileOptions { 13 | sourceCompatibility JavaVersion.VERSION_11 14 | targetCompatibility JavaVersion.VERSION_11 15 | } 16 | 17 | } 18 | 19 | dependencies { 20 | implementation fileTree(dir: 'libs', include: ['*.jar']) 21 | implementation project(':app') 22 | } 23 | -------------------------------------------------------------------------------- /android/arm64/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 7 | 8 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /android/arm64/src/main/assets/site_packages_arm64.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/arm64/src/main/assets/site_packages_arm64.zip -------------------------------------------------------------------------------- /android/arm64_tor/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /android/arm64_tor/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.dynamic-feature' 2 | 3 | android { 4 | compileSdkVersion 31 5 | 6 | 7 | defaultConfig { 8 | minSdkVersion 21 9 | 10 | } 11 | 12 | compileOptions { 13 | sourceCompatibility JavaVersion.VERSION_11 14 | targetCompatibility JavaVersion.VERSION_11 15 | } 16 | 17 | } 18 | 19 | dependencies { 20 | implementation fileTree(dir: 'libs', include: ['*.jar']) 21 | implementation project(':app') 22 | } 23 | -------------------------------------------------------------------------------- /android/arm64_tor/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 7 | 8 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /android/arm64_tor/src/main/assets/tor_arm64.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/arm64_tor/src/main/assets/tor_arm64.zip -------------------------------------------------------------------------------- /android/arm_tor/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.dynamic-feature' 2 | 3 | android { 4 | compileSdkVersion 31 5 | 6 | 7 | defaultConfig { 8 | minSdkVersion 21 9 | 10 | } 11 | 12 | compileOptions { 13 | sourceCompatibility JavaVersion.VERSION_11 14 | targetCompatibility JavaVersion.VERSION_11 15 | } 16 | 17 | } 18 | 19 | dependencies { 20 | implementation fileTree(dir: 'libs', include: ['*.jar']) 21 | implementation project(':app') 22 | } 23 | -------------------------------------------------------------------------------- /android/arm_tor/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 7 | 8 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /android/arm_tor/src/main/assets/tor_arm.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/arm_tor/src/main/assets/tor_arm.zip -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.8.10' 3 | ext.gradle_version = '7.4.2' 4 | repositories { 5 | google() 6 | maven { 7 | url "https://plugins.gradle.org/m2" 8 | } 9 | } 10 | 11 | dependencies { 12 | classpath "com.android.tools.build:gradle:$gradle_version" 13 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 14 | classpath "com.jeppeman.locallydynamic.gradle:plugin:0.2" 15 | } 16 | } 17 | 18 | allprojects { 19 | repositories { 20 | google() 21 | } 22 | } 23 | 24 | rootProject.buildDir = '../build' 25 | subprojects { 26 | project.buildDir = "${rootProject.buildDir}/${project.name}" 27 | } 28 | subprojects { 29 | project.evaluationDependsOn(':app') 30 | } 31 | 32 | tasks.register("clean", Delete) { 33 | delete rootProject.buildDir 34 | } 35 | -------------------------------------------------------------------------------- /android/common/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /android/common/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.dynamic-feature' 2 | 3 | android { 4 | compileSdkVersion 31 5 | 6 | 7 | defaultConfig { 8 | minSdkVersion 21 9 | 10 | } 11 | 12 | compileOptions { 13 | sourceCompatibility JavaVersion.VERSION_11 14 | targetCompatibility JavaVersion.VERSION_11 15 | } 16 | 17 | } 18 | 19 | dependencies { 20 | implementation fileTree(dir: 'libs', include: ['*.jar']) 21 | implementation project(':app') 22 | } 23 | -------------------------------------------------------------------------------- /android/common/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 7 | 8 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /android/common/src/main/assets/zeronet_py3.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/common/src/main/assets/zeronet_py3.zip -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx4096M 2 | # TODO : Once Binaries are compiled with new NDK than NDK 21 RC1 3 | # we can remove below uncompressed property 4 | # https://stackoverflow.com/a/55969995 5 | android.bundle.enableUncompressedNativeLibs=false 6 | android.experimental.enableNewResourceShrinker=true 7 | android.enableR8=true 8 | android.useAndroidX=true 9 | android.enableJetifier=true 10 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip 6 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /android/nativelibs_tor/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /android/nativelibs_tor/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.dynamic-feature' 2 | 3 | android { 4 | compileSdkVersion 29 5 | 6 | 7 | defaultConfig { 8 | minSdkVersion 21 9 | 10 | } 11 | 12 | compileOptions { 13 | sourceCompatibility JavaVersion.VERSION_11 14 | targetCompatibility JavaVersion.VERSION_11 15 | } 16 | 17 | } 18 | 19 | dependencies { 20 | implementation fileTree(dir: 'libs', include: ['*.jar']) 21 | implementation project(':app') 22 | } 23 | -------------------------------------------------------------------------------- /android/nativelibs_tor/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /android/nativelibs_tor/src/main/jniLibs/arm64-v8a/libtor.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/nativelibs_tor/src/main/jniLibs/arm64-v8a/libtor.so -------------------------------------------------------------------------------- /android/nativelibs_tor/src/main/jniLibs/armeabi-v7a/libtor.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/nativelibs_tor/src/main/jniLibs/armeabi-v7a/libtor.so -------------------------------------------------------------------------------- /android/nativelibs_tor/src/main/jniLibs/x86_64/libtor.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/nativelibs_tor/src/main/jniLibs/x86_64/libtor.so -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | include ':common' 3 | include ':arm64' 4 | include ':arm' 5 | include ':x86' 6 | include ':x86_64' 7 | include ':common_python' 8 | include ':arm64_python' 9 | include ':arm_python' 10 | include ':x86_python' 11 | include ':x86_64_python' 12 | include ':arm64_tor' 13 | include ':arm_tor' 14 | include ':x86_tor' 15 | include ':x86_64_tor' 16 | 17 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 18 | 19 | def plugins = new Properties() 20 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 21 | if (pluginsFile.exists()) { 22 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 23 | } 24 | 25 | plugins.each { name, path -> 26 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 27 | include ":$name" 28 | project(":$name").projectDir = pluginDirectory 29 | } 30 | -------------------------------------------------------------------------------- /android/settings_aar.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /android/x86/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /android/x86/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.dynamic-feature' 2 | 3 | android { 4 | compileSdkVersion 31 5 | 6 | 7 | defaultConfig { 8 | minSdkVersion 21 9 | 10 | } 11 | 12 | compileOptions { 13 | sourceCompatibility JavaVersion.VERSION_11 14 | targetCompatibility JavaVersion.VERSION_11 15 | } 16 | 17 | } 18 | 19 | dependencies { 20 | implementation fileTree(dir: 'libs', include: ['*.jar']) 21 | implementation project(':app') 22 | } 23 | -------------------------------------------------------------------------------- /android/x86/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 7 | 8 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /android/x86/src/main/assets/site_packages_x86.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/x86/src/main/assets/site_packages_x86.zip -------------------------------------------------------------------------------- /android/x86_64/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /android/x86_64/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.dynamic-feature' 2 | 3 | android { 4 | compileSdkVersion 31 5 | 6 | 7 | defaultConfig { 8 | minSdkVersion 21 9 | 10 | } 11 | 12 | compileOptions { 13 | sourceCompatibility JavaVersion.VERSION_11 14 | targetCompatibility JavaVersion.VERSION_11 15 | } 16 | 17 | } 18 | 19 | dependencies { 20 | implementation fileTree(dir: 'libs', include: ['*.jar']) 21 | implementation project(':app') 22 | } 23 | -------------------------------------------------------------------------------- /android/x86_64/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 7 | 8 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /android/x86_64/src/main/assets/site_packages_x86_64.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/x86_64/src/main/assets/site_packages_x86_64.zip -------------------------------------------------------------------------------- /android/x86_64_tor/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /android/x86_64_tor/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.dynamic-feature' 2 | 3 | android { 4 | compileSdkVersion 31 5 | 6 | 7 | defaultConfig { 8 | minSdkVersion 21 9 | 10 | } 11 | 12 | compileOptions { 13 | sourceCompatibility JavaVersion.VERSION_11 14 | targetCompatibility JavaVersion.VERSION_11 15 | } 16 | 17 | } 18 | 19 | dependencies { 20 | implementation fileTree(dir: 'libs', include: ['*.jar']) 21 | implementation project(':app') 22 | } 23 | -------------------------------------------------------------------------------- /android/x86_64_tor/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 7 | 8 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /android/x86_64_tor/src/main/assets/tor_x86_64.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/x86_64_tor/src/main/assets/tor_x86_64.zip -------------------------------------------------------------------------------- /android/x86_tor/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /android/x86_tor/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.dynamic-feature' 2 | 3 | android { 4 | compileSdkVersion 31 5 | 6 | 7 | defaultConfig { 8 | minSdkVersion 21 9 | 10 | } 11 | 12 | compileOptions { 13 | sourceCompatibility JavaVersion.VERSION_11 14 | targetCompatibility JavaVersion.VERSION_11 15 | } 16 | 17 | } 18 | 19 | dependencies { 20 | implementation fileTree(dir: 'libs', include: ['*.jar']) 21 | implementation project(':app') 22 | } 23 | -------------------------------------------------------------------------------- /android/x86_tor/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 7 | 8 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /android/x86_tor/src/main/assets/tor_x86.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/android/x86_tor/src/main/assets/tor_x86.zip -------------------------------------------------------------------------------- /assets/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/assets/app_icon.ico -------------------------------------------------------------------------------- /assets/developers/canewsin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/assets/developers/canewsin.jpg -------------------------------------------------------------------------------- /assets/developers/pramukesh.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/assets/developers/pramukesh.jpg -------------------------------------------------------------------------------- /assets/filters/filters-tmp.json: -------------------------------------------------------------------------------- 1 | { 2 | "includes": { 3 | "tmp/filters/sites-porn.json": { 4 | "address": "tmp", 5 | "date_added": 1604971003.9685245, 6 | "description": "Porn Sites", 7 | "inner_path": "filters/sites-porn.json" 8 | }, 9 | "tmp/filters/sites-miners.json": { 10 | "address": "tmp", 11 | "date_added": 1604972074.2051556, 12 | "description": "Crypto Miner Sites", 13 | "inner_path": "filters/sites-miners.json" 14 | }, 15 | "tmp/filters/users-porn.json": { 16 | "address": "tmp", 17 | "date_added": 1604970823.2421556, 18 | "description": "Users Who Post Porn on Social Media", 19 | "inner_path": "filters/users-porn.json" 20 | }, 21 | "tmp/filters/users-spamlist.json": { 22 | "address": "tmp", 23 | "date_added": 1604971226.4319663, 24 | "description": "Users Who Post Spam", 25 | "inner_path": "filters/users-spamlist.json" 26 | } 27 | }, 28 | "mutes": {}, 29 | "siteblocks": {} 30 | } -------------------------------------------------------------------------------- /assets/filters/filters.json: -------------------------------------------------------------------------------- 1 | { 2 | "includes": { 3 | "15UYrA7aXr2Nto1Gg4yWXpY3EAJwafMTNk/filters/sites-porn.json": { 4 | "address": "15UYrA7aXr2Nto1Gg4yWXpY3EAJwafMTNk", 5 | "date_added": 1604971003.9685245, 6 | "description": "Porn Sites", 7 | "inner_path": "filters/sites-porn.json" 8 | }, 9 | "15UYrA7aXr2Nto1Gg4yWXpY3EAJwafMTNk/filters/sites-miners.json": { 10 | "address": "15UYrA7aXr2Nto1Gg4yWXpY3EAJwafMTNk", 11 | "date_added": 1604972074.2051556, 12 | "description": "Crypto Miner Sites", 13 | "inner_path": "filters/sites-miners.json" 14 | }, 15 | "15UYrA7aXr2Nto1Gg4yWXpY3EAJwafMTNk/filters/users-porn.json": { 16 | "address": "15UYrA7aXr2Nto1Gg4yWXpY3EAJwafMTNk", 17 | "date_added": 1604970823.2421556, 18 | "description": "Users Who Post Porn on Social Media", 19 | "inner_path": "filters/users-porn.json" 20 | }, 21 | "15UYrA7aXr2Nto1Gg4yWXpY3EAJwafMTNk/filters/users-spamlist.json": { 22 | "address": "15UYrA7aXr2Nto1Gg4yWXpY3EAJwafMTNk", 23 | "date_added": 1604971226.4319663, 24 | "description": "Users Who Post Spam", 25 | "inner_path": "filters/users-spamlist.json" 26 | } 27 | }, 28 | "mutes": {}, 29 | "siteblocks": {} 30 | } -------------------------------------------------------------------------------- /assets/filters/sites-miners.json: -------------------------------------------------------------------------------- 1 | { 2 | "siteblocks": { 3 | "13eFkhbXXQcJqd729zRLL9tMxxhz9d4UA6": { 4 | "date_added": 1530012785, 5 | "name": "EulerFinder", 6 | "reason": "Includes calls to online coinhive script(with option to disable but sets to 50% on refresh)" 7 | }, 8 | "1PXUne5szFdu4di5EV4gy9Qo7p8tP5p1VX": { 9 | "date_added": 1530012785, 10 | "name": "The Pedophile/Rapist Hitlist", 11 | "reason": "Includes an offline script(/js/coinhive.min.js)" 12 | }, 13 | "1JArw6Qb7cG6NuZBqvBSprURr2aaZdCFq9": { 14 | "date_added": 1541928660, 15 | "name": "C&P Zite Index", 16 | "reason": "Includes an online coinhive script and anti adblock(BlockAdBlock)" 17 | }, 18 | "1CS9y8BCXC7iXTqDMaYnwN9br8WaRbUeJV": { 19 | "date_added": 1541928660, 20 | "name": "C&P Video Share", 21 | "reason": "Includes an online coinhive script and anti adblock(BlockAdBlock)" 22 | }, 23 | "13WfLQv2nWXYBNUEL3PkWwGUe3H7qkTF5Y": { 24 | "date_added": 1541928660, 25 | "name": "C&P Forum", 26 | "reason": "Includes an online coinhive script and anti adblock(BlockAdBlock)" 27 | }, 28 | "14YK7V93HNLJb94PFrKj4aQMxPVkrbZ3oL": { 29 | "date_added": 1541928660, 30 | "name": "C&P File Share", 31 | "reason": "Includes an online coinhive script and anti adblock(BlockAdBlock)" 32 | }, 33 | "1RuLFAr8pJMdwMWaLfp5X5ousDZHXv8K4": { 34 | "date_added": 1541928660, 35 | "name": "The Chlorates and Perchlorates", 36 | "reason": "Includes an online coinhive script and anti adblock(BlockAdBlock)" 37 | }, 38 | "16AzWR6xfhVvrmvQCm4mt7rN17CWZTCJYS": { 39 | "date_added": 1541928660, 40 | "name": "Receptek Sufnipirotechnikusoknak", 41 | "reason": "Includes an online coinhive script" 42 | }, 43 | "1CpAXQVfedrNVKSLJMKEtrWNvU8KMXJzAt": { 44 | "date_added": 1541928660, 45 | "name": "PyroMaster minden ami érdekes", 46 | "reason": "Includes anti adblock(BlockAdBlock) suspiciously no coinhive (note to self: check and remove latter)" 47 | }, 48 | "16WRGSqD26sfYiVBsBQg6y1Sd3YJP6Q3SF": { 49 | "date_added": 1542661064, 50 | "name": "PyroData & PyroGuide", 51 | "reason": "Includes an online coinhive script and anti adblock(BlockAdBlock)" 52 | }, 53 | "1KjLxJ6TfeRvrPX1LkUtkFLfTp4en7j9uf": { 54 | "date_added": 1541928660, 55 | "name": "???", 56 | "reason": "[sourced by tips of others](todo actually check it when it loads)Includes an online coinhive script" 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /assets/filters/users-porn.json: -------------------------------------------------------------------------------- 1 | { 2 | "mutes": { 3 | "17TFi7VtcyxehZB8JUN43trfr5hkjnoHsc": { 4 | "cert_user_id": "foxtrot@zeroid.bit", 5 | "date_added": 1, 6 | "reason": "Pornography content poster on ZeroMe", 7 | "source": "ZeroMe" 8 | }, 9 | "1DCJkxufYgBd8pj8VnkVXaGUCBJiq8g9ai": { 10 | "cert_user_id": "kheyflix@zeroid.bit", 11 | "date_added": 1, 12 | "reason": "Pornography content poster on ZeroMe", 13 | "source": "ZeroMe" 14 | }, 15 | "1HSJXS26WAFxab3etLidavpj5zki3bC1Pm": { 16 | "cert_user_id": "tumbleweed@zeroid.bit", 17 | "date_added": 1, 18 | "source": "ZeroMe", 19 | "reason": "Long term pornography content poster on ZeroMe site. Unsure about his activities on other sites." 20 | }, 21 | "1AXWniok4qHQTGgP9szgQuQfXe9VxZXLwi": { 22 | "cert_user_id": "colkurtz@zeroid.bit", 23 | "date_added": 1, 24 | "source": "ZeroMe", 25 | "reason": "Long term pornography content poster on ZeroMe site. Unsure about his activities on other sites." 26 | }, 27 | "1FzppM7Wv3LTgRLqApEBaSkr51QDJki8nJ": { 28 | "cert_user_id": "bite@zeroid.bit", 29 | "date_added": 1, 30 | "source": "ZeroMe", 31 | "reason": "Pornography content poster on ZeroMe site. Unsure about his activities on other sites, seen no other content from him." 32 | }, 33 | "13qMquPdWJ59qDHa4e9oJK2kpnHDe1HYV1": { 34 | "cert_user_id": "3dporno@zeroid.bit", 35 | "date_added": 1, 36 | "source": "ZeroMe", 37 | "reason": "Long term pornography content poster on ZeroMe site. Unsure about his activities on other sites." 38 | }, 39 | "17k3PvQS8X85js1PBuna6w8e6XjotCiT5L": { 40 | "cert_user_id": "alfao@zeroid.bit", 41 | "date_added": 1, 42 | "source": "ZeroMe", 43 | "reason": "Posting child pornography into general (non pornography targetted) site/s." 44 | }, 45 | "13KYifCo93L2rptejRHcT7oM4qXpqL5u5G": { 46 | "cert_user_id": "woow@zeroid.bit", 47 | "date_added": 1, 48 | "source": "ZeroMe", 49 | "reason": "Posting child pornography into general (non pornography targetted) site/s." 50 | }, 51 | "1JYfgs2tiLHFyWta6eRZnaUTNHiKDGYzNU": { 52 | "cert_user_id": "asukah@zeroid.bit", 53 | "date_added": 1, 54 | "source": "ZeroMe", 55 | "reason": "Posting child pornography into ZeroMe site. Marks himself as a pedo." 56 | }, 57 | "1L4Ev3e99ZaMRqaTPUc5ZwHkWa62oGuFUU": { 58 | "cert_user_id": "jimmyruly@zeroid.bit", 59 | "date_added": 1, 60 | "source": "ZeroMe", 61 | "reason": "Long term pornography content poster on ZeroMe site. Unsure about his activities on other sites." 62 | }, 63 | "1FHN4oukAG7zFUpiC9L2iz7QpQVTuT3xkz": { 64 | "cert_user_id": "nekocross@zeroid.bit", 65 | "date_added": 1, 66 | "source": "KopyKate", 67 | "reason": "Pornography content poster on KopyKate site. Unsure about his activities on other sites." 68 | }, 69 | "17TFi7VtcyxehZB8JUN43trfr5hkjnoHsc": { 70 | "cert_user_id": "foxtrot@zeroid.bit", 71 | "date_added": 1, 72 | "reason": "Pornography content poster", 73 | "source": "ZeroMe" 74 | }, 75 | "1DCJkxufYgBd8pj8VnkVXaGUCBJiq8g9ai": { 76 | "cert_user_id": "kheyflix@zeroid.bit", 77 | "date_added": 1, 78 | "reason": "Pornography content poster", 79 | "source": "ZeroMe" 80 | } 81 | } 82 | } -------------------------------------------------------------------------------- /assets/filters/users-spamlist.json: -------------------------------------------------------------------------------- 1 | { 2 | "mutes" : { 3 | "16LErDGxiEQgmerLmwT2sBrtBeg2PBH3jN": { 4 | "cert_user_id": "zaranet@zeroid.bit", 5 | "date_added": 1549505685.860143, 6 | "reason": "Posting spam about crypto mining sites", 7 | "source": "15UYrA7aXr2Nto1Gg4yWXpY3EAJwafMTNk" 8 | }, 9 | "12fkBZP8Pt6WPujhx1Xc8Rqve8rDKmHoBk": { 10 | "cert_user_id": "lkgskhg@zeroid.bit", 11 | "date_added": 1549505685.860143, 12 | "reason": "Chinese spammer", 13 | "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH" 14 | }, 15 | "14fdwxPt83nTw5vFaXTCR7KQkAxkXuGbAR": { 16 | "cert_user_id": "doom1b@zeroid.bit", 17 | "date_added": 1495182803.383208, 18 | "reason": "Spammer", 19 | "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH" 20 | }, 21 | "18EuCdX79X4qbLEFBDLiaTSbkXU1ojM9A2": { 22 | "cert_user_id": "miter@zeroid.bit", 23 | "date_added": 1549506339.578346, 24 | "reason": "Chinese spammer", 25 | "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH" 26 | }, 27 | "1Abwpgjt1RmxDhhMzCKDsePVUUDSruW4cT": { 28 | "cert_user_id": "zeronetisashi@zeroid.bit", 29 | "date_added": 1549500655.330371, 30 | "reason": "Chinese spammer", 31 | "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH" 32 | }, 33 | "1BKYZXxnwD1Ci92XE4VNkQmWy5HjCC51Lh": { 34 | "cert_user_id": "kasjslg@zeroid.bit", 35 | "date_added": 1549505927.418664, 36 | "reason": "Chinese spammer", 37 | "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH" 38 | }, 39 | "1D4B7XbRYY5p9kx79NtKr3qiShR5Tcpnvo": { 40 | "cert_user_id": "doom1@zeroid.bit", 41 | "date_added": 1495182789.474986, 42 | "reason": "Spammer", 43 | "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH" 44 | }, 45 | "1FCtdTcT4Y1LimfEpRhaHsGKKYiAGjtMaZ": { 46 | "cert_user_id": "goodone@zeroid.bit", 47 | "date_added": 1549489420.202482, 48 | "reason": "Chinese spammer", 49 | "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH" 50 | }, 51 | "1MRSDFESsBXDGvNoZ5ifztA89XfEahA5ka": { 52 | "cert_user_id": "bbxxx@zeroid.bit", 53 | "date_added": 1495183369.513695, 54 | "reason": "Spammer", 55 | "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH" 56 | }, 57 | "1EFPRZRhijiQv6MvhJQLgV2SdPtHR6tJZ": { 58 | "cert_user_id": "immortal0000@zeroid.bit", 59 | "date_added": 1495183624.231652, 60 | "reason": "Spammer", 61 | "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH" 62 | }, 63 | "1GXJzsEWCBdesJY5BtKgJXFQLuMoVPD6ed": { 64 | "cert_user_id": "abnah@zeroid.bit", 65 | "date_added": 1549528840.535473, 66 | "reason": "Chinese spammer", 67 | "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH" 68 | }, 69 | "1QYERLpyBWwtprzJNTtyaNpjgq4aq2kfB": { 70 | "cert_user_id": "afjzvmh@zeroid.bit", 71 | "date_added": 1549536521.766814, 72 | "reason": "Chinese spammer", 73 | "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH" 74 | }, 75 | "1HQsX5fubepwWtHnf4SqNcFVEMa4t8N1jP": { 76 | "cert_user_id": "afnaui@zeroid.bit", 77 | "date_added": 1549538136.695098, 78 | "reason": "Chinese spammer", 79 | "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH" 80 | }, 81 | "1QYERLpyBWwtprzJNTtyaNpjgq4aq2kfB": { 82 | "cert_user_id": "afjzvmh@zeroid.bit", 83 | "date_added": 1549539112.699984, 84 | "reason": "Chinese spammer", 85 | "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH" 86 | }, 87 | "18KRHZjWh7HjvoRLAbVygq94waeWU69SSH": { 88 | "cert_user_id": "ajgaho@zeroid.bit", 89 | "date_added": 1549539909.840917, 90 | "reason": "Chinese spammer", 91 | "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH" 92 | }, 93 | "1Fi7HAnhZ1iu3kuG4oEZPhkiGCqp9WcMaG": { 94 | "cert_user_id": "ajgalfj@zeroid.bit", 95 | "date_added": 1549540102.139871, 96 | "reason": "Chinese spammer", 97 | "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH" 98 | }, 99 | "17VS3A2eHFeMuoRsQX5YofXuCRetQsHVJX": { 100 | "cert_user_id": "17VS3A2eHFeMuoR@millchan", 101 | "date_added": 1550169460.500, 102 | "reason": "Spammer on millchan /jessicanigri/", 103 | "source": "1ADQAHsqsie5PBeQhQgjcKmUu3qdPFg6aA" 104 | }, 105 | "16u5SZKMv9gnxLKQfFE8hYPB9UhFGn5FJw": { 106 | "cert_user_id": "16u5SZKMv9gnxLK@millchan", 107 | "date_added": 1550169460.500, 108 | "reason": "Spammer on millchan /jessicanigri/", 109 | "source": "1ADQAHsqsie5PBeQhQgjcKmUu3qdPFg6aA" 110 | }, 111 | "1QJj8o4h2zgcuozSecB2WqmL6FBeQS1XSB": { 112 | "cert_user_id": "1QJj8o4h2zgcuoz@millchan", 113 | "date_added": 1550169460.500, 114 | "reason": "Spammer on millchan /jessicanigri/", 115 | "source": "1ADQAHsqsie5PBeQhQgjcKmUu3qdPFg6aA" 116 | }, 117 | "15wTgdNkMoX4keYro96QiefAwXtf8FvxYY": { 118 | "cert_user_id": "15wTgdNkMoX4keY@millchan", 119 | "date_added": 1550169460.500, 120 | "reason": "Spammer on millchan /jessicanigri/", 121 | "source": "1ADQAHsqsie5PBeQhQgjcKmUu3qdPFg6aA" 122 | }, 123 | "19eXGqVBwGmKWSfw7MjWknbX5kG5VEwML2": { 124 | "cert_user_id": "19eXGqVBwGmKWSf@millchan", 125 | "date_added": 1550169460.500, 126 | "reason": "Spammer on millchan /jessicanigri/", 127 | "source": "1ADQAHsqsie5PBeQhQgjcKmUu3qdPFg6aA" 128 | }, 129 | "14JRUax64emMFVVxN2ikjz5J74CjqoJtFr": { 130 | "cert_user_id": "yeahyi@zeroid.bit", 131 | "date_added": 1550206131.422221, 132 | "reason": "Spammer", 133 | "source": "1iD5ZQJMNXu43w1qLB8sfdHVKppVMduGz" 134 | }, 135 | "14Y1Vbo7Mz2efjpMnc4t5iSEYixVQhqQpL": { 136 | "cert_user_id": "goody@zeroid.bit", 137 | "date_added": 1550717228.894357, 138 | "reason": "Spammed ZeroTalk threads", 139 | "source": "1iD5ZQJMNXu43w1qLB8sfdHVKppVMduGz" 140 | }, 141 | "13wJrWgzjwKU1zgXJMDCGhkSjsaUvYjZM2": { 142 | "cert_user_id": "duende@zeroid.bit", 143 | "date_added": 1555902803.067858, 144 | "reason": "Pedo who's encouraging me to suicide and spamming his bullshit.", 145 | "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH" 146 | }, 147 | "17AMQVbBa12XB3xFWKDnP2dCEx92TaiY7X": { 148 | "cert_user_id": "anonymouslogin@zeroid.bit", 149 | "date_added": 1564403461.560763, 150 | "reason": "Public cert, spamming kill yourself messages", 151 | "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH" 152 | }, 153 | "1A1JcKDgksT5pQJoSo7g1P1cC9kAKvG93m": { 154 | "cert_user_id": "publicid@zeroid.bit", 155 | "date_added": 1564403486.731043, 156 | "reason": "Public cert, spamming kill yourself messages", 157 | "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH" 158 | }, 159 | "18oN5jkSiB1SLb4Jywb4ZnKiwXqtQN5Fau": { 160 | "cert_user_id": "qqqqqqqqqqqqqqqq@zeroid.bit", 161 | "date_added": 1568807655.9091918, 162 | "reason": "spammer", 163 | "source": "1TaLkFrMwvbNsooF4ioKAY9EuxTBTjipT" 164 | }, 165 | "1JrUPjJmdTq5UsiKefuGTkNMd8MUNvP8Ss": { 166 | "cert_user_id": "tedreamraffle@zeroid.bit", 167 | "date_added": 1574046190.8304808, 168 | "reason": "Spam raffles/lotto", 169 | "source": "1TaLkFrMwvbNsooF4ioKAY9EuxTBTjipT" 170 | }, 171 | "12ShAsoQVkbEgqfjS2JmXt7cXBSbf8ifuS": { 172 | "cert_user_id": "caropc2@zeroid.bit", 173 | "date_added": 1574420510.623536, 174 | "reason": "Spamming kopykate clone", 175 | "source": "1TaLkFrMwvbNsooF4ioKAY9EuxTBTjipT" 176 | }, 177 | "1D5iCU5XE1D25ce2fV2XZqH95jGRtRaKZL": { 178 | "cert_user_id": "caropc10@zeroid.bit", 179 | "date_added": 1574420502.4061, 180 | "reason": "spamming kopykate clone", 181 | "source": "1TaLkFrMwvbNsooF4ioKAY9EuxTBTjipT" 182 | }, 183 | "13EafRdDw5sZF42dTn68uDdcssTWKbdauJ": { 184 | "cert_user_id": "deepnude@zeroid.bit", 185 | "date_added": 1583066012.629051, 186 | "reason": "harmful user", 187 | "source": "1TaLkFrMwvbNsooF4ioKAY9EuxTBTjipT" 188 | }, 189 | "1EZTWytasXcKdiUFnN4KHqAfvg1nwkTkKv": { 190 | "cert_user_id": "kai0@zeroid.bit", 191 | "date_added": 1530012685, 192 | "source": "ZeroTalk", 193 | "reason": "Spammer" 194 | }, 195 | "14ytAKDfNjArMTqGecTi7ginG3aZTsRAum": { 196 | "cert_user_id": "polar2@zeroid.bit", 197 | "date_added": 1530012685, 198 | "source": "ZeroTalk", 199 | "reason": "Spammer" 200 | }, 201 | "1JMXM9eSCpGAocrYxkfUmwiXeqcJw637vC": { 202 | "cert_user_id": "mrc@zeroid.bit", 203 | "date_added": 1530012685, 204 | "source": "ZeroTalk", 205 | "reason": "Spammer" 206 | } 207 | } 208 | } -------------------------------------------------------------------------------- /assets/icons/facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/assets/icons/facebook.png -------------------------------------------------------------------------------- /assets/icons/facebook_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/assets/icons/facebook_dark.png -------------------------------------------------------------------------------- /assets/icons/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/assets/icons/github.png -------------------------------------------------------------------------------- /assets/icons/github_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/assets/icons/github_dark.png -------------------------------------------------------------------------------- /assets/icons/twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/assets/icons/twitter.png -------------------------------------------------------------------------------- /assets/icons/twitter_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/assets/icons/twitter_dark.png -------------------------------------------------------------------------------- /assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/assets/logo.png -------------------------------------------------------------------------------- /buildapk.bat: -------------------------------------------------------------------------------- 1 | dart buildtools\utils.dart compile -------------------------------------------------------------------------------- /buildtools/compile.bat: -------------------------------------------------------------------------------- 1 | flutter build apk -------------------------------------------------------------------------------- /buildtools/utils.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'dart:io'; 3 | 4 | main(List args) { 5 | String arg = (args.isEmpty) ? '' : args[0]; 6 | switch (arg) { 7 | case 'modules': 8 | modules(); 9 | break; 10 | case 'nonpy': 11 | removeNonPy(); 12 | break; 13 | case 'compile': 14 | compile(); 15 | break; 16 | case 'update': 17 | updateZeroNetCode(); 18 | break; 19 | default: 20 | compile(); 21 | } 22 | } 23 | 24 | updateZeroNetCode() { 25 | var zeronetPath = Directory.current.path + '/build/ZeroNet-py3'; 26 | if (Directory(zeronetPath).existsSync()) { 27 | print('Deleting ZeroNet Git Repo'); 28 | Directory(zeronetPath).deleteSync(recursive: true); 29 | } 30 | var process = Process.runSync('git', [ 31 | 'clone', 32 | 'https://github.com/HelloZeroNet/ZeroNet.git', 33 | '--depth=1', 34 | zeronetPath, 35 | ]); 36 | if (process.exitCode == 0) { 37 | print('Successfully downloaded Zeronet Repo'); 38 | 39 | print('Deleting git history'); 40 | Directory(zeronetPath + '/.git').deleteSync(recursive: true); 41 | 42 | Process.runSync('cd', ['build']); 43 | Process.runSync('7z', ['a', '-tzip', 'zeronet_py3.zip', 'ZeroNet']); 44 | } 45 | } 46 | 47 | compile() { 48 | String versionProp = ''; 49 | var content = File('android/version.properties').readAsStringSync(); 50 | versionProp = 51 | content.split('\n')[0].replaceAll('flutter.versionName=', '').trim(); 52 | var result = Process.runSync('git', [ 53 | 'log', 54 | '-1', 55 | '--pretty=%B', 56 | ]); 57 | var ver = (result.stdout as String).split('\n')[0].trim(); 58 | if (ver.contains(versionProp)) { 59 | print('Repo is Clear to Compile APK For Release...'); 60 | print('Compiling APK For Release...'); 61 | Process.start('buildtools\\compile.bat', []).then((Process result) { 62 | result.stdout.listen((onData) { 63 | // print('Output : '); 64 | print(utf8.decode(onData)); 65 | }); 66 | result.stderr.listen((onData) { 67 | // print('Error : '); 68 | print(utf8.decode(onData)); 69 | }); 70 | }); 71 | } else 72 | throw "Update version.properties"; 73 | } 74 | 75 | var totalFilesList = []; 76 | var nonPyFiles = []; 77 | var pyFiles = []; 78 | var pyLibDir = '\\lib\\python3.8'; 79 | removeNonPy() { 80 | Directory dir = Directory.current; 81 | //Here 82 | recursiveHelper(Directory(dir.path + pyLibDir)); 83 | String nonPy = ''; 84 | nonPyFiles.forEach((f) => nonPy = nonPy + f + '\n'); 85 | 86 | File f = File('files-nonpy'); 87 | if (f.existsSync()) f.deleteSync(); 88 | f.createSync(); 89 | f.writeAsStringSync(nonPy); 90 | 91 | print(totalFilesList.length); 92 | print(pyFiles.length); 93 | print(nonPyFiles.length); 94 | } 95 | 96 | List ls = [ 97 | 'config-3.8', 98 | 'test', 99 | 'tests', 100 | 'ensurepip', 101 | 'idle_test', 102 | ]; 103 | 104 | recursiveHelper(Directory dir) { 105 | for (var file in dir.listSync()) { 106 | if (file is File) { 107 | var filePath = file.path.replaceAll(dir.path + '\\', ''); 108 | totalFilesList.add(filePath); 109 | if (filePath.endsWith('.py') || filePath.endsWith('.so')) { 110 | print('Python file $filePath'); 111 | pyFiles.add(filePath); 112 | } else { 113 | print('Non Python file $filePath'); 114 | if (filePath.endsWith('.exe') || 115 | filePath.endsWith('.bat') || 116 | filePath.endsWith('.ps1')) { 117 | print("Deleting File at:" + filePath); 118 | nonPyFiles.add(filePath); 119 | file.deleteSync(recursive: true); 120 | } else { 121 | print("Orphan File at " + filePath); 122 | } 123 | } 124 | } else { 125 | for (var item in ls) { 126 | if (file.path.endsWith('\\$item')) { 127 | file.deleteSync(recursive: true); 128 | } else { 129 | recursiveHelper(file as Directory); 130 | } 131 | } 132 | } 133 | } 134 | } 135 | 136 | modules() { 137 | Directory dir = Directory.current; 138 | File module = File('modules'); 139 | String modules = module.readAsStringSync(); 140 | List validModules = []; 141 | modules.split('\n').forEach((f) { 142 | if (f.contains('usr/')) { 143 | var i = f.indexOf('usr/'); 144 | validModules.add(f.substring(i + 4).replaceAll('/', '\\')); 145 | } 146 | }); 147 | var totalFilesList = []; 148 | var deletedFilesList = []; 149 | var pyLibDir = '\\lib\\python3.8'; 150 | for (var file in Directory(dir.path + pyLibDir).listSync(recursive: true)) { 151 | if (file is File) { 152 | var filePath = file.path.replaceAll(dir.path + '\\', ''); 153 | totalFilesList.add(filePath); 154 | if (validModules.indexOf(filePath) == -1) { 155 | print('deleting ${file.path}'); 156 | deletedFilesList.add(filePath); 157 | file.deleteSync(recursive: false); 158 | } 159 | } 160 | } 161 | String deleted = ''; 162 | deletedFilesList.forEach((f) => deleted = deleted + f + '\n'); 163 | 164 | File f = File('modules-deleted'); 165 | if (f.existsSync()) f.deleteSync(); 166 | f.createSync(); 167 | f.writeAsStringSync(deleted); 168 | 169 | deleteEmptyDirs(dir, pyLibDir); 170 | deleteEmptyDirs(dir, pyLibDir); 171 | print(totalFilesList.length); 172 | // print(totalFilesList[0]); 173 | print(validModules.length); 174 | // print(validModules[0]); 175 | print(deletedFilesList.length); 176 | // print(deletedFilesList[0]); 177 | } 178 | 179 | deleteEmptyDirs(Directory dir, String pyLibDir) { 180 | print('Deleting Empty Dirs'); 181 | for (var file in Directory(dir.path + pyLibDir).listSync(recursive: true)) { 182 | if (file is Directory) { 183 | if (file.listSync(recursive: true).length == 0) { 184 | file.deleteSync(recursive: true); 185 | } 186 | } 187 | } 188 | } 189 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/changelogs/70.txt: -------------------------------------------------------------------------------- 1 | v 0.7.0 2 | 3 | - Major UI Changes with Modern UI 😍😍. 4 | - Faster Startup of ZeroNet 😁😁. 5 | - Individual Site Details for Popular Sites with Stats and useful functions 😘😘. 6 | - Update Minimum Android Support Version to API 21 (Android 5.0 Lollipop). 7 | - Add Site Shortcut to HomeScreen. 8 | - Added In-App Review so that you can give your feedback quickly. 9 | - Several Bug Fixes and Improvements. -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/full_description.txt: -------------------------------------------------------------------------------- 1 | ZeroNet - Open, free and uncensorable websites, using Bitcoin cryptography and BitTorrent network. 2 | 3 | TLDR(Short and Simple) Version 4 | Slides : http://bit.ly/howzeronetworks 5 | 6 | PEER-TO-PEER 7 | - Your content distributed directly to other visitors without any central server. 8 | 9 | Unstopable 10 | - It's nowhere because it's everywhere! 11 | - No hosting costs 12 | - Sites are served by visitors. 13 | - Always accessible 14 | - No single point of failure. 15 | 16 | SIMPLE 17 | - No configuration needed: 18 | - Download, unpack and start using it. 19 | 20 | .BIT DOMAINS 21 | - Decentralized domains using Namecoin cryptocurrency. 22 | 23 | NO PASSWORDS 24 | - Your account is protected by the same cryptography as your Bitcoin wallet. 25 | 26 | FAST 27 | - Page response time is not limited by your connection speed. 28 | 29 | DYNAMIC CONTENT 30 | - Real-time updated, multi-user websites. 31 | 32 | WORKS EVERYWHERE 33 | - Supports any modern browser on 34 | - Windows, Linux or Mac and Android platforms. 35 | 36 | ANONYMITY 37 | - You can easily hide your IP address using the Tor network. 38 | 39 | OFFLINE 40 | - Browse the sites you're seeding even if your internet connection is down. 41 | 42 | OPEN SOURCE 43 | - Developed by the community for the community. 44 | 45 | We believe in 46 | open, free, and uncensored 47 | network and communication. 48 | 49 | About Mobile Client 50 | ZeroNet Mobile is an Android Client for ZeroNet, Project uses flutter framework for runner and is Open Sourced at https://github.com/canewsin/zeronet_mobile, you can contribute to the app by forking the project. 51 | 52 | Contribute 53 | If you want to support project's further development, you can contribute your time or money, If you want to contribute money you can send bitcoin or other supported crypto currencies to above addresses or buy in-app purchases, if want to contribute translations or code, visit official GitHub repo. 54 | 55 | Links : 56 | Facebook https://www.facebook.com/HelloZeroNet 57 | Twitter https://twitter.com/HelloZeroNet 58 | Reddit https://www.reddit.com/r/zeronet/ 59 | Github https://github.com/HelloZeroNet/ZeroNet -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/images/featureGraphic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/fastlane/metadata/android/en-US/images/featureGraphic.png -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/fastlane/metadata/android/en-US/images/icon.png -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/images/phoneScreenshots/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/images/phoneScreenshots/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/images/phoneScreenshots/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/images/phoneScreenshots/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/fastlane/metadata/android/en-US/images/phoneScreenshots/4.png -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/images/phoneScreenshots/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/fastlane/metadata/android/en-US/images/phoneScreenshots/5.png -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/images/phoneScreenshots/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/fastlane/metadata/android/en-US/images/phoneScreenshots/6.png -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/short_description.txt: -------------------------------------------------------------------------------- 1 | ZeroNet - Open, Free Speech, Uncensored platform for modern & decentralized web. -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/title.txt: -------------------------------------------------------------------------------- 1 | ZeroNet Mobile - Open, Free and Uncensorable Sites -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/video.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/fastlane/metadata/android/en-US/video.txt -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | zeronet 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" -------------------------------------------------------------------------------- /lib/controllers/strings.dart: -------------------------------------------------------------------------------- 1 | import '../imports.dart'; 2 | 3 | final strController = Get.put(StringController()); 4 | 5 | class StringController extends GetxController { 6 | final statusNotRunningStr = 'Not Running'.obs; 7 | final statusInitializingStr = 'Initializing..'.obs; 8 | final statusStartingStr = 'Starting'.obs; 9 | final statusRunningStr = 'Running'.obs; 10 | final statusRunningWithTorStr = 'Running with Tor'.obs; 11 | final statusErrorStr = 'Error'.obs; 12 | final loadingPageWarningStr = """ 13 | Please Wait! This may take a while, happens 14 | only first time, Don't Press Back button. 15 | If You Accidentally Pressed Back, 16 | Clean App Storage in Settings or 17 | Uninstall and Reinstall The App. 18 | """ 19 | .obs; 20 | final startStr = 'Start'.obs; 21 | final pleaseWaitStr = 'Please Wait..!'.obs; 22 | final loadingStr = 'Loading'.obs; 23 | final stopStr = 'Stop'.obs; 24 | final viewLogStr = 'View Log'.obs; 25 | final updateStr = 'Update'.obs; 26 | final downloadingStr = 'Downloading'.obs; 27 | final downloadedStr = 'Downloaded'.obs; 28 | final installingStr = 'Installing'.obs; 29 | final installationCompletedStr = 'Installation Completed'.obs; 30 | final notAvaliableStr = 'Not Available'.obs; 31 | 32 | void updateloadingPageWarningStr(String str) => 33 | loadingPageWarningStr.value = str; 34 | void updatestatusNotRunningStr(String str) => statusNotRunningStr.value = str; 35 | void updatestatusInitializingStr(String str) => 36 | statusInitializingStr.value = str; 37 | void updatestatusStartingStr(String str) => statusStartingStr.value = str; 38 | void updatestatusRunningStr(String str) => statusRunningStr.value = str; 39 | void updatestatusRunningWithTorStr(String str) => 40 | statusRunningStr.value = str; 41 | void updatestatusErrorStr(String str) => statusErrorStr.value = str; 42 | void updatestartStr(String str) => startStr.value = str; 43 | void updatepleaseWaitStr(String str) => pleaseWaitStr.value = str; 44 | void updatestopStr(String str) => stopStr.value = str; 45 | void updateviewLogStr(String str) => viewLogStr.value = str; 46 | void updateupdateStr(String str) => updateStr.value = str; 47 | void updatedownloadingStr(String str) => downloadingStr.value = str; 48 | void updatedownloadedStr(String str) => downloadedStr.value = str; 49 | void updateinstallingStr(String str) => installingStr.value = str; 50 | void updateinstallationCompletedStr(String str) => 51 | installationCompletedStr.value = str; 52 | void updatenotAvaliableStr(String str) => notAvaliableStr.value = str; 53 | 54 | void loadTranslationsFromFile(String path) { 55 | File translationsFile = File(path); 56 | String readAsStringSync = ''; 57 | try { 58 | readAsStringSync = translationsFile.readAsStringSync(); 59 | } catch (e) { 60 | if (e is FileSystemException) return; 61 | } 62 | Map map = json.decode(readAsStringSync); 63 | updateloadingPageWarningStr(map['loadingPageWarningStr']); 64 | updatestatusNotRunningStr(map['statusNotRunningStr']); 65 | updatestartStr(map['startStr']); 66 | updatestatusInitializingStr(map['statusInitializingStr']); 67 | updatestatusStartingStr(map['statusStartingStr']); 68 | updatestatusRunningStr(map['statusRunningStr']); 69 | updatestatusRunningWithTorStr(map['statusRunningWithTorStr']); 70 | updatestatusErrorStr(map['statusErrorStr']); 71 | updatepleaseWaitStr(map['pleaseWaitStr']); 72 | updatestopStr(map['stopStr']); 73 | updateviewLogStr(map['viewLogStr']); 74 | updateupdateStr(map['updateStr']); 75 | updatedownloadingStr(map['downloadingStr']); 76 | updatedownloadedStr(map['downloadedStr']); 77 | updateinstallingStr(map['installingStr']); 78 | updateinstallationCompletedStr(map['installationCompletedStr']); 79 | updatenotAvaliableStr(map['notAvaliableStr']); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /lib/controllers/uicontroller.dart: -------------------------------------------------------------------------------- 1 | import '../imports.dart'; 2 | 3 | final uiStore = Get.put(UiController()); 4 | 5 | class UiController extends GetxController { 6 | late PersistentBottomSheetController currentBottomSheetController; 7 | final isWindowVisible = false.obs; 8 | 9 | Rx appUpdate = AppUpdate.NOT_AVAILABLE.obs; 10 | 11 | void updateInAppUpdateAvailable(AppUpdate available) => 12 | appUpdate.value = available; 13 | 14 | var showSnackReply = false.obs; 15 | 16 | void updateShowSnackReply(bool show) { 17 | showSnackReply.value = show; 18 | } 19 | 20 | var reload = 0.obs; 21 | 22 | void updateReload(int i) { 23 | reload.value = i; 24 | } 25 | 26 | Rx zeroNetStatus = ZeroNetStatus.NOT_RUNNING.obs; 27 | 28 | void setZeroNetStatus(ZeroNetStatus status) { 29 | zeroNetStatus.value = status; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/controllers/varcontroller.dart: -------------------------------------------------------------------------------- 1 | import '../imports.dart'; 2 | 3 | final varStore = Get.put(VarController()); 4 | 5 | class VarController extends GetxController { 6 | var zeroNetWrapperKey = ''; 7 | Rx event = ObservableEvent.none.obs; 8 | var zeroNetLog = 'ZeroNetX'.obs; 9 | RxString zeroNetStatus = strController.statusNotRunningStr; 10 | var zeroNetInstalled = false.obs; 11 | var zeroNetDownloaded = false.obs; 12 | RxString loadingStatus = strController.loadingStr; 13 | var loadingPercent = 0.obs; 14 | 15 | void setObservableEvent(ObservableEvent eve) { 16 | event.value = eve; 17 | } 18 | 19 | void setZeroNetLog(String status) { 20 | zeroNetLog.value = status; 21 | } 22 | 23 | void setZeroNetStatus(String status) { 24 | zeroNetStatus.value = status; 25 | } 26 | 27 | void isZeroNetInstalled(bool installed) { 28 | zeroNetInstalled.value = installed; 29 | } 30 | 31 | void isZeroNetDownloaded(bool downloaded) { 32 | zeroNetDownloaded.value = downloaded; 33 | } 34 | 35 | void setLoadingStatus(String status) { 36 | loadingStatus.value = status; 37 | } 38 | 39 | void setLoadingPercent(int percent) { 40 | loadingPercent.value = percent; 41 | } 42 | } 43 | 44 | enum ObservableEvent { 45 | none, 46 | downloding, 47 | downloaded, 48 | installing, 49 | installed, 50 | } 51 | -------------------------------------------------------------------------------- /lib/imports.dart: -------------------------------------------------------------------------------- 1 | export 'dart:async'; 2 | export 'dart:convert'; 3 | export 'dart:io'; 4 | export 'dart:isolate'; 5 | export 'dart:typed_data'; 6 | 7 | export 'package:flutter/foundation.dart'; 8 | export 'package:flutter/material.dart'; 9 | export 'package:flutter/services.dart'; 10 | 11 | export 'package:bitsdojo_window/bitsdojo_window.dart'; 12 | export 'package:crypto/crypto.dart'; 13 | export 'package:device_info_plus/device_info_plus.dart'; 14 | export 'package:diff_match_patch/diff_match_patch.dart'; 15 | export 'package:equatable/equatable.dart'; 16 | export 'package:file_picker/file_picker.dart'; 17 | // export 'package:flutter_absolute_path/flutter_absolute_path.dart'; 18 | export 'package:flutter_background_service/flutter_background_service.dart'; 19 | export 'package:flutter_downloader/flutter_downloader.dart'; 20 | export 'package:get/get.dart' hide HeaderValue, MultipartFile, Response; 21 | export 'package:http/http.dart'; 22 | export 'package:in_app_update/in_app_update.dart'; 23 | export 'package:internet_file/internet_file.dart'; 24 | export 'package:internet_file/storage_io.dart'; 25 | export 'package:package_info_plus/package_info_plus.dart'; 26 | export 'package:path_provider/path_provider.dart'; 27 | export 'package:random_string/random_string.dart'; 28 | export 'package:system_tray/system_tray.dart'; 29 | export 'package:zeronet_ws/zeronet_ws.dart'; 30 | 31 | export 'controllers/varcontroller.dart'; 32 | export 'controllers/uicontroller.dart'; 33 | export 'controllers/strings.dart'; 34 | export 'models/enums.dart'; 35 | export 'models/models.dart'; 36 | export 'others/common.dart'; 37 | export 'others/constants.dart'; 38 | export 'others/extensions.dart'; 39 | export 'others/native.dart'; 40 | export 'others/utils.dart'; 41 | export 'others/zeronet_utils.dart'; 42 | export 'others/zeronet_service.dart'; 43 | export 'others/zeronet_isolate.dart'; 44 | export 'widgets/loading_page.dart'; 45 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:zeronet/dashboard/app.dart'; 2 | import 'dashboard/imports.dart'; 3 | 4 | import 'others/common.dart' as common; 5 | 6 | import 'imports.dart' hide init; 7 | import 'others/common.dart'; 8 | 9 | //TODO:Remainder: Removed Half baked x86 bins, add them when we support x86 platform 10 | Future main() async { 11 | WidgetsFlutterBinding.ensureInitialized(); 12 | await common.init(); 13 | runApp(MyApp()); 14 | if (PlatformExt.isDesktop) { 15 | doWhenWindowReady(() { 16 | final win = appWindow; 17 | // const initialSize = Size(600, 450); 18 | // win.minSize = initialSize; 19 | // win.size = initialSize; 20 | // win.position = const Offset(250, 250); 21 | win.title = "ZeroNetX"; 22 | win.show(); 23 | }); 24 | } 25 | } 26 | 27 | class MyApp extends StatelessWidget { 28 | @override 29 | Widget build(BuildContext context) { 30 | if (PlatformExt.isDesktop) initSystemTray(); 31 | return GetMaterialApp( 32 | title: 'ZeroNet Mobile', 33 | theme: ThemeData( 34 | primarySwatch: Colors.indigo, 35 | visualDensity: VisualDensity.adaptivePlatformDensity, 36 | ), 37 | debugShowCheckedModeBanner: false, 38 | home: Scaffold( 39 | body: Obx( 40 | () { 41 | var child = (PlatformExt.isDesktop) 42 | ? Obx( 43 | () => Column( 44 | children: [ 45 | WindowTitleBarBox( 46 | child: Container( 47 | color: siteUiController 48 | .currentTheme.value.titleBarColor, 49 | child: Row( 50 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 51 | children: [ 52 | Expanded( 53 | child: MoveWindow( 54 | child: Container( 55 | color: siteUiController 56 | .currentTheme.value.primaryColor, 57 | ), 58 | ), 59 | ), 60 | Row( 61 | children: [ 62 | MinimizeWindowButton( 63 | onPressed: () { 64 | appWindow.minimize(); 65 | uiStore.isWindowVisible.value = false; 66 | }, 67 | colors: WindowButtonColors( 68 | normal: siteUiController 69 | .currentTheme.value.cardBgColor, 70 | mouseOver: Colors.blueAccent, 71 | mouseDown: Colors.blue, 72 | ), 73 | ), 74 | MaximizeWindowButton( 75 | onPressed: () { 76 | appWindow.maximize(); 77 | uiStore.isWindowVisible.value = true; 78 | }, 79 | colors: WindowButtonColors( 80 | normal: siteUiController 81 | .currentTheme.value.cardBgColor, 82 | mouseOver: Colors.greenAccent, 83 | mouseDown: Colors.green, 84 | ), 85 | ), 86 | CloseWindowButton( 87 | onPressed: () { 88 | appWindow.hide(); 89 | uiStore.isWindowVisible.value = false; 90 | }, 91 | colors: WindowButtonColors( 92 | normal: siteUiController 93 | .currentTheme.value.cardBgColor, 94 | mouseOver: Colors.redAccent, 95 | mouseDown: Color(0xFFF44336), 96 | ), 97 | ), 98 | ], 99 | ) 100 | ], 101 | ), 102 | ), 103 | ), 104 | Expanded(child: appContent()), 105 | ], 106 | ), 107 | ) 108 | : appContent(); 109 | if (siteUiController.currentTheme.value == AppTheme.Light) { 110 | return Theme( 111 | data: ThemeData.light(useMaterial3: false), 112 | child: child, 113 | ); 114 | } else { 115 | return Theme( 116 | data: ThemeData.dark(useMaterial3: false), 117 | child: child, 118 | ); 119 | } 120 | }, 121 | ), 122 | ), 123 | ); 124 | } 125 | 126 | Obx appContent() { 127 | return Obx( 128 | () { 129 | setSystemUiTheme(); 130 | if (varStore.zeroNetInstalled.value) { 131 | init(); 132 | return DashboardApp(); 133 | } else 134 | return Loading(); 135 | }, 136 | ); 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /lib/models/enums.dart: -------------------------------------------------------------------------------- 1 | import '../imports.dart'; 2 | 3 | enum ZeroNetStatus { 4 | NOT_RUNNING, 5 | INITIALISING, 6 | RUNNING, 7 | RUNNING_WITH_TOR, 8 | ERROR, 9 | } 10 | 11 | enum AppUpdate { 12 | NOT_AVAILABLE, 13 | AVAILABLE, 14 | DOWNLOADING, 15 | DOWNLOADED, 16 | INSTALLING, 17 | } 18 | 19 | extension AppUpdateExt on AppUpdate { 20 | get text { 21 | switch (uiStore.appUpdate.value) { 22 | case AppUpdate.AVAILABLE: 23 | return strController.updateStr.value; 24 | case AppUpdate.DOWNLOADING: 25 | return strController.downloadingStr.value; 26 | case AppUpdate.DOWNLOADED: 27 | return strController.downloadedStr.value; 28 | case AppUpdate.INSTALLING: 29 | return strController.installingStr.value; 30 | default: 31 | return strController.notAvaliableStr.value; 32 | } 33 | } 34 | 35 | void action() { 36 | switch (uiStore.appUpdate.value) { 37 | case AppUpdate.AVAILABLE: 38 | { 39 | // InAppUpdate.performImmediateUpdate().then((value) => 40 | // uiStore.updateInAppUpdateAvailable(AppUpdate.NOT_AVAILABLE)); 41 | InAppUpdate.startFlexibleUpdate().then((value) => 42 | uiStore.updateInAppUpdateAvailable(AppUpdate.DOWNLOADED)); 43 | uiStore.updateInAppUpdateAvailable(AppUpdate.DOWNLOADING); 44 | } 45 | break; 46 | case AppUpdate.DOWNLOADED: 47 | { 48 | InAppUpdate.completeFlexibleUpdate().then((value) => 49 | uiStore.updateInAppUpdateAvailable(AppUpdate.NOT_AVAILABLE)); 50 | uiStore.updateInAppUpdateAvailable(AppUpdate.INSTALLING); 51 | } 52 | break; 53 | default: 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /lib/models/models.dart: -------------------------------------------------------------------------------- 1 | import '../imports.dart'; 2 | 3 | class UnzipParams { 4 | String item; 5 | Uint8List bytes; 6 | String dest; 7 | UnzipParams( 8 | this.item, 9 | this.bytes, { 10 | this.dest = '', 11 | }); 12 | } 13 | 14 | enum ZNBinaryState { 15 | NOT_DOWNLOADED, 16 | DOWNLOADING, 17 | NOT_INSTALLED, 18 | INSTALLING, 19 | MAKING_AS_EXEC, 20 | READY, 21 | RUNNING, 22 | NONE, 23 | } 24 | -------------------------------------------------------------------------------- /lib/others/constants.dart: -------------------------------------------------------------------------------- 1 | import '../imports.dart'; 2 | 3 | // export 'constants/platform_constants.dart'; 4 | 5 | /// [Platform] specific implementation of PathSeparator. 6 | final sep = Platform.pathSeparator; 7 | final exeDir = Directory(Platform.resolvedExecutable).parent.path; 8 | final String pkgName = Directory( 9 | Platform.isAndroid 10 | ? 'in.canews.zeronetmobile${kDebugMode ? '.debug' : ''}' 11 | : exeDir + sep + 'data' + sep + 'app', 12 | ).path; 13 | final String dataDir = Directory( 14 | Platform.isAndroid 15 | ? "${sep}data${sep}data${sep}$pkgName${sep}files" 16 | : pkgName, 17 | ).path; 18 | final String zeroNetDir = 19 | dataDir + sep + (Platform.isWindows ? 'ZeroNet-win' : 'ZeroNet-py3'); 20 | final String bin = '$dataDir${sep}usr${sep}bin'; 21 | final String python = '$bin${sep}python'; 22 | final String libDir = '$dataDir${sep}usr${sep}lib'; 23 | final String libDir64 = '$dataDir${sep}usr${sep}lib64'; 24 | final String zeronetDir = zeroNetDir; 25 | final String zeronet = '$zeronetDir${sep}zeronet.py'; 26 | const String defZeroNetUrl = 'http://127.0.0.1:43110/'; 27 | const String downloading = 'Downloading Files'; 28 | const String installing = 'Installing ZeroNet Files'; 29 | const String facebookLink = 'https://facebook.com'; 30 | const String twitterLink = 'https://twitter.com'; 31 | const String githubLink = 'https://github.com'; 32 | const String rawGithubLink = 'https://raw.githubusercontent.com'; 33 | const String canewsInRepo = '/canewsin/ZeroNet'; 34 | const String zeromobileRepo = '/canewsin/zeronet_mobile'; 35 | const String releases = '$githubLink$canewsInRepo/releases/download/'; 36 | const String md5hashLink = '$rawGithubLink$canewsInRepo/py3-patches/md5.hashes'; 37 | const String zpatches = '$githubLink$zeromobileRepo/releases/download/patches'; 38 | const String zeroNetNotiId = 'zeroNetNetiId'; 39 | const String zeroNetChannelName = 'ZeroNet Mobile'; 40 | const String zeroNetChannelDes = 41 | 'Shows ZeroNet Notification to Persist from closing.'; 42 | const String notificationCategory = 'ZERONET_RUNNING'; 43 | const String isolateUnZipPort = 'unzip_send_port'; 44 | const String isolateDownloadPort = 'downloader_send_port'; 45 | const String zeronetStartUpError = 'Startup error: '; 46 | const String zeronetAlreadyRunningError = 47 | zeronetStartUpError + 'Can\'t open lock file'; 48 | const bool kEnableDynamicModules = !kDebugMode; 49 | 50 | const List binDirs = [ 51 | 'usr', 52 | 'site-packages', 53 | 'ZeroNet-py3', 54 | ]; 55 | const List soDirs = [ 56 | 'usr/bin', 57 | 'usr/lib', 58 | 'usr/lib/python3.8/lib-dynload', 59 | 'usr/lib/python3.8/site-packages', 60 | ]; 61 | 62 | const List filterFileNames = [ 63 | 'sites-miners.json', 64 | 'sites-porn.json', 65 | 'users-porn.json', 66 | 'users-spamlist.json', 67 | ]; 68 | -------------------------------------------------------------------------------- /lib/others/extensions.dart: -------------------------------------------------------------------------------- 1 | import 'package:zeronet/imports.dart'; 2 | 3 | extension FileSystemExtension on FileSystemEntity { 4 | String get name => this.path.replaceFirst(this.parent.path + '/', ''); 5 | } 6 | 7 | extension CapExtension on String { 8 | String get inCaps => '${this[0].toUpperCase()}${this.substring(1)}'; 9 | String get allInCaps => this.toUpperCase(); 10 | String get capitalizeFirstofEach => 11 | this.split(" ").map((str) => str.inCaps).join(" "); 12 | String get zeroNetDataPath => getZeroNetDataDir().path + '/' + this + '/'; 13 | } 14 | 15 | extension DynamicExt on dynamic { 16 | int? toInt() { 17 | if (this is num) { 18 | if (this is double) return this.toInt(); 19 | if (this is int) return this; 20 | } 21 | return -1; 22 | } 23 | } 24 | 25 | extension PlatformExt on Platform { 26 | static get isDesktop => 27 | (Platform.isWindows || Platform.isLinux || Platform.isMacOS); 28 | static get isMobile => (Platform.isAndroid || Platform.isIOS); 29 | 30 | static get isSupportedDesktop => (Platform.isWindows); 31 | static get isSupportedMobile => (Platform.isAndroid); 32 | 33 | static get isSupported => (isSupportedDesktop || isSupportedMobile); 34 | } 35 | 36 | extension DownloadTaskkExt on int { 37 | /// Creates a new [DownloadTaskStatus] from an [int]. 38 | DownloadTaskStatus get intoDownloadTaskStatus { 39 | switch (this) { 40 | case 0: 41 | return DownloadTaskStatus.undefined; 42 | case 1: 43 | return DownloadTaskStatus.enqueued; 44 | case 2: 45 | return DownloadTaskStatus.running; 46 | case 3: 47 | return DownloadTaskStatus.complete; 48 | case 4: 49 | return DownloadTaskStatus.failed; 50 | case 5: 51 | return DownloadTaskStatus.canceled; 52 | case 6: 53 | return DownloadTaskStatus.paused; 54 | default: 55 | throw ArgumentError('Invalid value: $this'); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /lib/others/native.dart: -------------------------------------------------------------------------------- 1 | import '../imports.dart'; 2 | 3 | const MethodChannel _channel = const MethodChannel('in.canews.zeronetmobile'); 4 | const EventChannel _events_channel = 5 | const EventChannel('in.canews.zeronetmobile/installModules'); 6 | 7 | Future addToHomeScreen( 8 | String title, 9 | String? url, 10 | String logoPath, 11 | ) async => 12 | await _channel.invokeMethod('addToHomeScreen', { 13 | 'title': title, 14 | 'url': url, 15 | 'logoPath': logoPath, 16 | }); 17 | 18 | Future launchZiteUrl() async => 19 | await _channel.invokeMethod('launchZiteUrl'); 20 | 21 | Future askBatteryOptimisation() async => 22 | await _channel.invokeMethod('batteryOptimisations'); 23 | 24 | Future isPlayStoreInstall() async => 25 | await _channel.invokeMethod('isPlayStoreInstall'); 26 | 27 | Future isBatteryOptimised() async => 28 | await _channel.invokeMethod('isBatteryOptimized'); 29 | 30 | Future saveUserJsonFile(String path) async => 31 | await _channel.invokeMethod('saveUserJsonFile', path); 32 | 33 | Future moveTaskToBack() async => 34 | await _channel.invokeMethod('moveTaskToBack'); 35 | 36 | Future isModuleInstallSupported() async => 37 | await _channel.invokeMethod('isModuleInstallSupported'); 38 | 39 | Future isRequiredModulesInstalled() async => 40 | await _channel.invokeMethod('isRequiredModulesInstalled'); 41 | 42 | Future copyAssetsToCache() async => 43 | await _channel.invokeMethod('copyAssetsToCache'); 44 | 45 | Future getAppInstallTime() async => 46 | await _channel.invokeMethod('getAppInstallTime'); 47 | 48 | Future getAppLastUpdateTime() async => 49 | await _channel.invokeMethod('getAppLastUpdateTime'); 50 | 51 | Future initSplitInstall() async => 52 | await _channel.invokeMethod('initSplitInstall'); 53 | 54 | void uninstallModules() async => 55 | await _channel.invokeMethod('uninstallModules'); 56 | 57 | void nativePrint(String log) => _channel.invokeMethod('nativePrint', log); 58 | 59 | getNativeDir() async => await _channel.invokeMethod('nativeDir'); 60 | 61 | void handleModuleDownloadStatus() { 62 | _events_channel.receiveBroadcastStream().listen((onData) { 63 | Map data = json.decode(onData); 64 | final status = data['status']; 65 | if (status == 2) { 66 | final downloaded = data['downloaded']; 67 | final total = data['total']; 68 | double percentage = downloaded / total; 69 | varStore.setLoadingPercent(percentage.toInt()); 70 | } 71 | printOut(onData, lineBreaks: 2, isNative: true); 72 | if (status == 5) check(); 73 | }); 74 | } 75 | 76 | String? filePath = ''; 77 | Future getUserJsonFile() async { 78 | String? uri; 79 | try { 80 | if (deviceInfo!.version.sdkInt > 28) { 81 | uri = await _channel.invokeMethod('openJsonFile'); 82 | //!TODO Fix This await FlutterAbsolutePath.getAbsolutePath(uri!); 83 | filePath = uri; 84 | } else { 85 | uri = (await pickUserJsonFile())!.path; 86 | filePath = uri; 87 | } 88 | String path = await (_channel.invokeMethod( 89 | 'readJsonFromUri', 90 | uri, 91 | )); 92 | return File(path); 93 | } catch (e) { 94 | if (e is PlatformException && e.code == '526') { 95 | return null; 96 | } 97 | return null; 98 | } 99 | } 100 | 101 | Future getPluginZipFile() async { 102 | String? uri; 103 | if (deviceInfo!.version.sdkInt > 28) { 104 | try { 105 | uri = await _channel.invokeMethod('openZipFile'); 106 | //TODO! Fix this filePath = await FlutterAbsolutePath.getAbsolutePath(uri!); 107 | filePath = uri; 108 | } catch (e) { 109 | if (e is PlatformException) { 110 | if (e.code == '527') { 111 | return null; 112 | } 113 | } 114 | } 115 | } else { 116 | uri = (await pickPluginZipFile())!.path; 117 | filePath = uri; 118 | } 119 | String path = await (_channel.invokeMethod( 120 | 'readZipFromUri', 121 | uri, 122 | ) as FutureOr); 123 | return File(path); 124 | } 125 | 126 | getArch() async { 127 | if (!PlatformExt.isMobile) { 128 | return 'x86_64'; 129 | } 130 | if (deviceInfo == null) deviceInfo = await DeviceInfoPlugin().androidInfo; 131 | String archL = deviceInfo!.supportedAbis[0]; 132 | if (archL.contains('arm64')) 133 | arch = 'arm64'; 134 | else if (archL.contains('armeabi')) 135 | arch = 'arm'; 136 | else if (archL.contains('x86_64')) 137 | arch = 'x86_64'; 138 | else if (archL.contains('x86')) arch = 'x86'; 139 | } 140 | -------------------------------------------------------------------------------- /lib/others/zeronet_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_background_service_android/flutter_background_service_android.dart'; 2 | import 'package:zeronet/imports.dart'; 3 | 4 | class ZeroNetService { 5 | late FlutterBackgroundService _service; 6 | late StreamController> _streamController; 7 | ServiceInstance? _serviceInstance; 8 | final bool isInIsolate; 9 | ZeroNetService(this.isInIsolate, {ServiceInstance? serviceInstance}) { 10 | if (Platform.isAndroid) { 11 | _service = FlutterBackgroundService(); 12 | if (isInIsolate) _serviceInstance = serviceInstance; 13 | } else { 14 | _streamController = StreamController>(); 15 | } 16 | } 17 | 18 | Future get isServiceRunning async => 19 | Platform.isAndroid ? await _service.isRunning() : true; 20 | 21 | void sendData(Map data) { 22 | if (Platform.isAndroid) { 23 | (isInIsolate ? _serviceInstance! : _service).invoke('data', data); 24 | } else { 25 | _streamController.add(data); 26 | } 27 | } 28 | 29 | Future configure( 30 | Function(ServiceInstance) isolate, { 31 | bool? autoStart = true, 32 | }) { 33 | if (Platform.isAndroid) { 34 | return _service.configure( 35 | androidConfiguration: AndroidConfiguration( 36 | onStart: isolate, 37 | autoStart: autoStart!, 38 | isForegroundMode: true, 39 | ), 40 | iosConfiguration: IosConfiguration(), 41 | //TODO! Enable this when ios is supported 42 | // onForeground: isolate, 43 | // onBackground: isolate, 44 | ); 45 | } else { 46 | return Future.value(true); 47 | } 48 | } 49 | 50 | Stream?> get onDataReceived => Platform.isAndroid 51 | ? (isInIsolate ? _serviceInstance! : _service).on('data') 52 | : _streamController.stream; 53 | 54 | void start() { 55 | if (Platform.isAndroid && !isInIsolate) { 56 | _service.startService(); 57 | } 58 | } 59 | 60 | void stop() { 61 | if (Platform.isAndroid && isInIsolate) { 62 | _serviceInstance!.stopSelf(); 63 | } 64 | } 65 | 66 | setNotificationInfo({required String title, required String content}) { 67 | if (Platform.isAndroid && isInIsolate) { 68 | (_serviceInstance as AndroidServiceInstance) 69 | .setForegroundNotificationInfo(title: title, content: content); 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /lib/others/zeronet_utils.dart: -------------------------------------------------------------------------------- 1 | import '../dashboard/common/others.dart'; 2 | import '../dashboard/controllers/controllers.dart'; 3 | import '../dashboard/models/models.dart'; 4 | import '../imports.dart'; 5 | 6 | Future checkInitStatus() async { 7 | // loadSitesFromFileSystem(); 8 | // loadUsersFromFileSystem(); 9 | // setZeroBrowserThemeValues(); 10 | try { 11 | var url = ''; 12 | var address = ''; 13 | if (Directory(getZeroNetDataDir().path + '/' + Utils.urlZeroNetMob) 14 | .existsSync()) { 15 | address = Utils.urlHello; 16 | } else { 17 | address = Utils.urlZeroNetMob; 18 | } 19 | url = defZeroNetUrl + address; 20 | final key = await ZeroNet.instance.getWrapperKey(url); 21 | zeroNetUrl = defZeroNetUrl; 22 | varStore.zeroNetWrapperKey = key!; 23 | // zeroNetIPwithPort(defZeroNetUrl), 24 | ZeroNet.instance.connect(address).catchError( 25 | (onError) { 26 | printToConsole(onError); 27 | }, 28 | ); 29 | uiStore.setZeroNetStatus(ZeroNetStatus.RUNNING); 30 | service.sendData({'notification': 'ZeroNetStatus.RUNNING'}); 31 | testUrl(); 32 | } catch (e) { 33 | if (launchUrlString!.isNotEmpty || 34 | ((siteUiController.settings[autoStartZeroNet] as ToggleSetting) 35 | .value! && 36 | !firstTime) && 37 | !manuallyStoppedZeroNet) { 38 | //TODO: Remember this! 39 | // service.sendData({'cmd': 'runZeroNet'}); 40 | } 41 | if (e is OSError) { 42 | if (e.errorCode == 111) { 43 | printToConsole('Zeronet Not Running'); 44 | uiStore.setZeroNetStatus(ZeroNetStatus.NOT_RUNNING); 45 | } 46 | } 47 | } 48 | } 49 | 50 | void checkForAppUpdates() async { 51 | DateTime time = DateTime.now(); 52 | final lastUpdateTime = await getAppLastUpdateTime(); 53 | var updateTimeEpoch = lastUpdateTime != null 54 | ? int.parse(lastUpdateTime) 55 | : time.millisecondsSinceEpoch; 56 | var updateTime = DateTime.fromMillisecondsSinceEpoch(updateTimeEpoch); 57 | int updateDays; 58 | if (appVersion.contains('internal')) { 59 | updateDays = time.difference(updateTime).inSeconds; 60 | } else { 61 | updateDays = time.difference(updateTime).inDays; 62 | } 63 | if (updateDays > 3 && !kDebugMode) { 64 | if (kIsPlayStoreInstall ?? false) { 65 | AppUpdateInfo info = await InAppUpdate.checkForUpdate(); 66 | if (info.updateAvailability == UpdateAvailability.updateAvailable && 67 | info.flexibleUpdateAllowed) 68 | uiStore.updateInAppUpdateAvailable(AppUpdate.AVAILABLE); 69 | } 70 | } 71 | } 72 | 73 | writeZeroNetConf(String str) { 74 | File f = File(zeroNetDir + '/zeronet.conf'); 75 | if (f.existsSync()) { 76 | f.writeAsStringSync('\n' + str, mode: FileMode.append); 77 | } else { 78 | f.writeAsStringSync('[global]\n$str'); 79 | } 80 | } 81 | 82 | bool isZeroNetUserDataExists() { 83 | return getZeroNetUsersFilePath().isNotEmpty; 84 | } 85 | 86 | bool isZeroNetUsersFileExists() { 87 | var dataDir = getZeroNetDataDir(); 88 | if (dataDir.existsSync()) { 89 | File f = File(dataDir.path + '/users.json'); 90 | return f.existsSync(); 91 | } else { 92 | return false; 93 | } 94 | } 95 | 96 | String getZeroNetUsersFilePath() { 97 | var dataDir = getZeroNetDataDir(); 98 | if (dataDir.existsSync()) { 99 | File f = File(dataDir.path + '/users.json'); 100 | bool exists = f.existsSync(); 101 | if (exists) { 102 | return f.path; 103 | } 104 | } 105 | return ''; 106 | } 107 | 108 | Directory getZeroNetDataDir() => Directory( 109 | ((siteUiController.settings[publicDataFolder] as ToggleSetting).value! 110 | ? appPrivDir!.path 111 | : zeroNetDir) + 112 | sep + 113 | 'data', 114 | ); 115 | 116 | List getZeroNameProfiles() { 117 | List list = []; 118 | if (getZeroNetDataDir().existsSync()) 119 | for (var item in getZeroNetDataDir().listSync().where( 120 | (element) => element.path.endsWith('.json') && element is File)) { 121 | var name = item.path.replaceAll(getZeroNetDataDir().path + '/', ''); 122 | if (name.startsWith('users-')) { 123 | var username = name.replaceAll('users-', '').replaceAll('.json', ''); 124 | list.add(username); 125 | } 126 | } 127 | return list; 128 | } 129 | 130 | String getZeroIdUserName() { 131 | var zeroNetUsersFilePath = getZeroNetUsersFilePath(); 132 | if (zeroNetUsersFilePath.isEmpty) return ''; 133 | File file = File(zeroNetUsersFilePath); 134 | if (!file.existsSync()) return ''; 135 | Map map = json.decode(file.readAsStringSync()); 136 | if (map.keys.isEmpty) return ''; 137 | var key = map.keys.first; 138 | Map certMap = map[key]['certs']; 139 | var certs = []; 140 | if (certMap.keys.length < 1) 141 | return ''; 142 | else { 143 | for (var cert in certMap.keys) { 144 | certs.add(cert); 145 | var t = certMap[cert]; 146 | if (t != null) { 147 | return certMap[cert]['auth_user_name'] ?? ''; 148 | } 149 | } 150 | } 151 | return ''; 152 | } 153 | 154 | bool isZiteExitsLocally(String? address) { 155 | String path = getZeroNetDataDir().path + '/$address'; 156 | return Directory(path).existsSync(); 157 | } 158 | 159 | bool isLocalZitesExists() { 160 | String path = getZeroNetDataDir().path; 161 | Directory dir = Directory(path); 162 | 163 | List paths; 164 | if (dir.existsSync()) 165 | paths = dir 166 | .listSync() 167 | .where((element) => (element is Directory) ? true : false) 168 | .toList(); 169 | else 170 | return false; 171 | return paths.isNotEmpty; 172 | } 173 | 174 | Future activateFilters() async { 175 | File file = File(getZeroNetDataDir().path + '/filters.json'); 176 | File fileTemp = File(getZeroNetDataDir().path + '/filters-tmp.json'); 177 | if (!file.existsSync() || fileTemp.existsSync()) { 178 | File deFile = File(getZeroNetDataDir().path + '/filters.json-deactive'); 179 | if (deFile.existsSync()) { 180 | deFile.renameSync(getZeroNetDataDir().path + '/filters.json'); 181 | return true; 182 | } else { 183 | await saveInAppFilterstoDevice(); 184 | var filtersFileName = ''; 185 | var filtersPath = 186 | getZeroNetDataDir().path + '/${Utils.urlZeroNetMob}/filters/'; 187 | int len = 0; 188 | var directory = Directory(filtersPath); 189 | if (directory.existsSync()) len = directory.listSync().length; 190 | if (len >= 4) { 191 | filtersFileName = 'assets/filters/filters.json'; 192 | fileTemp.deleteSync(recursive: true); 193 | } else { 194 | filtersFileName = 'assets/filters/filters-tmp.json'; 195 | await saveFilterstoDevice(fileTemp, filtersFileName); 196 | } 197 | return await saveFilterstoDevice(file, filtersFileName); 198 | } 199 | } 200 | return true; 201 | } 202 | 203 | Future deactivateFilters() async { 204 | File file = File(getZeroNetDataDir().path + '/filters.json'); 205 | if (file.existsSync()) { 206 | file.renameSync(getZeroNetDataDir().path + '/filters.json-deactive'); 207 | } 208 | return true; 209 | } 210 | 211 | Future saveInAppFilterstoDevice() async { 212 | for (var filterName in filterFileNames) { 213 | File file = File( 214 | getZeroNetDataDir().path + '/tmp/filters/$filterName', 215 | ); 216 | if (!file.existsSync()) { 217 | await saveFilterstoDevice(file, 'assets/filters/$filterName'); 218 | } 219 | } 220 | return true; 221 | } 222 | 223 | Future saveFilterstoDevice(File file, String assetPath) async { 224 | file.createSync(recursive: true); 225 | var data = (await rootBundle.load(assetPath)); 226 | var buffer = data.buffer; 227 | file.writeAsBytesSync(buffer.asUint8List( 228 | data.offsetInBytes, 229 | data.lengthInBytes, 230 | )); 231 | return true; 232 | } 233 | 234 | Future createTorDataDir() { 235 | Directory torDir = Directory(dataDir + '/usr/var/lib/tor'); 236 | if (!torDir.existsSync()) torDir.createSync(); 237 | return Future.value(true); 238 | } 239 | 240 | int getZeroNetRevision(String zeroNetDir) { 241 | var file = File(zeroNetDir + '/src/Config.py'); 242 | var content = file.readAsStringSync(); 243 | var versionIndex = content.indexOf('self.rev = '); 244 | var version = content.substring(versionIndex + 11, versionIndex + 15); 245 | return int.parse(version); 246 | } 247 | 248 | String getZeroNetVersion(String zeroNetDir) { 249 | var file = File(zeroNetDir + '/src/Config.py'); 250 | var content = file.readAsStringSync(); 251 | var versionIndex = content.indexOf('self.version = "'); 252 | content = content.substring(versionIndex + 16); 253 | var endindex = content.indexOf('"'); 254 | var version = content.substring(0, endindex); 255 | return version; 256 | } 257 | 258 | bool checkPatchNeeded() { 259 | var zeroNetVersion = getZeroNetVersion(zeronetDir); 260 | var zeroNetRevision = getZeroNetRevision(zeronetDir); 261 | if (zeroNetRevision == 4555 && zeroNetVersion == '0.7.2') { 262 | return true; 263 | } else if (zeroNetRevision == 4556 && zeroNetVersion == '0.7.2-v3patched') { 264 | return false; 265 | } 266 | return false; 267 | } 268 | 269 | Future downloadPatch(String version) async { 270 | File patchFile = File(tempDir!.path + '/$version.zip'); 271 | if (!patchFile.existsSync()) { 272 | await downloadFile(zpatches, '$version.zip', tempDir!.path); 273 | } 274 | Directory dir = Directory(tempDir!.path + '/patches/$version'); 275 | if (!dir.existsSync()) { 276 | unzipBytes(version, patchFile.readAsBytesSync(), 277 | dest: '${tempDir!.path}/patches/$version/'); 278 | } 279 | } 280 | 281 | Future downloadFile(String url, String fileName, String dir) async { 282 | HttpClient httpClient = HttpClient(); 283 | File file; 284 | String filePath = ''; 285 | String myUrl = ''; 286 | 287 | try { 288 | myUrl = url + '/' + fileName; 289 | var request = await httpClient.getUrl(Uri.parse(myUrl)); 290 | var response = await request.close(); 291 | if (response.statusCode == 200) { 292 | var bytes = await consolidateHttpClientResponseBytes(response); 293 | filePath = '$dir/$fileName'; 294 | file = File(filePath); 295 | await file.writeAsBytes(bytes); 296 | } else 297 | filePath = 'Error code: ' + response.statusCode.toString(); 298 | } catch (ex) { 299 | filePath = 'Can not fetch url'; 300 | } 301 | 302 | return filePath; 303 | } 304 | 305 | void checkPatchAndApply(String patchPath, String zeroNetPath) { 306 | var zeroNetVersion = getZeroNetVersion(zeroNetPath); 307 | var zeroNetRevision = getZeroNetRevision(zeroNetPath); 308 | 309 | if (zeroNetRevision == 4555 && zeroNetVersion == '0.7.2') { 310 | printOut('Applying patch for 0.7.2'); 311 | applyPatch(patchPath, zeroNetPath); 312 | } else if (zeroNetRevision == 4555 && zeroNetVersion == '0.7.2-torv3') { 313 | printOut('Patch Already Applied for 0.7.2'); 314 | } 315 | } 316 | 317 | void applyPatch(String patchPath, String destination) { 318 | var patchManifestFile = File( 319 | patchPath + '/patch.manifest', 320 | ).readAsStringSync(); 321 | var contents = patchManifestFile.split('\n'); 322 | for (var line in contents) { 323 | if (line.startsWith('[{D_}]')) { 324 | var filePath = line.replaceAll('[{D_}]', ''); 325 | var file = File(destination + '/' + filePath); 326 | try { 327 | file.deleteSync(); 328 | } catch (e) { 329 | print(e); 330 | } 331 | } else if (line.startsWith('[{A_}]')) { 332 | var name = line.replaceAll('[{A_}]', ''); 333 | var file = File(patchPath + '/' + name); 334 | if (!file.existsSync()) { 335 | // throw Exception('File does not exist'); 336 | } 337 | var p = File(destination + '/' + name).parent; 338 | if (!p.existsSync()) { 339 | p.createSync(); 340 | } 341 | File(file.path).copySync(destination + '/' + name); 342 | } else if (line.startsWith('[{R_}]')) { 343 | var params = line.replaceAll('[{R_}]', '').split(']['); 344 | var oldname = params[0].replaceAll('[', ''); 345 | var newname = params[1].replaceAll(']', ''); 346 | if (oldname.endsWith('/') && newname.endsWith('/')) { 347 | try { 348 | Directory(destination + '/' + oldname).renameSync( 349 | destination + '/' + newname, 350 | ); 351 | } catch (e) { 352 | print(e); 353 | } 354 | } else { 355 | try { 356 | File(destination + '/' + oldname).renameSync( 357 | destination + '/' + newname, 358 | ); 359 | } catch (e) { 360 | print(e); 361 | } 362 | } 363 | } else if (line.startsWith('[{M_}]')) { 364 | var path = line.replaceAll('[{M_}]', ''); 365 | var patchFile = File(patchPath + '/' + path + '.patch'); 366 | var destinationFile = File(destination + '/' + path); 367 | var p = patchFromText(patchFile.readAsStringSync()); 368 | 369 | var dmp = DiffMatchPatch(); 370 | // var diff = dmp.diff(orgContent, patchedContent); 371 | var result = dmp.patch_apply(p, destinationFile.readAsStringSync()); 372 | print('\n' + result[1].toString() + '\n'); 373 | if (!(result[1] as List).contains(false)) { 374 | destinationFile.writeAsString(result[0]); 375 | } 376 | } 377 | } 378 | } 379 | -------------------------------------------------------------------------------- /lib/widgets/loading_page.dart: -------------------------------------------------------------------------------- 1 | import '../imports.dart'; 2 | 3 | class Loading extends StatelessWidget { 4 | // String data = 'Loading'; 5 | final String warning = strController.loadingPageWarningStr.value; 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersive); 10 | check(); 11 | return Scaffold( 12 | body: Center( 13 | child: Column( 14 | mainAxisAlignment: MainAxisAlignment.center, 15 | children: [ 16 | Container( 17 | constraints: PlatformExt.isMobile 18 | ? null 19 | : BoxConstraints(maxHeight: Get.height * 0.60), 20 | child: Image.asset('assets/logo.png'), 21 | ), 22 | Padding(padding: EdgeInsets.all(24.0)), 23 | Obx(() { 24 | var status = varStore.loadingStatus; 25 | return Text( 26 | status.value, 27 | style: TextStyle(fontSize: 24.0, fontStyle: FontStyle.italic), 28 | ); 29 | }), 30 | Obx(() { 31 | var percent = varStore.loadingPercent; 32 | if (percent < 1) return CircularProgressIndicator(); 33 | return Text( 34 | '($percent%)', 35 | style: TextStyle(fontSize: 18.0, fontStyle: FontStyle.italic), 36 | ); 37 | }), 38 | Text( 39 | warning, 40 | style: TextStyle(fontSize: 12.0, fontStyle: FontStyle.italic), 41 | ), 42 | Padding(padding: EdgeInsets.all(12.0)), 43 | Text( 44 | '${appVersion}(${buildNumber})', 45 | style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold), 46 | ), 47 | ], 48 | ), 49 | ), 50 | ); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /linux/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | project(runner LANGUAGES CXX) 3 | 4 | set(BINARY_NAME "ZeroNetX") 5 | set(APPLICATION_ID "in.canews.zeronet_mobile") 6 | 7 | cmake_policy(SET CMP0063 NEW) 8 | 9 | set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") 10 | 11 | # Root filesystem for cross-building. 12 | if(FLUTTER_TARGET_PLATFORM_SYSROOT) 13 | set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) 14 | set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) 15 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 16 | set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) 17 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 18 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 19 | endif() 20 | 21 | # Configure build options. 22 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 23 | set(CMAKE_BUILD_TYPE "Debug" CACHE 24 | STRING "Flutter build mode" FORCE) 25 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 26 | "Debug" "Profile" "Release") 27 | endif() 28 | 29 | # Compilation settings that should be applied to most targets. 30 | function(APPLY_STANDARD_SETTINGS TARGET) 31 | target_compile_features(${TARGET} PUBLIC cxx_std_14) 32 | target_compile_options(${TARGET} PRIVATE -Wall -Werror) 33 | target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") 34 | target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") 35 | endfunction() 36 | 37 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 38 | 39 | # Flutter library and tool build rules. 40 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 41 | 42 | # System-level dependencies. 43 | find_package(PkgConfig REQUIRED) 44 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 45 | 46 | add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") 47 | 48 | # Application build 49 | add_executable(${BINARY_NAME} 50 | "main.cc" 51 | "my_application.cc" 52 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 53 | ) 54 | apply_standard_settings(${BINARY_NAME}) 55 | target_link_libraries(${BINARY_NAME} PRIVATE flutter) 56 | target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) 57 | add_dependencies(${BINARY_NAME} flutter_assemble) 58 | # Only the install-generated bundle's copy of the executable will launch 59 | # correctly, since the resources must in the right relative locations. To avoid 60 | # people trying to run the unbundled copy, put it in a subdirectory instead of 61 | # the default top-level location. 62 | set_target_properties(${BINARY_NAME} 63 | PROPERTIES 64 | RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" 65 | ) 66 | 67 | # Generated plugin build rules, which manage building the plugins and adding 68 | # them to the application. 69 | include(flutter/generated_plugins.cmake) 70 | 71 | 72 | # === Installation === 73 | # By default, "installing" just makes a relocatable bundle in the build 74 | # directory. 75 | set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") 76 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 77 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 78 | endif() 79 | 80 | # Start with a clean build bundle directory every time. 81 | install(CODE " 82 | file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") 83 | " COMPONENT Runtime) 84 | 85 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 86 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") 87 | 88 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 89 | COMPONENT Runtime) 90 | 91 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 92 | COMPONENT Runtime) 93 | 94 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 95 | COMPONENT Runtime) 96 | 97 | if(PLUGIN_BUNDLED_LIBRARIES) 98 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" 99 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 100 | COMPONENT Runtime) 101 | endif() 102 | 103 | # Fully re-copy the assets directory on each build to avoid having stale files 104 | # from a previous install. 105 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 106 | install(CODE " 107 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 108 | " COMPONENT Runtime) 109 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 110 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 111 | 112 | # Install the AOT library on non-Debug builds only. 113 | if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") 114 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 115 | COMPONENT Runtime) 116 | endif() 117 | -------------------------------------------------------------------------------- /linux/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 4 | 5 | # Configuration provided via flutter tool. 6 | include(${EPHEMERAL_DIR}/generated_config.cmake) 7 | 8 | # TODO: Move the rest of this into files in ephemeral. See 9 | # https://github.com/flutter/flutter/issues/57146. 10 | 11 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...), 12 | # which isn't available in 3.10. 13 | function(list_prepend LIST_NAME PREFIX) 14 | set(NEW_LIST "") 15 | foreach(element ${${LIST_NAME}}) 16 | list(APPEND NEW_LIST "${PREFIX}${element}") 17 | endforeach(element) 18 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) 19 | endfunction() 20 | 21 | # === Flutter Library === 22 | # System-level dependencies. 23 | find_package(PkgConfig REQUIRED) 24 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 25 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) 26 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) 27 | 28 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") 29 | 30 | # Published to parent scope for install step. 31 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 32 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 33 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 34 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) 35 | 36 | list(APPEND FLUTTER_LIBRARY_HEADERS 37 | "fl_basic_message_channel.h" 38 | "fl_binary_codec.h" 39 | "fl_binary_messenger.h" 40 | "fl_dart_project.h" 41 | "fl_engine.h" 42 | "fl_json_message_codec.h" 43 | "fl_json_method_codec.h" 44 | "fl_message_codec.h" 45 | "fl_method_call.h" 46 | "fl_method_channel.h" 47 | "fl_method_codec.h" 48 | "fl_method_response.h" 49 | "fl_plugin_registrar.h" 50 | "fl_plugin_registry.h" 51 | "fl_standard_message_codec.h" 52 | "fl_standard_method_codec.h" 53 | "fl_string_codec.h" 54 | "fl_value.h" 55 | "fl_view.h" 56 | "flutter_linux.h" 57 | ) 58 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") 59 | add_library(flutter INTERFACE) 60 | target_include_directories(flutter INTERFACE 61 | "${EPHEMERAL_DIR}" 62 | ) 63 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") 64 | target_link_libraries(flutter INTERFACE 65 | PkgConfig::GTK 66 | PkgConfig::GLIB 67 | PkgConfig::GIO 68 | ) 69 | add_dependencies(flutter flutter_assemble) 70 | 71 | # === Flutter tool backend === 72 | # _phony_ is a non-existent file to force this command to run every time, 73 | # since currently there's no way to get a full input/output list from the 74 | # flutter tool. 75 | add_custom_command( 76 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 77 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_ 78 | COMMAND ${CMAKE_COMMAND} -E env 79 | ${FLUTTER_TOOL_ENVIRONMENT} 80 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" 81 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} 82 | VERBATIM 83 | ) 84 | add_custom_target(flutter_assemble DEPENDS 85 | "${FLUTTER_LIBRARY}" 86 | ${FLUTTER_LIBRARY_HEADERS} 87 | ) 88 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | void fl_register_plugins(FlPluginRegistry* registry) { 14 | g_autoptr(FlPluginRegistrar) bitsdojo_window_linux_registrar = 15 | fl_plugin_registry_get_registrar_for_plugin(registry, "BitsdojoWindowPlugin"); 16 | bitsdojo_window_plugin_register_with_registrar(bitsdojo_window_linux_registrar); 17 | g_autoptr(FlPluginRegistrar) system_tray_registrar = 18 | fl_plugin_registry_get_registrar_for_plugin(registry, "SystemTrayPlugin"); 19 | system_tray_plugin_register_with_registrar(system_tray_registrar); 20 | g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = 21 | fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); 22 | url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); 23 | } 24 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void fl_register_plugins(FlPluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | bitsdojo_window_linux 7 | system_tray 8 | url_launcher_linux 9 | ) 10 | 11 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 12 | ) 13 | 14 | set(PLUGIN_BUNDLED_LIBRARIES) 15 | 16 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 17 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 18 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 19 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 20 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 21 | endforeach(plugin) 22 | 23 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 24 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 25 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 26 | endforeach(ffi_plugin) 27 | -------------------------------------------------------------------------------- /linux/main.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | int main(int argc, char** argv) { 4 | g_autoptr(MyApplication) app = my_application_new(); 5 | return g_application_run(G_APPLICATION(app), argc, argv); 6 | } 7 | -------------------------------------------------------------------------------- /linux/my_application.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "my_application.h" 4 | 5 | #include 6 | #ifdef GDK_WINDOWING_X11 7 | #include 8 | #endif 9 | 10 | #include "flutter/generated_plugin_registrant.h" 11 | 12 | struct _MyApplication { 13 | GtkApplication parent_instance; 14 | char** dart_entrypoint_arguments; 15 | }; 16 | 17 | G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) 18 | 19 | // Implements GApplication::activate. 20 | static void my_application_activate(GApplication* application) { 21 | MyApplication* self = MY_APPLICATION(application); 22 | GtkWindow* window = 23 | GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); 24 | 25 | // Use a header bar when running in GNOME as this is the common style used 26 | // by applications and is the setup most users will be using (e.g. Ubuntu 27 | // desktop). 28 | // If running on X and not using GNOME then just use a traditional title bar 29 | // in case the window manager does more exotic layout, e.g. tiling. 30 | // If running on Wayland assume the header bar will work (may need changing 31 | // if future cases occur). 32 | gboolean use_header_bar = TRUE; 33 | #ifdef GDK_WINDOWING_X11 34 | GdkScreen* screen = gtk_window_get_screen(window); 35 | if (GDK_IS_X11_SCREEN(screen)) { 36 | const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); 37 | if (g_strcmp0(wm_name, "GNOME Shell") != 0) { 38 | use_header_bar = FALSE; 39 | } 40 | } 41 | #endif 42 | if (use_header_bar) { 43 | GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); 44 | gtk_widget_show(GTK_WIDGET(header_bar)); 45 | gtk_header_bar_set_title(header_bar, "ZeroNetX"); 46 | gtk_header_bar_set_show_close_button(header_bar, TRUE); 47 | gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); 48 | } else { 49 | gtk_window_set_title(window, "ZeroNetX"); 50 | } 51 | 52 | auto bdw = bitsdojo_window_from(window); 53 | bdw->setCustomFrame(true); 54 | // gtk_window_set_default_size(window, 1280, 720); 55 | gtk_widget_show(GTK_WIDGET(window)); 56 | 57 | g_autoptr(FlDartProject) project = fl_dart_project_new(); 58 | fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); 59 | 60 | FlView* view = fl_view_new(project); 61 | gtk_widget_show(GTK_WIDGET(view)); 62 | gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); 63 | 64 | fl_register_plugins(FL_PLUGIN_REGISTRY(view)); 65 | 66 | gtk_widget_grab_focus(GTK_WIDGET(view)); 67 | } 68 | 69 | // Implements GApplication::local_command_line. 70 | static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { 71 | MyApplication* self = MY_APPLICATION(application); 72 | // Strip out the first argument as it is the binary name. 73 | self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); 74 | 75 | g_autoptr(GError) error = nullptr; 76 | if (!g_application_register(application, nullptr, &error)) { 77 | g_warning("Failed to register: %s", error->message); 78 | *exit_status = 1; 79 | return TRUE; 80 | } 81 | 82 | g_application_activate(application); 83 | *exit_status = 0; 84 | 85 | return TRUE; 86 | } 87 | 88 | // Implements GObject::dispose. 89 | static void my_application_dispose(GObject* object) { 90 | MyApplication* self = MY_APPLICATION(object); 91 | g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); 92 | G_OBJECT_CLASS(my_application_parent_class)->dispose(object); 93 | } 94 | 95 | static void my_application_class_init(MyApplicationClass* klass) { 96 | G_APPLICATION_CLASS(klass)->activate = my_application_activate; 97 | G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; 98 | G_OBJECT_CLASS(klass)->dispose = my_application_dispose; 99 | } 100 | 101 | static void my_application_init(MyApplication* self) {} 102 | 103 | MyApplication* my_application_new() { 104 | return MY_APPLICATION(g_object_new(my_application_get_type(), 105 | "application-id", APPLICATION_ID, 106 | "flags", G_APPLICATION_NON_UNIQUE, 107 | nullptr)); 108 | } 109 | -------------------------------------------------------------------------------- /linux/my_application.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_MY_APPLICATION_H_ 2 | #define FLUTTER_MY_APPLICATION_H_ 3 | 4 | #include 5 | 6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, 7 | GtkApplication) 8 | 9 | /** 10 | * my_application_new: 11 | * 12 | * Creates a new Flutter-based application. 13 | * 14 | * Returns: a new #MyApplication. 15 | */ 16 | MyApplication* my_application_new(); 17 | 18 | #endif // FLUTTER_MY_APPLICATION_H_ 19 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: zeronet 2 | description: A new Flutter project. 3 | version: 1.0.0+1 4 | 5 | environment: 6 | sdk: '>=2.17.0 <3.0.0' 7 | 8 | dependencies: 9 | flutter: 10 | sdk: flutter 11 | auto_size_text: ^3.0.0 12 | archive: 3.3.7 13 | crypto: 3.0.3 14 | clipboard: ^0.1.3 #TODO! Replace this with `super_clipboard` 15 | device_info_plus: ^8.1.0 16 | diff_match_patch: ^0.4.1 17 | file_picker: ^5.2.5 18 | # flutter_absolute_path: 19 | # # path: ../flutter_absolute_path 20 | # git: 21 | # url: https://github.com/canewsin/flutter_absolute_path.git 22 | # # ref: android-v2 23 | flutter_downloader: 1.11.1 24 | # flutter_mobx: ^1.1.0+2 25 | http: ^0.13.4 26 | # mobx: ^1.2.1+4 27 | get: ^4.6.5 28 | google_fonts: ^4.0.4 29 | in_app_review: 2.0.4 30 | in_app_update: 3.0.0 31 | # git: 32 | # url: 4.1.4://github.com/canewsin/flutter_in_app_update.git 33 | outline_material_icons: #^0.1.1-nullsafety 34 | git: 35 | url: https://github.com/ZeroNetX/outline_material_icons.git 36 | equatable: 2.0.5 37 | time_ago_provider: 4.2.0 38 | package_info_plus: 3.0.3 39 | package_info_plus_web: 2.0.0 40 | path_provider: ^2.0.2 41 | purchases_flutter: 5.6.0 42 | random_string: 2.3.1 43 | restart_app: 1.2.1 44 | share: ^2.0.4 45 | url_launcher: 6.1.12 46 | flutter_background_service: 5.0.1 47 | # path: ../flutter_background_service 48 | # git: 49 | # url: https://github.com/ekasetiawans/flutter_background_service 50 | # ref: 9ad6ba3acf9952c53aa482708a4d099f9e33d98f 51 | flutter_background_service_android: ^6.0.1 52 | # flutter_webview_plugin: #^0.4.0 53 | # # git: https://github.com/nuc134r/flutter_webview_plugin.git 54 | # git: 55 | # url: https://github.com/canewsin/flutter_webview_plugin 56 | # ref: fullscreen-support 57 | # web_socket_channel: 1.1.0 58 | zeronet_ws: #^0.0.3 59 | # path: C:\Users\PramUkesh\Documents\FlutterProj\zeronet_ws 60 | git: 61 | url: https://github.com/canewsin/zeronet_ws 62 | ref: 768bcbd4a8ab8c7a668ecd6f8677dbeb77851e83 63 | internet_file: 1.2.0 64 | bitsdojo_window: ^0.1.5 65 | system_tray: #^0.0.9 66 | git: 67 | url: https://github.com/antler119/system_tray.git 68 | ref: 31a5a9ce817d820d883bfbf0f6cd600cb9df406f 69 | msix: 3.16.1 70 | flutter_inappwebview: 5.7.2+3 71 | # path: ../zeronet_ws 72 | # git: 73 | # url : https://github.com/canewsin/zeronet_ws.git 74 | 75 | dev_dependencies: 76 | flutter_test: 77 | sdk: flutter 78 | build_runner: ^2.1.7 79 | # build_runner: ^1.11.5 80 | # mobx_codegen: ^1.1.2 81 | 82 | flutter: 83 | uses-material-design: true 84 | assets: 85 | - assets/ 86 | - assets/developers/ 87 | - assets/icons/ 88 | - assets/filters/ 89 | - shorebird.yaml -------------------------------------------------------------------------------- /shorebird.yaml: -------------------------------------------------------------------------------- 1 | # This file is used to configure the Shorebird updater used by your app. 2 | # Learn more at https://docs.shorebird.dev 3 | # This file should be checked into version control. 4 | 5 | # This is the unique identifier assigned to your app. 6 | # Your app_id is not a secret and is just used to identify your app 7 | # when requesting patches from Shorebird's servers. 8 | app_id: ad8f21bd-2b4d-4773-89d5-4f8cc9a3aec8 9 | 10 | # auto_update controls if Shorebird should automatically update in the background on launch. 11 | # If auto_update: false, you will need to use package:shorebird_code_push to trigger updates. 12 | # https://pub.dev/packages/shorebird_code_push 13 | # Uncomment the following line to disable automatic updates. 14 | # auto_update: false 15 | -------------------------------------------------------------------------------- /version.properties: -------------------------------------------------------------------------------- 1 | flutter.versionName=v 0.9.5 2 | flutter.versionCode=125 3 | -------------------------------------------------------------------------------- /windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /windows/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(zeronet_mobile LANGUAGES CXX) 3 | 4 | set(BINARY_NAME "zeronet_mobile") 5 | 6 | cmake_policy(SET CMP0063 NEW) 7 | 8 | set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") 9 | 10 | # Configure build options. 11 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) 12 | if(IS_MULTICONFIG) 13 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" 14 | CACHE STRING "" FORCE) 15 | else() 16 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 17 | set(CMAKE_BUILD_TYPE "Debug" CACHE 18 | STRING "Flutter build mode" FORCE) 19 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 20 | "Debug" "Profile" "Release") 21 | endif() 22 | endif() 23 | 24 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") 25 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") 26 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") 27 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") 28 | 29 | # Use Unicode for all projects. 30 | add_definitions(-DUNICODE -D_UNICODE) 31 | 32 | # Compilation settings that should be applied to most targets. 33 | function(APPLY_STANDARD_SETTINGS TARGET) 34 | target_compile_features(${TARGET} PUBLIC cxx_std_17) 35 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") 36 | target_compile_options(${TARGET} PRIVATE /EHsc) 37 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") 38 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") 39 | endfunction() 40 | 41 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 42 | 43 | # Flutter library and tool build rules. 44 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 45 | 46 | # Application build 47 | add_subdirectory("runner") 48 | 49 | # Generated plugin build rules, which manage building the plugins and adding 50 | # them to the application. 51 | include(flutter/generated_plugins.cmake) 52 | 53 | 54 | # === Installation === 55 | # Support files are copied into place next to the executable, so that it can 56 | # run in place. This is done instead of making a separate bundle (as on Linux) 57 | # so that building and running from within Visual Studio will work. 58 | set(BUILD_BUNDLE_DIR "$") 59 | # Make the "install" step default, as it's required to run. 60 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) 61 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 62 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 63 | endif() 64 | 65 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 66 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") 67 | 68 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 69 | COMPONENT Runtime) 70 | 71 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 72 | COMPONENT Runtime) 73 | 74 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 75 | COMPONENT Runtime) 76 | 77 | if(PLUGIN_BUNDLED_LIBRARIES) 78 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" 79 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 80 | COMPONENT Runtime) 81 | endif() 82 | 83 | # Fully re-copy the assets directory on each build to avoid having stale files 84 | # from a previous install. 85 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 86 | install(CODE " 87 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 88 | " COMPONENT Runtime) 89 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 90 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 91 | 92 | # Install the AOT library on non-Debug builds only. 93 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 94 | CONFIGURATIONS Profile;Release 95 | COMPONENT Runtime) 96 | -------------------------------------------------------------------------------- /windows/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | 3 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 4 | 5 | # Configuration provided via flutter tool. 6 | include(${EPHEMERAL_DIR}/generated_config.cmake) 7 | 8 | # TODO: Move the rest of this into files in ephemeral. See 9 | # https://github.com/flutter/flutter/issues/57146. 10 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") 11 | 12 | # === Flutter Library === 13 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") 14 | 15 | # Published to parent scope for install step. 16 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 17 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 18 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 19 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) 20 | 21 | list(APPEND FLUTTER_LIBRARY_HEADERS 22 | "flutter_export.h" 23 | "flutter_windows.h" 24 | "flutter_messenger.h" 25 | "flutter_plugin_registrar.h" 26 | "flutter_texture_registrar.h" 27 | ) 28 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") 29 | add_library(flutter INTERFACE) 30 | target_include_directories(flutter INTERFACE 31 | "${EPHEMERAL_DIR}" 32 | ) 33 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") 34 | add_dependencies(flutter flutter_assemble) 35 | 36 | # === Wrapper === 37 | list(APPEND CPP_WRAPPER_SOURCES_CORE 38 | "core_implementations.cc" 39 | "standard_codec.cc" 40 | ) 41 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") 42 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN 43 | "plugin_registrar.cc" 44 | ) 45 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") 46 | list(APPEND CPP_WRAPPER_SOURCES_APP 47 | "flutter_engine.cc" 48 | "flutter_view_controller.cc" 49 | ) 50 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") 51 | 52 | # Wrapper sources needed for a plugin. 53 | add_library(flutter_wrapper_plugin STATIC 54 | ${CPP_WRAPPER_SOURCES_CORE} 55 | ${CPP_WRAPPER_SOURCES_PLUGIN} 56 | ) 57 | apply_standard_settings(flutter_wrapper_plugin) 58 | set_target_properties(flutter_wrapper_plugin PROPERTIES 59 | POSITION_INDEPENDENT_CODE ON) 60 | set_target_properties(flutter_wrapper_plugin PROPERTIES 61 | CXX_VISIBILITY_PRESET hidden) 62 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) 63 | target_include_directories(flutter_wrapper_plugin PUBLIC 64 | "${WRAPPER_ROOT}/include" 65 | ) 66 | add_dependencies(flutter_wrapper_plugin flutter_assemble) 67 | 68 | # Wrapper sources needed for the runner. 69 | add_library(flutter_wrapper_app STATIC 70 | ${CPP_WRAPPER_SOURCES_CORE} 71 | ${CPP_WRAPPER_SOURCES_APP} 72 | ) 73 | apply_standard_settings(flutter_wrapper_app) 74 | target_link_libraries(flutter_wrapper_app PUBLIC flutter) 75 | target_include_directories(flutter_wrapper_app PUBLIC 76 | "${WRAPPER_ROOT}/include" 77 | ) 78 | add_dependencies(flutter_wrapper_app flutter_assemble) 79 | 80 | # === Flutter tool backend === 81 | # _phony_ is a non-existent file to force this command to run every time, 82 | # since currently there's no way to get a full input/output list from the 83 | # flutter tool. 84 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") 85 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) 86 | add_custom_command( 87 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 88 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} 89 | ${CPP_WRAPPER_SOURCES_APP} 90 | ${PHONY_OUTPUT} 91 | COMMAND ${CMAKE_COMMAND} -E env 92 | ${FLUTTER_TOOL_ENVIRONMENT} 93 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" 94 | windows-x64 $ 95 | VERBATIM 96 | ) 97 | add_custom_target(flutter_assemble DEPENDS 98 | "${FLUTTER_LIBRARY}" 99 | ${FLUTTER_LIBRARY_HEADERS} 100 | ${CPP_WRAPPER_SOURCES_CORE} 101 | ${CPP_WRAPPER_SOURCES_PLUGIN} 102 | ${CPP_WRAPPER_SOURCES_APP} 103 | ) 104 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | void RegisterPlugins(flutter::PluginRegistry* registry) { 14 | BitsdojoWindowPluginRegisterWithRegistrar( 15 | registry->GetRegistrarForPlugin("BitsdojoWindowPlugin")); 16 | SystemTrayPluginRegisterWithRegistrar( 17 | registry->GetRegistrarForPlugin("SystemTrayPlugin")); 18 | UrlLauncherWindowsRegisterWithRegistrar( 19 | registry->GetRegistrarForPlugin("UrlLauncherWindows")); 20 | } 21 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void RegisterPlugins(flutter::PluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | bitsdojo_window_windows 7 | system_tray 8 | url_launcher_windows 9 | ) 10 | 11 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 12 | ) 13 | 14 | set(PLUGIN_BUNDLED_LIBRARIES) 15 | 16 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 17 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 18 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 19 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 20 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 21 | endforeach(plugin) 22 | 23 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 24 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 25 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 26 | endforeach(ffi_plugin) 27 | -------------------------------------------------------------------------------- /windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | add_executable(${BINARY_NAME} WIN32 5 | "flutter_window.cpp" 6 | "main.cpp" 7 | "utils.cpp" 8 | "win32_window.cpp" 9 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 10 | "Runner.rc" 11 | "runner.exe.manifest" 12 | ) 13 | apply_standard_settings(${BINARY_NAME}) 14 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 15 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 16 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 17 | add_dependencies(${BINARY_NAME} flutter_assemble) 18 | -------------------------------------------------------------------------------- /windows/runner/Runner.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #pragma code_page(65001) 4 | #include "resource.h" 5 | 6 | #define APSTUDIO_READONLY_SYMBOLS 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // 9 | // Generated from the TEXTINCLUDE 2 resource. 10 | // 11 | #include "winres.h" 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | #undef APSTUDIO_READONLY_SYMBOLS 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // English (United States) resources 18 | 19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Icon 51 | // 52 | 53 | // Icon with lowest ID value placed first to ensure application icon 54 | // remains consistent on all systems. 55 | IDI_APP_ICON ICON "resources\\app_icon.ico" 56 | 57 | 58 | ///////////////////////////////////////////////////////////////////////////// 59 | // 60 | // Version 61 | // 62 | 63 | #if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) 64 | #define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD 65 | #else 66 | #define VERSION_AS_NUMBER 1,0,0,0 67 | #endif 68 | 69 | #if defined(FLUTTER_VERSION) 70 | #define VERSION_AS_STRING FLUTTER_VERSION 71 | #else 72 | #define VERSION_AS_STRING "1.0.0" 73 | #endif 74 | 75 | VS_VERSION_INFO VERSIONINFO 76 | FILEVERSION VERSION_AS_NUMBER 77 | PRODUCTVERSION VERSION_AS_NUMBER 78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 79 | #ifdef _DEBUG 80 | FILEFLAGS VS_FF_DEBUG 81 | #else 82 | FILEFLAGS 0x0L 83 | #endif 84 | FILEOS VOS__WINDOWS32 85 | FILETYPE VFT_APP 86 | FILESUBTYPE 0x0L 87 | BEGIN 88 | BLOCK "StringFileInfo" 89 | BEGIN 90 | BLOCK "040904e4" 91 | BEGIN 92 | VALUE "CompanyName", "in.canews" "\0" 93 | VALUE "FileDescription", "A new Flutter project." "\0" 94 | VALUE "FileVersion", VERSION_AS_STRING "\0" 95 | VALUE "InternalName", "zeronet_mobile" "\0" 96 | VALUE "LegalCopyright", "Copyright (C) 2022 in.canews. All rights reserved." "\0" 97 | VALUE "OriginalFilename", "zeronet_mobile.exe" "\0" 98 | VALUE "ProductName", "zeronet_mobile" "\0" 99 | VALUE "ProductVersion", VERSION_AS_STRING "\0" 100 | END 101 | END 102 | BLOCK "VarFileInfo" 103 | BEGIN 104 | VALUE "Translation", 0x409, 1252 105 | END 106 | END 107 | 108 | #endif // English (United States) resources 109 | ///////////////////////////////////////////////////////////////////////////// 110 | 111 | 112 | 113 | #ifndef APSTUDIO_INVOKED 114 | ///////////////////////////////////////////////////////////////////////////// 115 | // 116 | // Generated from the TEXTINCLUDE 3 resource. 117 | // 118 | 119 | 120 | ///////////////////////////////////////////////////////////////////////////// 121 | #endif // not APSTUDIO_INVOKED 122 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.cpp: -------------------------------------------------------------------------------- 1 | #include "flutter_window.h" 2 | 3 | #include 4 | 5 | #include "flutter/generated_plugin_registrant.h" 6 | 7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project) 8 | : project_(project) {} 9 | 10 | FlutterWindow::~FlutterWindow() {} 11 | 12 | bool FlutterWindow::OnCreate() { 13 | if (!Win32Window::OnCreate()) { 14 | return false; 15 | } 16 | 17 | RECT frame = GetClientArea(); 18 | 19 | // The size here must match the window dimensions to avoid unnecessary surface 20 | // creation / destruction in the startup path. 21 | flutter_controller_ = std::make_unique( 22 | frame.right - frame.left, frame.bottom - frame.top, project_); 23 | // Ensure that basic setup of the controller was successful. 24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) { 25 | return false; 26 | } 27 | RegisterPlugins(flutter_controller_->engine()); 28 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 29 | return true; 30 | } 31 | 32 | void FlutterWindow::OnDestroy() { 33 | if (flutter_controller_) { 34 | flutter_controller_ = nullptr; 35 | } 36 | 37 | Win32Window::OnDestroy(); 38 | } 39 | 40 | LRESULT 41 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 42 | WPARAM const wparam, 43 | LPARAM const lparam) noexcept { 44 | // Give Flutter, including plugins, an opportunity to handle window messages. 45 | if (flutter_controller_) { 46 | std::optional result = 47 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 48 | lparam); 49 | if (result) { 50 | return *result; 51 | } 52 | } 53 | 54 | switch (message) { 55 | case WM_FONTCHANGE: 56 | flutter_controller_->engine()->ReloadSystemFonts(); 57 | break; 58 | } 59 | 60 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 61 | } 62 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "win32_window.h" 10 | 11 | // A window that does nothing but host a Flutter view. 12 | class FlutterWindow : public Win32Window { 13 | public: 14 | // Creates a new FlutterWindow hosting a Flutter view running |project|. 15 | explicit FlutterWindow(const flutter::DartProject& project); 16 | virtual ~FlutterWindow(); 17 | 18 | protected: 19 | // Win32Window: 20 | bool OnCreate() override; 21 | void OnDestroy() override; 22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 23 | LPARAM const lparam) noexcept override; 24 | 25 | private: 26 | // The project to run. 27 | flutter::DartProject project_; 28 | 29 | // The Flutter instance hosted by this window. 30 | std::unique_ptr flutter_controller_; 31 | }; 32 | 33 | #endif // RUNNER_FLUTTER_WINDOW_H_ 34 | -------------------------------------------------------------------------------- /windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | auto bdw = bitsdojo_window_configure(BDW_CUSTOM_FRAME | BDW_HIDE_ON_STARTUP); 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "flutter_window.h" 9 | #include "utils.h" 10 | 11 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 12 | _In_ wchar_t *command_line, _In_ int show_command) { 13 | // Attach to console when present (e.g., 'flutter run') or create a 14 | // new console when running with a debugger. 15 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 16 | CreateAndAttachConsole(); 17 | } 18 | 19 | // Initialize COM, so that it is available for use in the library and/or 20 | // plugins. 21 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 22 | 23 | flutter::DartProject project(L"data"); 24 | 25 | std::vector command_line_arguments = 26 | GetCommandLineArguments(); 27 | 28 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 29 | 30 | FlutterWindow window(project); 31 | Win32Window::Point origin(205, 10); 32 | Win32Window::Size size(550, 750); 33 | if (!window.CreateAndShow(L"ZeroNetX", origin, size)) { 34 | return EXIT_FAILURE; 35 | } 36 | window.SetQuitOnClose(true); 37 | 38 | ::MSG msg; 39 | while (::GetMessage(&msg, nullptr, 0, 0)) { 40 | ::TranslateMessage(&msg); 41 | ::DispatchMessage(&msg); 42 | } 43 | 44 | ::CoUninitialize(); 45 | return EXIT_SUCCESS; 46 | } 47 | -------------------------------------------------------------------------------- /windows/runner/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Runner.rc 4 | // 5 | #define IDI_APP_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroNetX/zeronet_mobile/1cf141a1697d78ba41c52122a5858dd148056b1c/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | void CreateAndAttachConsole() { 11 | if (::AllocConsole()) { 12 | FILE *unused; 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { 14 | _dup2(_fileno(stdout), 1); 15 | } 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { 17 | _dup2(_fileno(stdout), 2); 18 | } 19 | std::ios::sync_with_stdio(); 20 | FlutterDesktopResyncOutputStreams(); 21 | } 22 | } 23 | 24 | std::vector GetCommandLineArguments() { 25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. 26 | int argc; 27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); 28 | if (argv == nullptr) { 29 | return std::vector(); 30 | } 31 | 32 | std::vector command_line_arguments; 33 | 34 | // Skip the first argument as it's the binary name. 35 | for (int i = 1; i < argc; i++) { 36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i])); 37 | } 38 | 39 | ::LocalFree(argv); 40 | 41 | return command_line_arguments; 42 | } 43 | 44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) { 45 | if (utf16_string == nullptr) { 46 | return std::string(); 47 | } 48 | int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr); 51 | if (target_length == 0) { 52 | return std::string(); 53 | } 54 | std::string utf8_string; 55 | utf8_string.resize(target_length); 56 | int converted_length = ::WideCharToMultiByte( 57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 58 | -1, utf8_string.data(), 59 | target_length, nullptr, nullptr); 60 | if (converted_length == 0) { 61 | return std::string(); 62 | } 63 | return utf8_string; 64 | } 65 | -------------------------------------------------------------------------------- /windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | // Creates a console for the process, and redirects stdout and stderr to 8 | // it for both the runner and the Flutter library. 9 | void CreateAndAttachConsole(); 10 | 11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string 12 | // encoded in UTF-8. Returns an empty std::string on failure. 13 | std::string Utf8FromUtf16(const wchar_t* utf16_string); 14 | 15 | // Gets the command line arguments passed in as a std::vector, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | -------------------------------------------------------------------------------- /windows/runner/win32_window.cpp: -------------------------------------------------------------------------------- 1 | #include "win32_window.h" 2 | 3 | #include 4 | 5 | #include "resource.h" 6 | 7 | namespace { 8 | 9 | constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; 10 | 11 | // The number of Win32Window objects that currently exist. 12 | static int g_active_window_count = 0; 13 | 14 | using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); 15 | 16 | // Scale helper to convert logical scaler values to physical using passed in 17 | // scale factor 18 | int Scale(int source, double scale_factor) { 19 | return static_cast(source * scale_factor); 20 | } 21 | 22 | // Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. 23 | // This API is only needed for PerMonitor V1 awareness mode. 24 | void EnableFullDpiSupportIfAvailable(HWND hwnd) { 25 | HMODULE user32_module = LoadLibraryA("User32.dll"); 26 | if (!user32_module) { 27 | return; 28 | } 29 | auto enable_non_client_dpi_scaling = 30 | reinterpret_cast( 31 | GetProcAddress(user32_module, "EnableNonClientDpiScaling")); 32 | if (enable_non_client_dpi_scaling != nullptr) { 33 | enable_non_client_dpi_scaling(hwnd); 34 | FreeLibrary(user32_module); 35 | } 36 | } 37 | 38 | } // namespace 39 | 40 | // Manages the Win32Window's window class registration. 41 | class WindowClassRegistrar { 42 | public: 43 | ~WindowClassRegistrar() = default; 44 | 45 | // Returns the singleton registar instance. 46 | static WindowClassRegistrar* GetInstance() { 47 | if (!instance_) { 48 | instance_ = new WindowClassRegistrar(); 49 | } 50 | return instance_; 51 | } 52 | 53 | // Returns the name of the window class, registering the class if it hasn't 54 | // previously been registered. 55 | const wchar_t* GetWindowClass(); 56 | 57 | // Unregisters the window class. Should only be called if there are no 58 | // instances of the window. 59 | void UnregisterWindowClass(); 60 | 61 | private: 62 | WindowClassRegistrar() = default; 63 | 64 | static WindowClassRegistrar* instance_; 65 | 66 | bool class_registered_ = false; 67 | }; 68 | 69 | WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; 70 | 71 | const wchar_t* WindowClassRegistrar::GetWindowClass() { 72 | if (!class_registered_) { 73 | WNDCLASS window_class{}; 74 | window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); 75 | window_class.lpszClassName = kWindowClassName; 76 | window_class.style = CS_HREDRAW | CS_VREDRAW; 77 | window_class.cbClsExtra = 0; 78 | window_class.cbWndExtra = 0; 79 | window_class.hInstance = GetModuleHandle(nullptr); 80 | window_class.hIcon = 81 | LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); 82 | window_class.hbrBackground = 0; 83 | window_class.lpszMenuName = nullptr; 84 | window_class.lpfnWndProc = Win32Window::WndProc; 85 | RegisterClass(&window_class); 86 | class_registered_ = true; 87 | } 88 | return kWindowClassName; 89 | } 90 | 91 | void WindowClassRegistrar::UnregisterWindowClass() { 92 | UnregisterClass(kWindowClassName, nullptr); 93 | class_registered_ = false; 94 | } 95 | 96 | Win32Window::Win32Window() { 97 | ++g_active_window_count; 98 | } 99 | 100 | Win32Window::~Win32Window() { 101 | --g_active_window_count; 102 | Destroy(); 103 | } 104 | 105 | bool Win32Window::CreateAndShow(const std::wstring& title, 106 | const Point& origin, 107 | const Size& size) { 108 | Destroy(); 109 | 110 | const wchar_t* window_class = 111 | WindowClassRegistrar::GetInstance()->GetWindowClass(); 112 | 113 | const POINT target_point = {static_cast(origin.x), 114 | static_cast(origin.y)}; 115 | HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); 116 | UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); 117 | double scale_factor = dpi / 96.0; 118 | 119 | HWND window = CreateWindow( 120 | window_class, title.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE, 121 | Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), 122 | Scale(size.width, scale_factor), Scale(size.height, scale_factor), 123 | nullptr, nullptr, GetModuleHandle(nullptr), this); 124 | 125 | if (!window) { 126 | return false; 127 | } 128 | 129 | return OnCreate(); 130 | } 131 | 132 | // static 133 | LRESULT CALLBACK Win32Window::WndProc(HWND const window, 134 | UINT const message, 135 | WPARAM const wparam, 136 | LPARAM const lparam) noexcept { 137 | if (message == WM_NCCREATE) { 138 | auto window_struct = reinterpret_cast(lparam); 139 | SetWindowLongPtr(window, GWLP_USERDATA, 140 | reinterpret_cast(window_struct->lpCreateParams)); 141 | 142 | auto that = static_cast(window_struct->lpCreateParams); 143 | EnableFullDpiSupportIfAvailable(window); 144 | that->window_handle_ = window; 145 | } else if (Win32Window* that = GetThisFromHandle(window)) { 146 | return that->MessageHandler(window, message, wparam, lparam); 147 | } 148 | 149 | return DefWindowProc(window, message, wparam, lparam); 150 | } 151 | 152 | LRESULT 153 | Win32Window::MessageHandler(HWND hwnd, 154 | UINT const message, 155 | WPARAM const wparam, 156 | LPARAM const lparam) noexcept { 157 | switch (message) { 158 | case WM_DESTROY: 159 | window_handle_ = nullptr; 160 | Destroy(); 161 | if (quit_on_close_) { 162 | PostQuitMessage(0); 163 | } 164 | return 0; 165 | 166 | case WM_DPICHANGED: { 167 | auto newRectSize = reinterpret_cast(lparam); 168 | LONG newWidth = newRectSize->right - newRectSize->left; 169 | LONG newHeight = newRectSize->bottom - newRectSize->top; 170 | 171 | SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, 172 | newHeight, SWP_NOZORDER | SWP_NOACTIVATE); 173 | 174 | return 0; 175 | } 176 | case WM_SIZE: { 177 | RECT rect = GetClientArea(); 178 | if (child_content_ != nullptr) { 179 | // Size and position the child window. 180 | MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, 181 | rect.bottom - rect.top, TRUE); 182 | } 183 | return 0; 184 | } 185 | 186 | case WM_ACTIVATE: 187 | if (child_content_ != nullptr) { 188 | SetFocus(child_content_); 189 | } 190 | return 0; 191 | } 192 | 193 | return DefWindowProc(window_handle_, message, wparam, lparam); 194 | } 195 | 196 | void Win32Window::Destroy() { 197 | OnDestroy(); 198 | 199 | if (window_handle_) { 200 | DestroyWindow(window_handle_); 201 | window_handle_ = nullptr; 202 | } 203 | if (g_active_window_count == 0) { 204 | WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); 205 | } 206 | } 207 | 208 | Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { 209 | return reinterpret_cast( 210 | GetWindowLongPtr(window, GWLP_USERDATA)); 211 | } 212 | 213 | void Win32Window::SetChildContent(HWND content) { 214 | child_content_ = content; 215 | SetParent(content, window_handle_); 216 | RECT frame = GetClientArea(); 217 | 218 | MoveWindow(content, frame.left, frame.top, frame.right - frame.left, 219 | frame.bottom - frame.top, true); 220 | 221 | SetFocus(child_content_); 222 | } 223 | 224 | RECT Win32Window::GetClientArea() { 225 | RECT frame; 226 | GetClientRect(window_handle_, &frame); 227 | return frame; 228 | } 229 | 230 | HWND Win32Window::GetHandle() { 231 | return window_handle_; 232 | } 233 | 234 | void Win32Window::SetQuitOnClose(bool quit_on_close) { 235 | quit_on_close_ = quit_on_close; 236 | } 237 | 238 | bool Win32Window::OnCreate() { 239 | // No-op; provided for subclasses. 240 | return true; 241 | } 242 | 243 | void Win32Window::OnDestroy() { 244 | // No-op; provided for subclasses. 245 | } 246 | -------------------------------------------------------------------------------- /windows/runner/win32_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_WIN32_WINDOW_H_ 2 | #define RUNNER_WIN32_WINDOW_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be 11 | // inherited from by classes that wish to specialize with custom 12 | // rendering and input handling 13 | class Win32Window { 14 | public: 15 | struct Point { 16 | unsigned int x; 17 | unsigned int y; 18 | Point(unsigned int x, unsigned int y) : x(x), y(y) {} 19 | }; 20 | 21 | struct Size { 22 | unsigned int width; 23 | unsigned int height; 24 | Size(unsigned int width, unsigned int height) 25 | : width(width), height(height) {} 26 | }; 27 | 28 | Win32Window(); 29 | virtual ~Win32Window(); 30 | 31 | // Creates and shows a win32 window with |title| and position and size using 32 | // |origin| and |size|. New windows are created on the default monitor. Window 33 | // sizes are specified to the OS in physical pixels, hence to ensure a 34 | // consistent size to will treat the width height passed in to this function 35 | // as logical pixels and scale to appropriate for the default monitor. Returns 36 | // true if the window was created successfully. 37 | bool CreateAndShow(const std::wstring& title, 38 | const Point& origin, 39 | const Size& size); 40 | 41 | // Release OS resources associated with window. 42 | void Destroy(); 43 | 44 | // Inserts |content| into the window tree. 45 | void SetChildContent(HWND content); 46 | 47 | // Returns the backing Window handle to enable clients to set icon and other 48 | // window properties. Returns nullptr if the window has been destroyed. 49 | HWND GetHandle(); 50 | 51 | // If true, closing this window will quit the application. 52 | void SetQuitOnClose(bool quit_on_close); 53 | 54 | // Return a RECT representing the bounds of the current client area. 55 | RECT GetClientArea(); 56 | 57 | protected: 58 | // Processes and route salient window messages for mouse handling, 59 | // size change and DPI. Delegates handling of these to member overloads that 60 | // inheriting classes can handle. 61 | virtual LRESULT MessageHandler(HWND window, 62 | UINT const message, 63 | WPARAM const wparam, 64 | LPARAM const lparam) noexcept; 65 | 66 | // Called when CreateAndShow is called, allowing subclass window-related 67 | // setup. Subclasses should return false if setup fails. 68 | virtual bool OnCreate(); 69 | 70 | // Called when Destroy is called. 71 | virtual void OnDestroy(); 72 | 73 | private: 74 | friend class WindowClassRegistrar; 75 | 76 | // OS callback called by message pump. Handles the WM_NCCREATE message which 77 | // is passed when the non-client area is being created and enables automatic 78 | // non-client DPI scaling so that the non-client area automatically 79 | // responsponds to changes in DPI. All other messages are handled by 80 | // MessageHandler. 81 | static LRESULT CALLBACK WndProc(HWND const window, 82 | UINT const message, 83 | WPARAM const wparam, 84 | LPARAM const lparam) noexcept; 85 | 86 | // Retrieves a class instance pointer for |window| 87 | static Win32Window* GetThisFromHandle(HWND const window) noexcept; 88 | 89 | bool quit_on_close_ = false; 90 | 91 | // window handle for top level window. 92 | HWND window_handle_ = nullptr; 93 | 94 | // window handle for hosted content. 95 | HWND child_content_ = nullptr; 96 | }; 97 | 98 | #endif // RUNNER_WIN32_WINDOW_H_ 99 | --------------------------------------------------------------------------------