Skip to content

Commit

Permalink
v 0.7.7 - beta 1
Browse files Browse the repository at this point in the history
- Fixed Tor Binaries ( Backup users.json file and Clear App Data in-case Tor Doesn't work for You ).
  • Loading branch information
canewsin committed Dec 9, 2020
1 parent 3ace836 commit f9e1988
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 9 deletions.
Binary file modified android/app/src/main/jniLibs/arm64-v8a/libtor.so
Binary file not shown.
Binary file modified android/app/src/main/jniLibs/armeabi-v7a/libtor.so
Binary file not shown.
Binary file modified android/app/src/main/jniLibs/x86/libtor.so
Binary file not shown.
Binary file modified android/app/src/main/jniLibs/x86_64/libtor.so
Binary file not shown.
Binary file modified android/arm/src/main/assets/tor_arm.zip
Binary file not shown.
Binary file modified android/arm64/src/main/assets/tor_arm64.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions android/version.properties
Original file line number Diff line number Diff line change
@@ -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
Binary file modified android/x86/src/main/assets/tor_x86.zip
Binary file not shown.
Binary file modified android/x86_64/src/main/assets/tor_x86_64.zip
Binary file not shown.
1 change: 1 addition & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class MyApp extends StatelessWidget {
makeExecHelper().then(
(value) => isExecPermitted = value,
);
createTorDataDir();
firstTime = false;
}
if (uiStore.zeroNetStatus == ZeroNetStatus.NOT_RUNNING &&
Expand Down
3 changes: 2 additions & 1 deletion lib/others/common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};
Expand Down Expand Up @@ -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);
Expand Down
8 changes: 8 additions & 0 deletions lib/others/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -254,6 +257,11 @@ class Utils {
description: enableZeroNetConsoleDes,
value: false,
),
enableTorLog: ToggleSetting(
name: enableTorLog,
description: enableTorLogDes,
value: false,
),
};
}

Expand Down
26 changes: 20 additions & 6 deletions lib/others/zeronet_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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();
Expand All @@ -212,6 +217,7 @@ void onBgServiceDataReceivedForIsolate(Map<String, dynamic> data) {
Map initMap = data['init'];
zeroNetNativeDir = initMap['zeroNetNativeDir'];
debugZeroNetCode = initMap['debugZeroNetCode'];
enableTorLogConsole = initMap['enableTorLog'];
zeroNetStartedFromBoot = initMap['zeroNetStartedFromBoot'];
vibrateonZeroNetStart = initMap['vibrateOnZeroNetStart'];
setBgServiceRunningNotification();
Expand Down Expand Up @@ -247,6 +253,8 @@ void onBgServiceDataReceived(Map<String, dynamic> data) {
'zeroNetStartedFromBoot': false,
'debugZeroNetCode':
(varStore.settings[debugZeroNet] as ToggleSetting).value,
'enableTorLog':
(varStore.settings[enableTorLog] as ToggleSetting).value,
'vibrateOnZeroNetStart':
(varStore.settings[vibrateOnZeroNetStart] as ToggleSetting).value,
}
Expand Down Expand Up @@ -446,3 +454,9 @@ Future<bool> saveFilterstoDevice(File file) async {
));
return true;
}

Future<bool> createTorDataDir() {
Directory torDir = Directory(dataDir + '/usr/var/lib/tor');
if (!torDir.existsSync()) torDir.createSync();
return Future.value(true);
}
3 changes: 3 additions & 0 deletions lib/widgets/settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f9e1988

Please sign in to comment.