diff --git a/app/build.gradle b/app/build.gradle index c5807d2a..87f5e40d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,11 +9,11 @@ ext { android { compileSdkVersion 28 defaultConfig { - applicationId "com.example.myapplication" + applicationId "com.darkweb.genesissearchengine" minSdkVersion 21 targetSdkVersion 28 - versionCode 1 - versionName "1.0" + versionCode 61 + versionName "61.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 976ef8b3..70e67f1e 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ + xmlns:tools="http://schemas.android.com/tools" package="com.example.myapplication"> @@ -13,11 +13,11 @@ android:supportsRtl="true" android:theme="@style/AppTheme" android:networkSecurityConfig="@xml/network_security_config" - android:usesCleartextTraffic="true"> + android:usesCleartextTraffic="true" tools:ignore="GoogleAppIndexingWarning"> - diff --git a/app/src/main/java/com/darkweb/genesissearchengine/KeyboardUtils.java b/app/src/main/java/com/darkweb/genesissearchengine/KeyboardUtils.java index 98e8c95d..a61d2888 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/KeyboardUtils.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/KeyboardUtils.java @@ -1,4 +1,4 @@ -package com.example.myapplication; +package com.darkweb.genesissearchengine; import android.app.Activity; import android.content.Context; diff --git a/app/src/main/java/com/darkweb/genesissearchengine/admanager.java b/app/src/main/java/com/darkweb/genesissearchengine/admanager.java index d2ef56e8..2c374e8e 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/admanager.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/admanager.java @@ -1,4 +1,4 @@ -package com.example.myapplication; +package com.darkweb.genesissearchengine; import android.content.Context; import com.google.android.gms.ads.AdListener; diff --git a/app/src/main/java/com/darkweb/genesissearchengine/application_controller.java b/app/src/main/java/com/darkweb/genesissearchengine/application_controller.java index 63af3a0f..bb9b1fd2 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/application_controller.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/application_controller.java @@ -1,5 +1,6 @@ -package com.example.myapplication; +package com.darkweb.genesissearchengine; +import android.app.Application; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; @@ -22,6 +23,7 @@ import java.net.MalformedURLException; import java.net.URL; import java.util.Stack; +import com.example.myapplication.R; import info.guardianproject.netcipher.proxy.OrbotHelper; import org.mozilla.gecko.PrefsHelper; import org.mozilla.geckoview.GeckoRuntime; @@ -47,7 +49,7 @@ public class application_controller extends AppCompatActivity private LinearLayout topbar; private GeckoSession session1; private GeckoRuntime runtime1; - private String version_code = "1.0"; + private String version_code = "3.0"; private boolean wasBackPressed = false; private boolean isLoadedUrlSet = false; private boolean isOnnionUrlHalted = false; @@ -147,12 +149,26 @@ public class application_controller extends AppCompatActivity webView1.bringToFront(); progressBar.animate().setDuration(150).alpha(0f); - session1 = new GeckoSession(); - runtime1 = GeckoRuntime.create(this); - session1.open(runtime1); - webLoader.setSession(session1); - session1.setProgressDelegate(new progressDelegate()); - webLoader.setVisibility(View.INVISIBLE); + new Thread() + { + public void run() + { + try + { + session1 = new GeckoSession(); + runtime1 = GeckoRuntime.create(application_controller.this); + session1.open(runtime1); + webLoader.setSession(session1); + session1.setProgressDelegate(new progressDelegate()); + webLoader.setVisibility(View.INVISIBLE); + sleep(2000); + } + catch (InterruptedException e) + { + e.printStackTrace(); + } + } + }.start(); } /*Initialization*/ @@ -202,16 +218,15 @@ public class application_controller extends AppCompatActivity return true; } - searchbar.setText(url.replaceAll("boogle.store","genesis.onion")); - KeyboardUtils.hideKeyboard(application_controller.this); - if(!url.toString().contains("boogle")) { - admanager.getInstance().showAd(); - boolean init_status=orbot_manager.getInstance().reinitOrbot(application_controller.this); - if(!init_status) + if(init_status) { + searchbar.setText(url.replaceAll("boogle.store","genesis.onion")); + KeyboardUtils.hideKeyboard(application_controller.this); + admanager.getInstance().showAd(); + progressBar.setAlpha(0); progressBar.setVisibility(View.VISIBLE); progressBar.animate().setDuration(150).setDuration(300).alpha(1f); @@ -231,11 +246,17 @@ public class application_controller extends AppCompatActivity } else { + searchbar.setText(url.replaceAll("boogle.store","genesis.onion")); + KeyboardUtils.hideKeyboard(application_controller.this); if(traceUrlList.size()==0 || !status.currentURL.equals(traceUrlList.peek())) { traceUrlList.add(status.currentURL); status.currentURL = url; } + if(url.contains("?")) + { + url = url+"&savesearch=on"; + } loadURLAnimate(url); return true; } @@ -319,6 +340,13 @@ class progressDelegate implements GeckoSession.ProgressDelegate @Override public void onPageStart(GeckoSession session, String url) { + if(!orbot_manager.getInstance().reinitOrbot(application_controller.this)) + { + session1.stop(); + session1.close(); + return; + } + if(isOnnionUrlHalted) { return; @@ -450,7 +478,6 @@ class progressDelegate implements GeckoSession.ProgressDelegate public void onBackPressed() { session1.stop(); - orbot_manager.getInstance().reinitOrbot(this); if(traceUrlList.size()>0) { searchbar.setText(traceUrlList.peek().toString().replaceAll("boogle.store","genesis.onion")); diff --git a/app/src/main/java/com/darkweb/genesissearchengine/constants.java b/app/src/main/java/com/darkweb/genesissearchengine/constants.java index e4d8de44..4a1e28be 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/constants.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/constants.java @@ -1,4 +1,4 @@ -package com.example.myapplication; +package com.darkweb.genesissearchengine; public class constants { diff --git a/app/src/main/java/com/darkweb/genesissearchengine/datamodel.java b/app/src/main/java/com/darkweb/genesissearchengine/datamodel.java index caf77b39..69921872 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/datamodel.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/datamodel.java @@ -1,4 +1,4 @@ -package com.example.myapplication; +package com.darkweb.genesissearchengine; public class datamodel { diff --git a/app/src/main/java/com/darkweb/genesissearchengine/helperMethod.java b/app/src/main/java/com/darkweb/genesissearchengine/helperMethod.java index db8ee21c..7e862a61 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/helperMethod.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/helperMethod.java @@ -1,4 +1,4 @@ -package com.example.myapplication; +package com.darkweb.genesissearchengine; import android.content.Context; import android.net.ConnectivityManager; diff --git a/app/src/main/java/com/darkweb/genesissearchengine/message_manager.java b/app/src/main/java/com/darkweb/genesissearchengine/message_manager.java index 962a9b8c..0540c43d 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/message_manager.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/message_manager.java @@ -1,9 +1,10 @@ -package com.example.myapplication; +package com.darkweb.genesissearchengine; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.view.View; +import com.example.myapplication.R; import com.yarolegovich.lovelydialog.LovelyInfoDialog; import com.yarolegovich.lovelydialog.LovelyStandardDialog; diff --git a/app/src/main/java/com/darkweb/genesissearchengine/orbot_manager.java b/app/src/main/java/com/darkweb/genesissearchengine/orbot_manager.java index f5406e67..c7667399 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/orbot_manager.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/orbot_manager.java @@ -1,4 +1,4 @@ -package com.example.myapplication; +package com.darkweb.genesissearchengine; import android.content.BroadcastReceiver; import android.content.Context; @@ -6,6 +6,7 @@ import android.content.Intent; import android.net.Uri; import android.text.TextUtils; import android.view.View; +import com.example.myapplication.R; import com.yarolegovich.lovelydialog.LovelyStandardDialog; import info.guardianproject.netcipher.proxy.OrbotHelper; @@ -67,15 +68,15 @@ public class orbot_manager { }) .setNegativeButton(android.R.string.no, null) .show(); - return true; + return false; } if(!isOrbotRunning) { OrbotHelper.get(application_context).init(); message_manager.getInstance().startingOrbotInfo(application_context); - return true; + return false; } - return false; + return true; } } diff --git a/app/src/main/java/com/darkweb/genesissearchengine/preference_manager.java b/app/src/main/java/com/darkweb/genesissearchengine/preference_manager.java index 48d2a85c..1298c43e 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/preference_manager.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/preference_manager.java @@ -1,4 +1,4 @@ -package com.example.myapplication; +package com.darkweb.genesissearchengine; import android.content.Context; import android.content.SharedPreferences; diff --git a/app/src/main/java/com/darkweb/genesissearchengine/status.java b/app/src/main/java/com/darkweb/genesissearchengine/status.java index 919f7388..3a14a5e1 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/status.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/status.java @@ -1,4 +1,4 @@ -package com.example.myapplication; +package com.darkweb.genesissearchengine; public class status { diff --git a/app/src/main/java/com/darkweb/genesissearchengine/webRequestHandler.java b/app/src/main/java/com/darkweb/genesissearchengine/webRequestHandler.java index 40ac0ac3..b13af2d1 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/webRequestHandler.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/webRequestHandler.java @@ -1,4 +1,4 @@ -package com.example.myapplication; +package com.darkweb.genesissearchengine; import android.annotation.SuppressLint; import android.content.Context; diff --git a/app/src/main/res/layout-v26/application_view.xml b/app/src/main/res/layout-v26/application_view.xml new file mode 100644 index 00000000..60d09d22 --- /dev/null +++ b/app/src/main/res/layout-v26/application_view.xml @@ -0,0 +1,217 @@ + + + + + + + + + + + + + + + +