From 34b04117e6f1db46a0d1630b46e86a7475e7df7f Mon Sep 17 00:00:00 2001 From: Abdul Mannan Saeed <111820160@umt.edu.pk> Date: Mon, 6 Mar 2023 00:21:42 +0500 Subject: [PATCH] Bug Fixes Bug Fixes --- app/build.gradle | 10 +++++----- .../homeController/homeController.java | 16 +++++++++++++++- .../settingNotificationModel.java | 1 + app/variables.gradle | 4 ++-- .../kotlin-compiler-5547377381595311531.salive | 0 .../android/service/OrbotService.java | 18 +++++++++++++++++- 6 files changed, 40 insertions(+), 9 deletions(-) create mode 100644 build/kotlin/sessions/kotlin-compiler-5547377381595311531.salive diff --git a/app/build.gradle b/app/build.gradle index 8aaefbcc..f180d94e 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -57,11 +57,11 @@ android { splits { abi { - enable project.ext.splitEnabled + //enable project.ext.splitEnabled - reset() + //reset() - include project.ext.abi_x86, project.ext.abi_x86_x64, project.ext.abi_arm64, project.ext.abi_armeabi + //include project.ext.abi_x86, project.ext.abi_x86_x64, project.ext.abi_arm64, project.ext.abi_armeabi } } bundle { @@ -127,7 +127,7 @@ dependencies { /* Automated APK Generation */ -android.applicationVariants.all { variant -> +/*android.applicationVariants.all { variant -> def buildType = variant.buildType.name @@ -152,7 +152,7 @@ android.applicationVariants.all { variant -> } } } - +*/ diff --git a/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/homeController/homeController.java b/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/homeController/homeController.java index 96fdcba7..20883894 100644 --- a/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/homeController/homeController.java +++ b/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/homeController/homeController.java @@ -274,6 +274,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba if(status.mThemeApplying){ mGeckoClient.initRestore(mGeckoView, homeController.this); } + status.mThemeApplying = false; } public void initTor() { @@ -755,8 +756,8 @@ public class homeController extends AppCompatActivity implements ComponentCallba public void onReDrawGeckoview() { dataController.getInstance().invokeTab(dataEnums.eTabCommands.CLOSE_TAB, Arrays.asList(mGeckoClient.getSession(), mGeckoClient.getSession())); mGeckoClient.initializeSession(mGeckoView, new geckoViewCallback(), this); + mGeckoClient.onSaveCurrentTab(true, this); } - public void onExternalURLInvoke(String pData) { if (status.sSettingIsAppStarted) { activityContextManager.getInstance().onGoHome(); @@ -1969,8 +1970,21 @@ public class homeController extends AppCompatActivity implements ComponentCallba orbotLocalConstants.mSoftNotification = true; } + public void onReloadProxy(){ + if(!status.mThemeApplying && status.sSettingIsAppStarted && status.sTorBrowsing && status.sNotificaionStatus == 0){ + pluginController.getInstance().onOrbotInvoke(Collections.singletonList(status.mThemeApplying), pluginEnums.eOrbotManager.M_DESTROY); + new Handler().postDelayed(() -> + { + pluginController.getInstance().onOrbotInvoke(Arrays.asList(status.sBridgeCustomBridge, status.sBridgeGatewayManual, status.sBridgeCustomType, status.sBridgeStatus, status.sShowImages, status.sClearOnExit, dataController.getInstance().invokeBridges(dataEnums.eBridgeWebsiteCommands.M_FETCH, null)), pluginEnums.eOrbotManager.M_START_ORBOT); + }, 500); + } + } + @Override public void onResume() { + + onReloadProxy(); + if(status.sNotificaionStatus == 1){ onShowDefaultNotification(true); } diff --git a/app/src/main/java/com/hiddenservices/onionservices/appManager/settingManager/notificationManager/settingNotificationModel.java b/app/src/main/java/com/hiddenservices/onionservices/appManager/settingManager/notificationManager/settingNotificationModel.java index ce3d132f..5a5711d2 100644 --- a/app/src/main/java/com/hiddenservices/onionservices/appManager/settingManager/notificationManager/settingNotificationModel.java +++ b/app/src/main/java/com/hiddenservices/onionservices/appManager/settingManager/notificationManager/settingNotificationModel.java @@ -36,6 +36,7 @@ class settingNotificationModel { activityContextManager.getInstance().getHomeController().onShowDefaultNotification(true); } } + activityContextManager.getInstance().getHomeController().onReloadProxy(); } public Object onTrigger(settingNotificationEnums.eNotificationModel pCommands, List pData) { diff --git a/app/variables.gradle b/app/variables.gradle index 50582e91..906baf38 100755 --- a/app/variables.gradle +++ b/app/variables.gradle @@ -1,6 +1,6 @@ /* Version */ -project.ext.vname = 'Build | Dark-Origin 1.1.0.4' -project.ext.vcode = 540 +project.ext.vname = 'Build | Dark-Origin 1.1.0.5' +project.ext.vcode = 545 project.ext.buildType = 'release' project.ext.jvmTarget = "1.8" project.ext.applovin_key = "pCPe4EeU2ZQVwQPeHLgseRqHBX1V5pvo9Piuu4J809dRhadEgukXa1A8po_UeXu5hmPOTaP1v4QPaMKIEOhh50" diff --git a/build/kotlin/sessions/kotlin-compiler-5547377381595311531.salive b/build/kotlin/sessions/kotlin-compiler-5547377381595311531.salive new file mode 100644 index 00000000..e69de29b diff --git a/orbotmanager/src/main/java/org/torproject/android/service/OrbotService.java b/orbotmanager/src/main/java/org/torproject/android/service/OrbotService.java index 528faa1b..d3ce4692 100644 --- a/orbotmanager/src/main/java/org/torproject/android/service/OrbotService.java +++ b/orbotmanager/src/main/java/org/torproject/android/service/OrbotService.java @@ -318,7 +318,9 @@ public class OrbotService extends VpnService implements OrbotConstants { createNetworkStateReciever(); IntentFilter mNetworkStateFilter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION); - registerReceiver(mNetworkStateReceiver , mNetworkStateFilter); + try { + registerReceiver(mNetworkStateReceiver , mNetworkStateFilter); + }catch (Exception ex){} if (mCurrentStatus.equals(STATUS_OFF)) showToolbarNotification(getString(R.string.open_orbot_to_connect_to_tor), NOTIFY_ID, R.drawable.ic_stat_tor_off); self = this; @@ -335,6 +337,20 @@ public class OrbotService extends VpnService implements OrbotConstants { //showToolbarNotification(getString(R.string.open_orbot_to_connect_to_tor), NOTIFY_ID, R.mipmap.ic_stat_tor_logo); } + public void onUnRegister() { + try { + if(mNetworkStateReceiver!=null){ + unregisterReceiver(mNetworkStateReceiver); + } + if(mActionBroadcastReceiver!=null){ + unregisterReceiver(mActionBroadcastReceiver); + } + }catch (Exception ex){ + Log.i("sad","asd"); + ex.printStackTrace(); + } + } + @Override public void onDestroy() {