From 7cdae61285be70f692bc7996913b5501c05b2e90 Mon Sep 17 00:00:00 2001 From: Abdul Mannan Saeed <111820160@umt.edu.pk> Date: Thu, 8 Dec 2022 17:29:02 +0500 Subject: [PATCH] Bug Fixes Bug Fixes --- app/build.gradle | 22 +++++++++---------- app/src/main/AndroidManifest.xml | 3 +-- .../advertManager/advertController.java | 1 - .../geckoManager/geckoClients.java | 8 ++++--- .../homeController/homeController.java | 12 +++++----- .../orionAdvertController.java | 1 - .../onionservices/constants/constants.java | 2 +- .../dataManager/bridgesDataModel.java | 11 +++++----- app/variables.gradle | 10 ++++----- build.gradle | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 2 +- orbotmanager/build.gradle | 1 + orbotmanager/src/main/AndroidManifest.xml | 3 +-- orbotmanager/src/main/res/raw/bridges.txt | 18 ++++++++++----- service-telemetry/build.gradle | 1 + .../src/main/AndroidManifest.xml | 3 +-- 16 files changed, 56 insertions(+), 46 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 1a807561..9cc9fb09 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -69,6 +69,7 @@ android { orionRelease.root = project.ext.releaseRoot } + namespace 'com.example.myapplication' } dependencies { @@ -81,20 +82,20 @@ dependencies { implementation 'androidx.recyclerview:recyclerview:1.2.1' implementation 'androidx.coordinatorlayout:coordinatorlayout:1.2.0' - implementation 'com.google.android.material:material:1.5.0' - implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.6.21' - implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21' + implementation 'com.google.android.material:material:1.7.0' + implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.7.20' + implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10' implementation 'org.apache.commons:commons-text:1.3' - implementation 'androidx.work:work-runtime-ktx:2.8.0-alpha02' - implementation 'androidx.constraintlayout:constraintlayout:2.1.3' + implementation 'androidx.work:work-runtime-ktx:2.8.0-beta02' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'com.android.support.constraint:constraint-layout:2.0.4' implementation 'androidx.preference:preference-ktx:1.2.0' implementation 'com.android.support:support-annotations:29.0.0' - implementation 'androidx.appcompat:appcompat:1.4.1' + implementation 'androidx.appcompat:appcompat:1.5.1' /* Firefox ABI Splits */ - implementation "androidx.compose.foundation:foundation:1.1.1" + implementation "androidx.compose.foundation:foundation:1.3.1" implementation "org.mozilla.components:browser-engine-gecko:100.0.20220327143103" implementation "org.mozilla.components:support-rusthttp:100.0.20220327143103" implementation "org.mozilla.components:support-rustlog:100.0.20220327143103" @@ -109,8 +110,7 @@ dependencies { /* Ads Manager */ - implementation 'com.applovin:applovin-sdk:+' - implementation 'com.applovin.mediation:mytarget-adapter:+' + implementation 'com.applovin:applovin-sdk:11.5.5' implementation 'com.applovin.mediation:adcolony-adapter:4.8.0.2' implementation 'com.adcolony:sdk:4.8.0' implementation 'com.facebook.android:audience-network-sdk:6.8.0' @@ -121,8 +121,8 @@ dependencies { /* Helper Libraries */ - implementation "android.arch.lifecycle:extensions:1.1.0" - implementation "androidx.lifecycle:lifecycle-extensions:2.0.0" + implementation "android.arch.lifecycle:extensions:1.1.1" + implementation "androidx.lifecycle:lifecycle-extensions:2.2.0" implementation 'com.coolerfall:android-http-download-manager:1.6.3' implementation 'com.android.volley:volley:1.2.1' implementation "net.zetetic:android-database-sqlcipher:4.4.3" diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index e259d84a..b224839a 100755 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,7 +1,6 @@ + xmlns:tools="http://schemas.android.com/tools"> diff --git a/app/src/main/java/com/hiddenservices/onionservices/appManager/advertManager/advertController.java b/app/src/main/java/com/hiddenservices/onionservices/appManager/advertManager/advertController.java index c2bb247a..536b8840 100644 --- a/app/src/main/java/com/hiddenservices/onionservices/appManager/advertManager/advertController.java +++ b/app/src/main/java/com/hiddenservices/onionservices/appManager/advertManager/advertController.java @@ -42,7 +42,6 @@ public class advertController extends AppCompatActivity { mWebView.getSettings().setGeolocationEnabled(true); mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); mWebView.getSettings().setUseWideViewPort(true); - mWebView.getSettings().setAppCacheEnabled(true); mWebView.getSettings().setDatabaseEnabled(true); mWebView.setWebViewClient(new advertWebViewClient(new webivewViewCallback())); } diff --git a/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/geckoManager/geckoClients.java b/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/geckoManager/geckoClients.java index d14f18b7..758c7a53 100644 --- a/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/geckoManager/geckoClients.java +++ b/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/geckoManager/geckoClients.java @@ -261,10 +261,12 @@ public class geckoClients { private final WebExtension.PortDelegate mPortDelegate = new WebExtension.PortDelegate() { @Override public void onPortMessage(final @NonNull Object message, final @NonNull WebExtension.Port port) { - if (message != null && mSession.getProgress() == 100 && !mSession.mCloseRequested && mSession.isFirstPaintExecuted && !mSession.mOnBackPressed) { - event.invokeObserver(Arrays.asList(message, mSession.getCurrentURL()), M_INDEX_WEBSITE); + if(mSession!=null){ + if (message != null && mSession.getProgress() == 100 && !mSession.mCloseRequested && mSession.isFirstPaintExecuted && !mSession.mOnBackPressed) { + event.invokeObserver(Arrays.asList(message, mSession.getCurrentURL()), M_INDEX_WEBSITE); + } + mSession.mOnBackPressed = false; } - mSession.mOnBackPressed = false; } @Override 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 6310cdaa..82d46b89 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 @@ -919,7 +919,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba } onSearchBarInvoked(v); if (mGeckoClient!=null && mGeckoClient.getSession() !=null){ - if (!mSearchBarPreviousText.equals(mSearchbar.getText())) { + if (!mSearchBarPreviousText.equals(mSearchbar.getText().toString())) { mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(), false, true, false); } mHomeViewController.onClearSelections(true); @@ -953,10 +953,12 @@ public class homeController extends AppCompatActivity implements ComponentCallba }); mGeckoView.setOnTouchListener((view, motionEvent) -> { - if (mGeckoClient.getSession().getCurrentURL().contains("genesis")) { - getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); - } else { - getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); + if(mGeckoClient!=null && mGeckoClient.getSession()!=null){ + if (mGeckoClient.getSession().getCurrentURL().contains("genesis")) { + getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); + } else { + getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); + } } return false; }); diff --git a/app/src/main/java/com/hiddenservices/onionservices/appManager/orionAdvertManager/orionAdvertController.java b/app/src/main/java/com/hiddenservices/onionservices/appManager/orionAdvertManager/orionAdvertController.java index f7d85781..d2b878f8 100644 --- a/app/src/main/java/com/hiddenservices/onionservices/appManager/orionAdvertManager/orionAdvertController.java +++ b/app/src/main/java/com/hiddenservices/onionservices/appManager/orionAdvertManager/orionAdvertController.java @@ -43,7 +43,6 @@ public class orionAdvertController extends AppCompatActivity { mWebView.getSettings().setGeolocationEnabled(true); mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); mWebView.getSettings().setUseWideViewPort(true); - mWebView.getSettings().setAppCacheEnabled(true); mWebView.getSettings().setDatabaseEnabled(true); mWebView.setWebViewClient(new orionAdvertWebViewClient(new webivewViewCallback())); } diff --git a/app/src/main/java/com/hiddenservices/onionservices/constants/constants.java b/app/src/main/java/com/hiddenservices/onionservices/constants/constants.java index da06fd21..3b8791c8 100644 --- a/app/src/main/java/com/hiddenservices/onionservices/constants/constants.java +++ b/app/src/main/java/com/hiddenservices/onionservices/constants/constants.java @@ -29,7 +29,7 @@ public class constants { public static final String CONST_SERVER = "https://drive.google.com/uc?export=download&id=1ALCooJQEtPYgyTm9XfYmkzSl_WuiBzeX"; public static final String CONST_GENESIS_REFERENCE_WEBSITES = "https://drive.google.com/uc?export=download&id=1meNaswi7kmITqLLTb0fIXY2wgw_cG290"; - public static final String CONST_GENESIS_BRIDGE_WEBSITES = "https://drive.google.com/uc?export=download&id=1wCXY3UWfUbISeY7TSWtCdDNMAiyGG9zj"; + public static final String CONST_GENESIS_BRIDGE_WEBSITES = "http://167.86.99.31/.well-known/bridges.txt"; /*URL CONSTANTS*/ diff --git a/app/src/main/java/com/hiddenservices/onionservices/dataManager/bridgesDataModel.java b/app/src/main/java/com/hiddenservices/onionservices/dataManager/bridgesDataModel.java index c8d033f1..51d41066 100644 --- a/app/src/main/java/com/hiddenservices/onionservices/dataManager/bridgesDataModel.java +++ b/app/src/main/java/com/hiddenservices/onionservices/dataManager/bridgesDataModel.java @@ -25,7 +25,6 @@ public class bridgesDataModel { /* Initializations */ public bridgesDataModel() { - mBridges = status.sBridgesDefault; } /* Helper Methods */ @@ -46,7 +45,8 @@ public class bridgesDataModel { if (response.length() > 10) { mBridges = response; status.sBridgesDefault = response; - dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_STRING, Arrays.asList(keys.BRIDGE_DEFAULT, strings.BRIDGES_DEFAULT)); + dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_STRING, Arrays.asList(keys.BRIDGE_DEFAULT, mBridges)); + String xx = status.sBridgesDefault = (String) dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_STRING, Arrays.asList(keys.BRIDGE_DEFAULT, strings.BRIDGES_DEFAULT)); mLoading = false; } else { mBridges = status.sReferenceWebsites; @@ -60,11 +60,12 @@ public class bridgesDataModel { RequestQueue requestQueue = Volley.newRequestQueue(pContext); requestQueue.add(stringRequest); } + } - private String onFetch() { + private String onFetch(Context pContext) { try { - return mBridges; + return status.sBridgesDefault; } catch (Exception ignored) { } return strings.GENERIC_EMPTY_SPACE; @@ -77,7 +78,7 @@ public class bridgesDataModel { onLoad((Context) pData.get(0)); } if (p_commands == dataEnums.eBridgeWebsiteCommands.M_FETCH) { - return onFetch(); + return onFetch((Context) pData.get(0)); } return null; diff --git a/app/variables.gradle b/app/variables.gradle index 5b356587..de732872 100755 --- a/app/variables.gradle +++ b/app/variables.gradle @@ -1,6 +1,6 @@ /* Version */ -project.ext.vname = 'Build | Dark-Origin 1.0.5.8' -project.ext.vcode = 415 +project.ext.vname = 'Build | Dark-Origin 1.0.6.0' +project.ext.vcode = 420 project.ext.buildType = 'release' /* dimension */ @@ -28,10 +28,10 @@ project.ext.preDexLibraries = true project.ext.splitEnabled = true /* Application Preferences */ -project.ext.compile_sdk_version = 31 +project.ext.compile_sdk_version = 33 project.ext.min_sdk_version = 21 -project.ext.target_sdk_version = 31 -project.ext.build_tool_version = '31' +project.ext.target_sdk_version = 33 +project.ext.build_tool_version = '33' project.ext.ndk_version = '21.4.7075529' project.ext.application_id = "com.hiddenservices.onionservices" project.ext.debugSymbolLevel = 'FULL' diff --git a/build.gradle b/build.gradle index 2cb53f37..70744963 100755 --- a/build.gradle +++ b/build.gradle @@ -13,8 +13,8 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.2.1' - classpath 'com.google.gms:google-services:4.3.10' + classpath 'com.android.tools.build:gradle:7.3.1' + classpath 'com.google.gms:google-services:4.3.14' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10" } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 28351e54..c0f9ea4c 100755 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip diff --git a/orbotmanager/build.gradle b/orbotmanager/build.gradle index 6de00b4e..5a550a66 100644 --- a/orbotmanager/build.gradle +++ b/orbotmanager/build.gradle @@ -38,6 +38,7 @@ android { textReport false xmlReport false } + namespace 'org.torproject.android.service' } dependencies { diff --git a/orbotmanager/src/main/AndroidManifest.xml b/orbotmanager/src/main/AndroidManifest.xml index 0b300c68..335ae6e6 100644 --- a/orbotmanager/src/main/AndroidManifest.xml +++ b/orbotmanager/src/main/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/orbotmanager/src/main/res/raw/bridges.txt b/orbotmanager/src/main/res/raw/bridges.txt index 0368580e..3be00487 100644 --- a/orbotmanager/src/main/res/raw/bridges.txt +++ b/orbotmanager/src/main/res/raw/bridges.txt @@ -1,7 +1,15 @@ -obfs4 192.95.36.142:443 CDF2E852BF539B82BD10E27E9115A31734E378C2 cert=qUVQ0srL1JI/vO6V6m/24anYXiJD3QP2HgzUKQtQ7GRqqUvs7P+tG43RtAqdhLOALP7DJQ iat-mode=1 -obfs4 38.229.1.78:80 C8CBDB2464FC9804A69531437BCF2BE31FDD2EE4 cert=Hmyfd2ev46gGY7NoVxA9ngrPF2zCZtzskRTzoWXbxNkzeVnGFPWmrTtILRyqCTjHR+s9dg iat-mode=1 -obfs4 38.229.33.83:80 0BAC39417268B96B9F514E7F63FA6FBA1A788955 cert=VwEFpk9F/UN9JED7XpG1XOjm/O8ZCXK80oPecgWnNDZDv5pdkhq1OpbAH0wNqOT6H6BmRQ iat-mode=1 -obfs4 37.218.245.14:38224 D9A82D2F9C2F65A18407B1D2B764F130847F8B5D cert=bjRaMrr1BRiAW8IE9U5z27fQaYgOhX1UCmOpg2pFpoMvo6ZgQMzLsaTzzQNTlm7hNcb+Sg iat-mode=0 obfs4 85.31.186.98:443 011F2599C0E9B27EE74B353155E244813763C3E5 cert=ayq0XzCwhpdysn5o0EyDUbmSOx3X/oTEbzDMvczHOdBJKlvIdHHLJGkZARtT4dcBFArPPg iat-mode=0 +obfs4 38.229.1.78:80 C8CBDB2464FC9804A69531437BCF2BE31FDD2EE4 cert=Hmyfd2ev46gGY7NoVxA9ngrPF2zCZtzskRTzoWXbxNkzeVnGFPWmrTtILRyqCTjHR+s9dg iat-mode=1 +obfs4 146.57.248.225:22 10A6CD36A537FCE513A322361547444B393989F0 cert=K1gDtDAIcUfeLqbstggjIw2rtgIKqdIhUlHp82XRqNSq/mtAjp1BIC9vHKJ2FAEpGssTPw iat-mode=0 +obfs4 209.148.46.65:443 74FAD13168806246602538555B5521A0383A1875 cert=ssH+9rP8dG2NLDN2XuFw63hIO/9MNNinLmxQDpVa+7kTOa9/m+tGWT1SmSYpQ9uTBGa6Hw iat-mode=0 +obfs4 37.218.245.14:38224 D9A82D2F9C2F65A18407B1D2B764F130847F8B5D cert=bjRaMrr1BRiAW8IE9U5z27fQaYgOhX1UCmOpg2pFpoMvo6ZgQMzLsaTzzQNTlm7hNcb+Sg iat-mode=0 +obfs4 85.31.186.26:443 91A6354697E6B02A386312F68D82CF86824D3606 cert=PBwr+S8JTVZo6MPdHnkTwXJPILWADLqfMGoVvhZClMq/Urndyd42BwX9YFJHZnBB3H0XCw iat-mode=0 +obfs4 193.11.166.194:27020 86AC7B8D430DAC4117E9F42C9EAED18133863AAF cert=0LDeJH4JzMDtkJJrFphJCiPqKx7loozKN7VNfuukMGfHO0Z8OGdzHVkhVAOfo1mUdv9cMg iat-mode=0 +obfs4 38.229.33.83:80 0BAC39417268B96B9F514E7F63FA6FBA1A788955 cert=VwEFpk9F/UN9JED7XpG1XOjm/O8ZCXK80oPecgWnNDZDv5pdkhq1OpbAH0wNqOT6H6BmRQ iat-mode=1 +obfs4 192.95.36.142:443 CDF2E852BF539B82BD10E27E9115A31734E378C2 cert=qUVQ0srL1JI/vO6V6m/24anYXiJD3QP2HgzUKQtQ7GRqqUvs7P+tG43RtAqdhLOALP7DJQ iat-mode=1 +obfs4 51.222.13.177:80 5EDAC3B810E12B01F6FD8050D2FD3E277B289A08 cert=2uplIpLQ0q9+0qMFrK5pkaYRDOe460LL9WHBvatgkuRr/SL31wBOEupaMMJ6koRE6Ld0ew iat-mode=0 +obfs4 193.11.166.194:27025 1AE2C08904527FEA90C4C4F8C1083EA59FBC6FAF cert=ItvYZzW5tn6v3G4UnQa6Qz04Npro6e81AP70YujmK/KXwDFPTs3aHXcHp4n8Vt6w/bv8cA iat-mode=0 +obfs4 45.145.95.6:27015 C5B7CD6946FF10C5B3E89691A7D3F2C122D2117C cert=TD7PbUO0/0k6xYHMPW3vJxICfkMZNdkRrb63Zhl5j9dW3iRGiCx0A7mPhe5T2EDzQ35+Zw iat-mode=0 +obfs4 193.11.166.194:27015 2D82C2E354D531A68469ADF7F878FA6060C6BACA cert=4TLQPJrTSaDffMK7Nbao6LC7G9OW/NHkUwIdjLSS3KYf0Nv4/nQiiI8dY2TcsQx01NniOg iat-mode=0 meek_lite 0.0.2.0:2 97700DFE9F483596DDA6264C4D7DF7641E1E39CE url=https://meek.azureedge.net/ front=ajax.aspnetcdn.com -snowflake 192.0.2.3:1 2B280B23E1107BB62ABFC40DDCC8824814F80A72 \ No newline at end of file +snowflake 192.0.2.3:1 diff --git a/service-telemetry/build.gradle b/service-telemetry/build.gradle index dc92fde7..aa3ee4a7 100644 --- a/service-telemetry/build.gradle +++ b/service-telemetry/build.gradle @@ -26,6 +26,7 @@ android { kotlinOptions { jvmTarget = '1.8' } + namespace 'org.mozilla.telemetry' } dependencies { diff --git a/service-telemetry/src/main/AndroidManifest.xml b/service-telemetry/src/main/AndroidManifest.xml index 288b897f..0b86e8b2 100644 --- a/service-telemetry/src/main/AndroidManifest.xml +++ b/service-telemetry/src/main/AndroidManifest.xml @@ -2,8 +2,7 @@ - +