diff --git a/app/build.gradle b/app/build.gradle index 79c7c2bc..6220328c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -44,32 +44,31 @@ android { flavorDimensions "abi" productFlavors { - /*arm { - versionCode 156 - versionName "156" + arm { + versionCode 175 + versionName "175" dimension "abi" buildConfigField "String", "VARIANT", "\"arm\"" - }*/ - aarch64 { - versionCode 157 - versionName "157" - dimension "abi" - buildConfigField "String", "VARIANT", "\"aarch64\"" } - /* + aarch64 { + versionCode 176 + versionName "176" + dimension "abi" + buildConfigField "String", "VARIANT", "\"aarch64\"" + } x86 { - versionCode 158 - versionName "158" + versionCode 177 + versionName "177" dimension "abi" buildConfigField "String", "VARIANT", "\"i686\"" } x86_64 { - versionCode 159 - versionName "159" + versionCode 178 + versionName "178" dimension "abi" buildConfigField "String", "VARIANT", "\"x86_64\"" - }*/ + } } @@ -91,7 +90,7 @@ android { universalApk true } } - } + } } configurations.all { @@ -107,27 +106,28 @@ configurations.all { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'com.android.support.constraint:constraint-layout:1.1.3' - implementation "cz.msebera.android:httpclient:4.4.1.2" + implementation 'com.android.support.constraint:constraint-layout:2.0.0-beta2' + implementation 'cz.msebera.android:httpclient:4.5.8' - //x86Implementation "org.mozilla.geckoview:geckoview-x86:67.0.20190521210220" - //x86_64Implementation "org.mozilla.geckoview:geckoview-x86_64:67.0.20190521210220" - //armImplementation "org.mozilla.geckoview:geckoview-armeabi-v7a:67.0.20190521210220" + x86Implementation "org.mozilla.geckoview:geckoview-x86:67.0.20190521210220" + x86_64Implementation "org.mozilla.geckoview:geckoview-x86_64:67.0.20190521210220" + armImplementation "org.mozilla.geckoview:geckoview-armeabi-v7a:67.0.20190521210220" + implementation 'com.google.firebase:firebase-core:17.0.0' aarch64Implementation "org.mozilla.geckoview:geckoview-arm64-v8a:67.0.20190521210220" implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1' implementation 'com.crowdfire.cfalertdialog:cfalertdialog:1.1.0' implementation 'com.github.jehy:Tor-Onion-Proxy-Library:0.0.7' - implementation 'org.slf4j:slf4j-api:1.7.7' - implementation 'org.slf4j:slf4j-android:1.7.7' + implementation 'org.slf4j:slf4j-api:2.0.0-alpha0' + implementation 'org.slf4j:slf4j-android:1.7.26' + implementation 'com.google.android.gms:play-services-ads:18.0.0' implementation 'com.android.support:design:28.0.0' - implementation 'com.google.android.gms:play-services-ads:17.2.1' - implementation 'com.android.support:appcompat-v7:28.1.1' - implementation 'com.android.support:design:28.1.1' implementation('com.crashlytics.sdk.android:crashlytics:2.10.1@aar') { transitive = true; } + implementation 'com.android.support:appcompat-v7:28.0.0' } -apply plugin: 'com.android.application' \ No newline at end of file +apply plugin: 'com.android.application' +apply plugin: 'com.google.gms.google-services' diff --git a/app/google-services.json b/app/google-services.json new file mode 100644 index 00000000..d231eab7 --- /dev/null +++ b/app/google-services.json @@ -0,0 +1,48 @@ +{ + "project_info": { + "project_number": "891955481900", + "firebase_url": "https://genesis-app-a512d.firebaseio.com", + "project_id": "genesis-app-a512d", + "storage_bucket": "genesis-app-a512d.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:891955481900:android:360c1798435c303f", + "android_client_info": { + "package_name": "com.darkweb.genesissearchengine" + } + }, + "oauth_client": [ + { + "client_id": "891955481900-20ves4hv1nujrthcs2u75to1gn6c3v59.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "com.darkweb.genesissearchengine", + "certificate_hash": "fc03dc31bd3710e568f8a20d1818adc49af8d139" + } + }, + { + "client_id": "891955481900-94h8etf05qautcg9ue2vfc4ct2oikr3e.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyCwvxQTaK8F6nevbWkL2t1TTEljQNZeKXc" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "891955481900-94h8etf05qautcg9ue2vfc4ct2oikr3e.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/applicationViewController.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/applicationViewController.java index 2aef774a..4950104d 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/applicationViewController.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/applicationViewController.java @@ -1,10 +1,11 @@ package com.darkweb.genesissearchengine.appManager; +import android.annotation.SuppressLint; import android.graphics.Color; import android.graphics.drawable.Drawable; import android.os.Handler; -import android.support.constraint.ConstraintLayout; -import android.support.design.widget.FloatingActionButton; +import android.os.Looper; +import android.os.Message; import android.text.SpannableString; import android.text.Spanned; import android.text.style.ForegroundColorSpan; @@ -15,15 +16,21 @@ import android.webkit.WebView; import android.widget.EditText; import android.widget.ImageView; import android.widget.ProgressBar; +import android.widget.TextView; +import androidx.constraintlayout.widget.ConstraintLayout; import com.darkweb.genesissearchengine.constants.constants; +import com.darkweb.genesissearchengine.constants.keys; +import com.darkweb.genesissearchengine.constants.messages; import com.darkweb.genesissearchengine.constants.status; import com.darkweb.genesissearchengine.dataManager.preference_manager; import com.darkweb.genesissearchengine.helperMethod; import com.darkweb.genesissearchengine.httpManager.serverRequestManager; import com.darkweb.genesissearchengine.pluginManager.message_manager; +import com.darkweb.genesissearchengine.pluginManager.orbot_manager; import com.example.myapplication.R; +import com.google.android.material.floatingactionbutton.FloatingActionButton; -import static java.lang.Thread.sleep; +import java.util.ArrayList; public class applicationViewController { @@ -36,7 +43,12 @@ public class applicationViewController private FloatingActionButton floatingButton; private ImageView loading; private ImageView splashlogo; + private TextView loadingText; + + /*Private Variables*/ private boolean pageLoadedSuccessfully = true; + private boolean isSplashLoading = false; + private Handler updateUIHandler = null; /*ProgressBar Delayed Updater*/ Handler progressBarHandler = null; @@ -53,7 +65,7 @@ public class applicationViewController { } - public void initialization(WebView webView1, ProgressBar progressBar, EditText searchbar, ConstraintLayout splashScreen, ConstraintLayout requestFailure, FloatingActionButton floatingButton, ImageView loading, ImageView splashlogo) + public void initialization(WebView webView1, TextView loadingText, ProgressBar progressBar, EditText searchbar, ConstraintLayout splashScreen, ConstraintLayout requestFailure, FloatingActionButton floatingButton, ImageView loading, ImageView splashlogo) { this.webView = webView1; this.progressBar = progressBar; @@ -63,12 +75,14 @@ public class applicationViewController this.floatingButton = floatingButton; this.loading = loading; this.splashlogo = splashlogo; + this.loadingText = loadingText; app_model.getInstance().getAppInstance().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); checkSSLTextColor(); initSplashScreen(); initLock(); initViews(); + createUpdateUiHandler(); } public boolean isHiddenView() @@ -107,19 +121,85 @@ public class applicationViewController /*Helper Methods*/ public void onInternetError() { - splashScreen.animate().setStartDelay(2000).alpha(0); + disableSplashScreen(); requestFailure.setVisibility(View.VISIBLE); webView.setAlpha(0); requestFailure.animate().alpha(1f).setDuration(150); pageLoadedSuccessfully = false; - Log.i("jhgjhg",0+""); onClearSearchBarCursor(); onProgressBarUpdate(0); + disableFloatingView(); } - public void onDisableInternetError() + public void disableSplashScreen() { - requestFailure.animate().alpha(0f).setDuration(150).withEndAction((() -> requestFailure.setVisibility(View.INVISIBLE)));; + if(!isSplashLoading) + { + isSplashLoading = true; + new Thread() + { + public void run() + { + try + { + boolean isFirstInstall = preference_manager.getInstance().getBool(keys.hasOrbotInstalled,true); + while (!status.isTorInitialized && isFirstInstall) + { + startPostTask(messages.UPDATE_LOADING_TEXT); + sleep(100); + } + preference_manager.getInstance().setBool(keys.hasOrbotInstalled,false); + startPostTask(messages.DISABLE_SPLASH_SCREEN); + } + catch (Exception ex) + { + Log.i("Fizza",ex.getMessage()); + } + } + }.start(); + } + } + + public void startPostTask(int m_id) + { + Message message = new Message(); + message.what = m_id; + updateUIHandler.sendMessage(message); + } + + @SuppressLint("HandlerLeak") + private void createUpdateUiHandler() + { + updateUIHandler = new Handler() + { + @Override + public void handleMessage(Message msg) + { + if(msg.what == messages.UPDATE_LOADING_TEXT) + { + loadingText.setText(orbot_manager.getInstance().getLogs()); + } + if(msg.what == messages.DISABLE_SPLASH_SCREEN) + { + status.isApplicationLoaded = true; + splashScreen.animate().alpha(0.0f).setDuration(200).setListener(null).withEndAction((() -> splashScreen.setVisibility(View.GONE))); + onWelcomeMessageCheck(); + } + } + }; + } + + public boolean onDisableInternetError() + { + if(requestFailure.getAlpha()==1) + { + requestFailure.animate().alpha(0f).setDuration(150).withEndAction((() -> requestFailure.setVisibility(View.INVISIBLE)));; + return true; + } + else + { + return false; + } } public void onPageFinished(boolean status) @@ -135,9 +215,8 @@ public class applicationViewController onUpdateView(true); } //onUpdateSearchBar(webView.getUrl()); - splashScreen.animate().alpha(0.0f).setStartDelay(150).setDuration(200).setListener(null).withEndAction((() -> splashScreen.setVisibility(View.GONE))); + disableSplashScreen(); floatingButton.animate().alpha(0).withEndAction((() -> floatingButton.setVisibility(View.GONE)));; - onWelcomeMessageCheck(); app_model.getInstance().getAppInstance().stopHiddenView(); } @@ -252,14 +331,11 @@ public class applicationViewController public void onWelcomeMessageCheck() { - if(!status.isApplicationLoaded) + if(!preference_manager.getInstance().getBool("FirstTimeLoaded",false)) { - if(!preference_manager.getInstance().getBool("FirstTimeLoaded",false)) - { - message_manager.getInstance().welcomeMessage(); - } - serverRequestManager.getInstance().versionChecker(); + message_manager.getInstance().welcomeMessage(); } + serverRequestManager.getInstance().versionChecker(); } public void onReload() diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/application_controller.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/application_controller.java index 123fa483..f27468f2 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/application_controller.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/application_controller.java @@ -1,22 +1,19 @@ package com.darkweb.genesissearchengine.appManager; -import android.content.Intent; -import android.graphics.Color; import android.os.Build; -import android.support.constraint.ConstraintLayout; import android.os.Bundle; -import android.support.design.widget.FloatingActionButton; -import android.support.v7.app.AppCompatActivity; -import android.util.Log; import android.view.*; import android.webkit.*; import android.widget.*; +import androidx.appcompat.app.AppCompatActivity; +import androidx.constraintlayout.widget.ConstraintLayout; import com.darkweb.genesissearchengine.*; import com.darkweb.genesissearchengine.constants.constants; import com.darkweb.genesissearchengine.dataManager.preference_manager; import com.darkweb.genesissearchengine.pluginManager.*; import com.example.myapplication.R; +import com.google.android.material.floatingactionbutton.FloatingActionButton; import org.mozilla.geckoview.GeckoView; @@ -34,6 +31,7 @@ public class application_controller extends AppCompatActivity private FloatingActionButton floatingButton; private ImageView loadingIcon; private ImageView splashlogo; + private TextView loadingText; /*Redirection Objects*/ private geckoClients geckoclient = null; @@ -58,7 +56,8 @@ public class application_controller extends AppCompatActivity preference_manager.getInstance().initialize(); orbot_manager.getInstance().reinitOrbot(); admanager.getInstance().initialize(); - applicationViewController.getInstance().initialization(webView,progressBar,searchbar,splashScreen,requestFailure,floatingButton, loadingIcon,splashlogo); + applicationViewController.getInstance().initialization(webView,loadingText,progressBar,searchbar,splashScreen,requestFailure,floatingButton, loadingIcon,splashlogo); + firebase.getInstance().initialize(); geckoclient.initialize(geckoView); startApplication(); @@ -96,6 +95,7 @@ public class application_controller extends AppCompatActivity loadingIcon = findViewById(R.id.imageView_loading_back); splashlogo = findViewById(R.id.backsplash); geckoView = findViewById(R.id.webLoader); + loadingText = findViewById(R.id.loadingText); webviewclient = new webviewClient(); geckoclient = new geckoClients(); @@ -116,6 +116,7 @@ public class application_controller extends AppCompatActivity public void setWebViewSettings(WebView view) { view.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK); + view.getSettings().setJavaScriptEnabled(true); view.getSettings().setUseWideViewPort(true); } @@ -186,9 +187,9 @@ public class application_controller extends AppCompatActivity applicationViewController.getInstance().disableFloatingView(); } - public void onDisableInternetError() + public boolean onDisableInternetError() { - applicationViewController.getInstance().onDisableInternetError(); + return applicationViewController.getInstance().onDisableInternetError(); } public void onProgressBarUpdateView(int progress) diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/geckoClients.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/geckoClients.java index b3458176..69dddd96 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/geckoClients.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/geckoClients.java @@ -1,16 +1,17 @@ package com.darkweb.genesissearchengine.appManager; -import android.graphics.drawable.Drawable; import android.os.Handler; import android.util.Log; import android.view.View; -import com.darkweb.genesissearchengine.helperMethod; +import com.darkweb.genesissearchengine.pluginManager.admanager; import com.darkweb.genesissearchengine.pluginManager.fabricManager; import com.darkweb.genesissearchengine.pluginManager.orbot_manager; import org.mozilla.geckoview.GeckoRuntime; import org.mozilla.geckoview.GeckoSession; import org.mozilla.geckoview.GeckoView; +import java.util.ArrayList; + public class geckoClients { private GeckoSession session1 = null; @@ -21,20 +22,26 @@ public class geckoClients boolean isRunning = false; boolean isContentLoading = false; String navigatedURL = ""; + boolean isFirstTimeLoad = true; + ArrayList urlList = new ArrayList<>(); private boolean loadingCompeleted = false; private String currentURL = ""; + private boolean wasBackPressed = false; public void loadGeckoURL(String url,GeckoView geckoView) { boolean init_status = orbot_manager.getInstance().initOrbot(url); if (init_status) { + urlList.clear(); + navigatedURL = ""; loadingCompeleted = false; initialize(geckoView); session1.loadUri(url); app_model.getInstance().getAppInstance().onRequestTriggered(true,url); app_model.getInstance().getAppInstance().onProgressBarUpdateView(4); + isFirstTimeLoad = true; } } @@ -57,7 +64,6 @@ public class geckoClients public void onLocationChange(GeckoSession session, String url) { navigatedURL = url; - Log.i("SHITJ1",""+url); } @Override @@ -72,11 +78,13 @@ public class geckoClients @Override public void onPageStart(GeckoSession session, String url) { + wasBackPressed = false; isRunning = true; loadingCompeleted = false; currentURL = url; fabricManager.getInstance().sendEvent("ONION GECKO_CLIENT URL REQEST : " + url + "--"); + app_model.getInstance().getAppInstance().onUpdateSearchBarView(url); if(navigatedURL.equals(currentURL)) { isContentLoading = false; @@ -103,14 +111,31 @@ public class geckoClients { if(!success && !isContentLoading) { + app_model.getInstance().getAppInstance().onPageFinished(true); app_model.getInstance().getAppInstance().onInternetErrorView(); fabricManager.getInstance().sendEvent("ONION GECKO_CLIENT URL ERROR : " + success + "--" + isContentLoading); } else if(success) { + if(isFirstTimeLoad) + { + admanager.getInstance().showAd(true); + isFirstTimeLoad = false; + } + + if((urlList.size()==0 || urlList.size()>0 && !urlList.get(urlList.size()-1).equals(navigatedURL))&&!wasBackPressed) + { + urlList.add(navigatedURL); + } + + if(urlList.size()>0) + { + admanager.getInstance().showAd(false); + } app_model.getInstance().getAppInstance().onDisableInternetError(); app_model.getInstance().getAppInstance().onProgressBarUpdateView(0); fabricManager.getInstance().sendEvent("ONION GECKO_CLIENT URL SUCCESS : " + success + "--" + isContentLoading); + app_model.getInstance().getAppInstance().onPageFinished(true); } } } @@ -124,7 +149,6 @@ public class geckoClients { if(progress>=100) { - app_model.getInstance().getAppInstance().onPageFinished(true); loadingCompeleted = true; isContentLoading = false; } @@ -148,23 +172,26 @@ public class geckoClients public void onHiddenGoBack(GeckoView geckoView) { - boolean init_status = orbot_manager.getInstance().initOrbot(""); - if (init_status) - { - if(canSessionGoBack) + if(urlList.size()>1) { - app_model.getInstance().getAppInstance().onDisableInternetError(); - session1.goBack(); - fabricManager.getInstance().sendEvent("ONION LOCAL RETURNED : "); + urlList.remove(urlList.size() - 1); + wasBackPressed = true; + session1.stop(); + session1.loadUri(urlList.get(urlList.size() - 1)); + app_model.getInstance().getAppInstance().onUpdateSearchBarView(urlList.get(urlList.size()-1)); } else if(isRunning) { - fabricManager.getInstance().sendEvent("ONION RETURNED TO GENESIS : "); - geckoView.releaseSession(); - stopHiddenView(geckoView); - app_model.getInstance().getAppInstance().onUpdateView(true); + if(urlList.size()>0) + { + urlList.remove(urlList.size()-1); + } + stopHiddenView(geckoView); + app_model.getInstance().getAppInstance().onUpdateView(true); + app_model.getInstance().getAppInstance().onDisableInternetError(); } - } + + } public void stopHiddenView(GeckoView geckoView) @@ -173,9 +200,13 @@ public class geckoClients { isRunning = false; loadingCompeleted = false; + session1.stop(); session1.close(); } + + geckoView.releaseSession(); + } public boolean isGeckoViewRunning() @@ -185,15 +216,8 @@ public class geckoClients public void onReloadHiddenView() { - boolean init_status = orbot_manager.getInstance().initOrbot(""); - if (init_status) - { - if(session1!=null) - { - loadingCompeleted = false; - session1.stop(); - session1.reload(); - } - } + wasBackPressed = true; + session1.stop(); + session1.loadUri(navigatedURL); } } diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/webviewClient.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/webviewClient.java index 6ecba436..14641e4c 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/webviewClient.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/webviewClient.java @@ -27,6 +27,7 @@ public class webviewClient } if(!url.contains("boogle")) { + app_model.getInstance().getAppInstance().stopHiddenView(); fabricManager.getInstance().sendEvent("BASE SIMPLE SEARCHED : " + url); isGeckoView = true; if(orbot_manager.getInstance().initOrbot(url)) diff --git a/app/src/main/java/com/darkweb/genesissearchengine/constants/keys.java b/app/src/main/java/com/darkweb/genesissearchengine/constants/keys.java index 9a386195..ba42f3a3 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/constants/keys.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/constants/keys.java @@ -19,5 +19,6 @@ public class keys public static String proxy_useragent_override = "general.useragent.override"; public static String proxy_donottrackheader_enabled = "privacy.donottrackheader.enabled"; public static String proxy_donottrackheader_value = "privacy.donottrackheader.value"; + public static String hasOrbotInstalled = "hasOrbotInstalled"; } diff --git a/app/src/main/java/com/darkweb/genesissearchengine/constants/messages.java b/app/src/main/java/com/darkweb/genesissearchengine/constants/messages.java index 578f93b4..a3df77fe 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/constants/messages.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/constants/messages.java @@ -3,8 +3,10 @@ package com.darkweb.genesissearchengine.constants; public class messages { /*Post Messages*/ - public final static int LOCAL_HOMEPAGE_CACHED =3; + public final static int LOCAL_HOMEPAGE_CACHED =0; public final static int INTERNET_ERROR =2; public final static int MESSAGE_UPDATE_TEXT_CHILD_THREAD =1; public final static int LOAD_WEBVIEW_BACKGROUND = 2; + public final static int DISABLE_SPLASH_SCREEN =3; + public final static int UPDATE_LOADING_TEXT =5; } diff --git a/app/src/main/java/com/darkweb/genesissearchengine/constants/status.java b/app/src/main/java/com/darkweb/genesissearchengine/constants/status.java index 24558af9..3ebb6bbe 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/constants/status.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/constants/status.java @@ -3,7 +3,7 @@ package com.darkweb.genesissearchengine.constants; public class status { public static boolean isApplicationLoaded = false; - public static boolean isPlayStoreInstalled = false; + public static boolean isPlayStoreInstalled = true; public static boolean isTorInitialized = false; public static String version_code = "5.0"; diff --git a/app/src/main/java/com/darkweb/genesissearchengine/dataManager/preference_manager.java b/app/src/main/java/com/darkweb/genesissearchengine/dataManager/preference_manager.java index a5f97dcf..92c1dcbf 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/dataManager/preference_manager.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/dataManager/preference_manager.java @@ -28,13 +28,13 @@ public class preference_manager } /*Saving Preferences*/ - public void saveString(String valueKey, String value) + public void setString(String valueKey, String value) { edit.putString(valueKey, value); edit.commit(); } - public void saveBool(String valueKey, boolean value) + public void setBool(String valueKey, boolean value) { edit.putBoolean(valueKey, value); edit.commit(); @@ -50,4 +50,5 @@ public class preference_manager { return prefs.getBoolean(valueKey, valueDefault); } + } diff --git a/app/src/main/java/com/darkweb/genesissearchengine/httpManager/serverRequestManager.java b/app/src/main/java/com/darkweb/genesissearchengine/httpManager/serverRequestManager.java index 64fd1368..2f6b9933 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/httpManager/serverRequestManager.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/httpManager/serverRequestManager.java @@ -61,7 +61,7 @@ public class serverRequestManager sb.append(charArray, 0, numCharsRead); } String result = sb.toString(); - preference_manager.getInstance().saveString("version",result); + preference_manager.getInstance().setString("version",result); } catch (IOException e) { diff --git a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/admanager.java b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/admanager.java index 7e67ef1b..530ef3d0 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/admanager.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/admanager.java @@ -24,21 +24,22 @@ public class admanager public void initialize() { - MobileAds.initialize(app_model.getInstance().getAppContext(), "ca-app-pub-5074525529134731~2926711128 "); + /* + MobileAds.initialize(app_model.getInstance().getAppContext(), "ca-app-pub-5074525529134731~2926711128"); mInterstitialAd = new InterstitialAd(app_model.getInstance().getAppContext()); mInterstitialAd.setAdUnitId("ca-app-pub-5074525529134731/8478420705"); - mInterstitialAd.loadAd(new AdRequest.Builder().build()); + mInterstitialAd.loadAd(new AdRequest.Builder().build());*/ } /*Helper Methods*/ public void showAd(boolean isAdForced) { - + /* if(!mInterstitialAd.isLoading() && !mInterstitialAd.isLoaded()) { mInterstitialAd.loadAd(new AdRequest.Builder().build()); - if(isAdForced || adCount==0 || adCount%3==0) + if(isAdForced || adCount==0 || adCount%5==0) { adCount = 0; } @@ -65,6 +66,6 @@ public class admanager adCount += 1; } } - } + }*/ } } diff --git a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/analyticmanager.java b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/analyticmanager.java index b5b3fbe8..7298bcf3 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/analyticmanager.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/analyticmanager.java @@ -52,8 +52,8 @@ public class analyticmanager public void sendEvent(String value) { - Answers.getInstance().logCustom(new CustomEvent(value) - .putCustomAttribute(analyticmanager.getInstance().uniqueID,value)); + firebase.getInstance().logEvent(value,uniqueID); + Answers.getInstance().logCustom(new CustomEvent(value)); } diff --git a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/firebase.java b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/firebase.java new file mode 100644 index 00000000..e68c9a11 --- /dev/null +++ b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/firebase.java @@ -0,0 +1,35 @@ +package com.darkweb.genesissearchengine.pluginManager; + +import android.os.Bundle; +import com.darkweb.genesissearchengine.appManager.app_model; +import com.google.firebase.analytics.FirebaseAnalytics; + +public class firebase +{ + private static final firebase ourInstance = new firebase(); + + public static firebase getInstance() + { + return ourInstance; + } + + private FirebaseAnalytics mFirebaseAnalytics; + + public void initialize() + { + mFirebaseAnalytics = FirebaseAnalytics.getInstance(app_model.getInstance().getAppContext()); + } + + public void logEvent(String value,String id) + { + Bundle bundle = new Bundle(); + bundle.putString(FirebaseAnalytics.Param.ITEM_ID, id); + bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, value); + bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "Custom"); + mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle); + } + + private firebase() + { + } +} diff --git a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/message_manager.java b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/message_manager.java index 2a9dd8f9..99221eba 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/message_manager.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/message_manager.java @@ -12,7 +12,6 @@ import com.darkweb.genesissearchengine.constants.constants; import com.darkweb.genesissearchengine.constants.keys; import com.darkweb.genesissearchengine.constants.strings; import com.darkweb.genesissearchengine.dataManager.preference_manager; -import com.darkweb.genesissearchengine.httpManager.serverRequestManager; import com.example.myapplication.R; public class message_manager @@ -65,7 +64,7 @@ public class message_manager }) .addButton(strings.welcome_message_bt5, -1, -1, CFAlertDialog.CFAlertActionStyle.NEGATIVE, CFAlertDialog.CFAlertActionAlignment.JUSTIFIED , (dialog, which) -> { dialog.dismiss(); - preference_manager.getInstance().saveBool(keys.first_time_loaded,true); + preference_manager.getInstance().setBool(keys.first_time_loaded,true); }); builder.show(); diff --git a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/orbot_manager.java b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/orbot_manager.java index 13318090..059907db 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/orbot_manager.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/orbot_manager.java @@ -17,7 +17,7 @@ public class orbot_manager { /*Private Variables*/ private boolean isLoading = false; - + private int threadCounter = 100; /*Local Initialization*/ private static final orbot_manager ourInstance = new orbot_manager(); private OnionProxyManager onionProxyManager = null; @@ -36,6 +36,7 @@ public class orbot_manager { { if(!status.isTorInitialized) { + fabricManager.getInstance().sendEvent("TOR NOT INITIALIZED : " + url); message_manager.getInstance().startingOrbotInfo(url); return false; } @@ -51,31 +52,58 @@ public class orbot_manager { { public void run() { - try + while (true) { - while (true) + try { - if(!isLoading && (onionProxyManager == null || !onionProxyManager.isRunning())) + if(onionProxyManager!=null) { - if(onionProxyManager != null) + if(onionProxyManager.isRunning()) { - onionProxyManager.stop(); + status.isTorInitialized = true; + threadCounter = 5000; + } + } + if(!isLoading && !status.isTorInitialized) + { + if(onionProxyManager == null) + { + onionProxyManager = new AndroidOnionProxyManager(app_model.getInstance().getAppContext(), strings.torfolder); } isLoading = false; status.isTorInitialized = false; initializeTorClient(); } - sleep(1000); + else + { + sleep(threadCounter); + } + } + catch (Exception e) + { + e.printStackTrace(); } } - catch (Exception e) - { - e.printStackTrace(); - } + } }.start(); } + public String getLogs() + { + if(onionProxyManager!=null) + { + String Logs = onionProxyManager.getLastLog(); + if(Logs.equals("")) + { + return "Loading Please Wait"; + } + Logs=Logs.replace("FAILED","Securing"); + return Logs; + } + return "Loading Please Wait"; + } + public void initializeTorClient() { if(!isLoading) @@ -89,14 +117,6 @@ public class orbot_manager { try { isLoading = true; - String fileStorageLocation = strings.torfolder; - - if(onionProxyManager!=null && onionProxyManager.isRunning()) - { - break; - } - - onionProxyManager = new AndroidOnionProxyManager(app_model.getInstance().getAppContext(), fileStorageLocation); int totalSecondsPerTorStartup = 4 * 60; int totalTriesPerTorStartup = 5; @@ -108,14 +128,12 @@ public class orbot_manager { continue; } - if (onionProxyManager.isRunning()) { - app_model.getInstance().setPort(onionProxyManager.getIPv4LocalHostSocksPort()); - initializeProxy(); - //sleep(1500); - status.isTorInitialized = true; - isLoading = false; - break; - } + app_model.getInstance().setPort(onionProxyManager.getIPv4LocalHostSocksPort()); + initializeProxy(); + status.isTorInitialized = true; + isLoading = false; + break; + } catch (Exception ex) { ex.printStackTrace(); continue; diff --git a/app/src/main/res/layout/application_view.xml b/app/src/main/res/layout/application_view.xml index b120f471..dca8ec38 100644 --- a/app/src/main/res/layout/application_view.xml +++ b/app/src/main/res/layout/application_view.xml @@ -1,5 +1,5 @@ - - - + + - + - + - - \ No newline at end of file + \ No newline at end of file diff --git a/build.gradle b/build.gradle index 8cb98ce3..9593d40b 100644 --- a/build.gradle +++ b/build.gradle @@ -9,6 +9,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:3.4.1' classpath 'io.fabric.tools:gradle:1.29.0' + classpath 'com.google.gms:google-services:4.2.0' } } diff --git a/gradle.properties b/gradle.properties index 85be9ead..4a5855f4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,3 +13,5 @@ org.gradle.jvmargs=-Xmx1536m # org.gradle.parallel=true # Kotlin code style for this project: "official" or "obsolete": kotlin.code.style=official +android.useAndroidX=true +android.enableJetifier=true \ No newline at end of file diff --git a/tor-android-binary-0.3.4.9/build.gradle b/tor-android-binary-0.3.4.9/build.gradle deleted file mode 100644 index b1834eb7..00000000 --- a/tor-android-binary-0.3.4.9/build.gradle +++ /dev/null @@ -1,2 +0,0 @@ -configurations.maybeCreate("default") -artifacts.add("default", file('tor-android-binary-0.3.4.9.aar')) \ No newline at end of file diff --git a/tor-android-binary-0.3.4.9/tor-android-binary-0.3.4.9.aar b/tor-android-binary-0.3.4.9/tor-android-binary-0.3.4.9.aar deleted file mode 100644 index bf99792e..00000000 Binary files a/tor-android-binary-0.3.4.9/tor-android-binary-0.3.4.9.aar and /dev/null differ