diff --git a/android/app/src/main/jniLibs/arm64-v8a/libtor.so b/android/app/src/main/jniLibs/arm64-v8a/libtor.so index ecd2f16..5989552 100644 Binary files a/android/app/src/main/jniLibs/arm64-v8a/libtor.so and b/android/app/src/main/jniLibs/arm64-v8a/libtor.so differ diff --git a/android/app/src/main/jniLibs/armeabi-v7a/libtor.so b/android/app/src/main/jniLibs/armeabi-v7a/libtor.so index 9d0141a..bbce44b 100644 Binary files a/android/app/src/main/jniLibs/armeabi-v7a/libtor.so and b/android/app/src/main/jniLibs/armeabi-v7a/libtor.so differ diff --git a/android/app/src/main/jniLibs/x86/libtor.so b/android/app/src/main/jniLibs/x86/libtor.so index b02de47..4b8e77e 100644 Binary files a/android/app/src/main/jniLibs/x86/libtor.so and b/android/app/src/main/jniLibs/x86/libtor.so differ diff --git a/android/app/src/main/jniLibs/x86_64/libtor.so b/android/app/src/main/jniLibs/x86_64/libtor.so index cd0e804..5985e96 100644 Binary files a/android/app/src/main/jniLibs/x86_64/libtor.so and b/android/app/src/main/jniLibs/x86_64/libtor.so differ diff --git a/android/arm/src/main/assets/tor_arm.zip b/android/arm/src/main/assets/tor_arm.zip index 08ccbfa..dc4be44 100644 Binary files a/android/arm/src/main/assets/tor_arm.zip and b/android/arm/src/main/assets/tor_arm.zip differ diff --git a/android/arm64/src/main/assets/tor_arm64.zip b/android/arm64/src/main/assets/tor_arm64.zip index eba2c6a..5e9342f 100644 Binary files a/android/arm64/src/main/assets/tor_arm64.zip and b/android/arm64/src/main/assets/tor_arm64.zip differ diff --git a/android/version.properties b/android/version.properties index 09c490f..fac375b 100644 --- a/android/version.properties +++ b/android/version.properties @@ -1,2 +1,2 @@ -flutter.versionName=v 0.7.6 - beta 1 -flutter.versionCode=10 +flutter.versionName=v 0.7.7 - beta 1 +flutter.versionCode=20 diff --git a/android/x86/src/main/assets/tor_x86.zip b/android/x86/src/main/assets/tor_x86.zip index 878ef29..1432bb4 100644 Binary files a/android/x86/src/main/assets/tor_x86.zip and b/android/x86/src/main/assets/tor_x86.zip differ diff --git a/android/x86_64/src/main/assets/tor_x86_64.zip b/android/x86_64/src/main/assets/tor_x86_64.zip index ead5074..8cf3619 100644 Binary files a/android/x86_64/src/main/assets/tor_x86_64.zip and b/android/x86_64/src/main/assets/tor_x86_64.zip differ diff --git a/lib/main.dart b/lib/main.dart index 79547ef..d743100 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -44,6 +44,7 @@ class MyApp extends StatelessWidget { makeExecHelper().then( (value) => isExecPermitted = value, ); + createTorDataDir(); firstTime = false; } if (uiStore.zeroNetStatus == ZeroNetStatus.NOT_RUNNING && diff --git a/lib/others/common.dart b/lib/others/common.dart index 86d77d8..d0885ba 100644 --- a/lib/others/common.dart +++ b/lib/others/common.dart @@ -17,6 +17,7 @@ bool manuallyStoppedZeroNet = false; bool zeroNetStartedFromBoot = true; bool isExecPermitted = false; bool debugZeroNetCode = false; +bool enableTorLogConsole = false; bool vibrateonZeroNetStart = false; int downloadStatus = 0; Map downloadsMap = {}; @@ -235,12 +236,12 @@ printToConsole(Object object) { } log = log + object + '\n'; } else { + log = startZeroNetLog + '\n'; if (object.contains(zeronetAlreadyRunningError)) { runZeroNetWs(); uiStore.setZeroNetStatus(ZeroNetStatus.RUNNING); service.sendData({'notification': 'ZeroNetStatus.RUNNING'}); } - log = log + '\n'; } } varStore.setZeroNetLog(log); diff --git a/lib/others/constants.dart b/lib/others/constants.dart index e7a029b..563d9af 100644 --- a/lib/others/constants.dart +++ b/lib/others/constants.dart @@ -97,6 +97,9 @@ const String autoStartZeroNetDes = const String autoStartZeroNetonBoot = 'AutoStart ZeroNet on Boot'; const String autoStartZeroNetonBootDes = 'This Will Make ZeroNet Auto Start on Device Boot.'; +const String enableTorLog = 'Enable Tor Log'; +const String enableTorLogDes = + 'This will Enable Tor Log in ZeroNet Console helpful for debugging.'; class Utils { static const String urlHello = '1HeLLo4uzjaLetFx6NH3PMwFP3qbRbTf3D'; @@ -254,6 +257,11 @@ class Utils { description: enableZeroNetConsoleDes, value: false, ), + enableTorLog: ToggleSetting( + name: enableTorLog, + description: enableTorLogDes, + value: false, + ), }; } diff --git a/lib/others/zeronet_utils.dart b/lib/others/zeronet_utils.dart index 8a61537..3d5e04c 100644 --- a/lib/others/zeronet_utils.dart +++ b/lib/others/zeronet_utils.dart @@ -78,12 +78,14 @@ runTorEngine() { "LD_LIBRARY_PATH": "$libDir:$libDir64:/system/lib64", }).then((proc) { zero = proc; - zero.stderr.listen((onData) { - // service.sendData({'console': utf8.decode(onData)}); - }); - zero.stdout.listen((onData) { - // service.sendData({'console': utf8.decode(onData)}); - }); + if (enableTorLogConsole) { + zero.stderr.listen((onData) { + service.sendData({'console': utf8.decode(onData)}); + }); + zero.stdout.listen((onData) { + service.sendData({'console': utf8.decode(onData)}); + }); + } }).catchError((e) { if (e is ProcessException) { printOut(e.toString()); @@ -160,6 +162,7 @@ void runZeroNetService({bool autoStart = false}) async { bool filtersEnabled = (varStore.settings[enableZeroNetFilters] as ToggleSetting).value; if (filtersEnabled) await activateFilters(); + printToConsole(startZeroNetLog); if (await FlutterBackgroundService().isServiceRunning()) FlutterBackgroundService.initialize( runBgIsolate, @@ -188,6 +191,8 @@ void runBgIsolate() { loadDataFile(); debugZeroNetCode = (varStore.settings[debugZeroNet] as ToggleSetting).value; + enableTorLogConsole = + (varStore.settings[enableTorLog] as ToggleSetting).value; vibrateonZeroNetStart = (varStore.settings[vibrateOnZeroNetStart] as ToggleSetting).value; runZeroNet(); @@ -212,6 +217,7 @@ void onBgServiceDataReceivedForIsolate(Map data) { Map initMap = data['init']; zeroNetNativeDir = initMap['zeroNetNativeDir']; debugZeroNetCode = initMap['debugZeroNetCode']; + enableTorLogConsole = initMap['enableTorLog']; zeroNetStartedFromBoot = initMap['zeroNetStartedFromBoot']; vibrateonZeroNetStart = initMap['vibrateOnZeroNetStart']; setBgServiceRunningNotification(); @@ -247,6 +253,8 @@ void onBgServiceDataReceived(Map data) { 'zeroNetStartedFromBoot': false, 'debugZeroNetCode': (varStore.settings[debugZeroNet] as ToggleSetting).value, + 'enableTorLog': + (varStore.settings[enableTorLog] as ToggleSetting).value, 'vibrateOnZeroNetStart': (varStore.settings[vibrateOnZeroNetStart] as ToggleSetting).value, } @@ -446,3 +454,9 @@ Future saveFilterstoDevice(File file) async { )); return true; } + +Future createTorDataDir() { + Directory torDir = Directory(dataDir + '/usr/var/lib/tor'); + if (!torDir.existsSync()) torDir.createSync(); + return Future.value(true); +} diff --git a/lib/widgets/settings_page.dart b/lib/widgets/settings_page.dart index 780830f..9c19390 100644 --- a/lib/widgets/settings_page.dart +++ b/lib/widgets/settings_page.dart @@ -29,6 +29,9 @@ class SettingsPage extends StatelessWidget { if (current.name == profileSwitcher) { bool isUsersFileExists = isZeroNetUsersFileExists(); if (!isUsersFileExists) return Container(); + } else if (current.name == enableZeroNetFilters && + firstTime) { + return Container(); } return SettingsCard( setting: current,