mirror of https://github.com/LeOS-GSI/LeOS-Genesis
build update
parent
819a129fa4
commit
358f318111
|
@ -71,7 +71,6 @@ android {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
||||||
/*Default Libraries*/
|
/*Default Libraries*/
|
||||||
|
|
|
@ -12,19 +12,23 @@ import static android.content.Context.MODE_PRIVATE;
|
||||||
|
|
||||||
public class database_controller
|
public class database_controller
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/*Private Variables*/
|
||||||
|
|
||||||
private static final database_controller ourInstance = new database_controller();
|
private static final database_controller ourInstance = new database_controller();
|
||||||
|
private SQLiteDatabase database_instance;
|
||||||
|
|
||||||
public static database_controller getInstance()
|
public static database_controller getInstance()
|
||||||
{
|
{
|
||||||
return ourInstance;
|
return ourInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
private SQLiteDatabase database_instance;
|
|
||||||
|
|
||||||
private database_controller()
|
private database_controller()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*Initializations*/
|
||||||
|
|
||||||
public void initialize()
|
public void initialize()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
@ -41,13 +45,14 @@ public class database_controller
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*Helper Methods*/
|
||||||
|
|
||||||
public void execSQL(String query)
|
public void execSQL(String query)
|
||||||
{
|
{
|
||||||
database_instance.execSQL(query);
|
database_instance.execSQL(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayList<list_row_model> selectHistory()
|
public ArrayList<list_row_model> selectHistory(){
|
||||||
{
|
|
||||||
ArrayList<list_row_model> tempmodel = new ArrayList<>();
|
ArrayList<list_row_model> tempmodel = new ArrayList<>();
|
||||||
Cursor c = database_instance.rawQuery("SELECT * FROM history ORDER BY id DESC ", null);
|
Cursor c = database_instance.rawQuery("SELECT * FROM history ORDER BY id DESC ", null);
|
||||||
if (c.moveToFirst()){
|
if (c.moveToFirst()){
|
||||||
|
@ -61,8 +66,7 @@ public class database_controller
|
||||||
return tempmodel;
|
return tempmodel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayList<list_row_model> selectBookmark()
|
public ArrayList<list_row_model> selectBookmark(){
|
||||||
{
|
|
||||||
ArrayList<list_row_model> tempmodel = new ArrayList<>();
|
ArrayList<list_row_model> tempmodel = new ArrayList<>();
|
||||||
Cursor c = database_instance.rawQuery("SELECT * FROM bookmark ORDER BY id DESC ", null);
|
Cursor c = database_instance.rawQuery("SELECT * FROM bookmark ORDER BY id DESC ", null);
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ import com.darkweb.genesissearchengine.appManager.database_manager.database_cont
|
||||||
import com.darkweb.genesissearchengine.appManager.list_manager.list_controller;
|
import com.darkweb.genesissearchengine.appManager.list_manager.list_controller;
|
||||||
import com.darkweb.genesissearchengine.appManager.list_manager.list_row_model;
|
import com.darkweb.genesissearchengine.appManager.list_manager.list_row_model;
|
||||||
import com.darkweb.genesissearchengine.constants.constants;
|
import com.darkweb.genesissearchengine.constants.constants;
|
||||||
|
import com.darkweb.genesissearchengine.constants.enums;
|
||||||
import com.darkweb.genesissearchengine.constants.status;
|
import com.darkweb.genesissearchengine.constants.status;
|
||||||
import com.darkweb.genesissearchengine.helperMethod;
|
import com.darkweb.genesissearchengine.helperMethod;
|
||||||
|
|
||||||
|
@ -17,6 +18,7 @@ public class app_model
|
||||||
/*Data Objects*/
|
/*Data Objects*/
|
||||||
private ArrayList<list_row_model> history = new ArrayList<list_row_model>();
|
private ArrayList<list_row_model> history = new ArrayList<list_row_model>();
|
||||||
private ArrayList<list_row_model> bookmarks = new ArrayList<list_row_model>();
|
private ArrayList<list_row_model> bookmarks = new ArrayList<list_row_model>();
|
||||||
|
private ArrayList<navigation_model> navigation = new ArrayList<navigation_model>();
|
||||||
private HashSet<String> suggestions = new HashSet<String>();
|
private HashSet<String> suggestions = new HashSet<String>();
|
||||||
private static int port = 9150;
|
private static int port = 9150;
|
||||||
|
|
||||||
|
@ -24,8 +26,7 @@ public class app_model
|
||||||
private application_controller appInstance;
|
private application_controller appInstance;
|
||||||
|
|
||||||
/*Initializations*/
|
/*Initializations*/
|
||||||
public void initialization()
|
public void initialization(){
|
||||||
{
|
|
||||||
database_controller.getInstance().initialize();
|
database_controller.getInstance().initialize();
|
||||||
initializeHistory();
|
initializeHistory();
|
||||||
initializeBookmarks();
|
initializeBookmarks();
|
||||||
|
@ -151,6 +152,14 @@ public class app_model
|
||||||
return new ArrayList<String>(suggestions);
|
return new ArrayList<String>(suggestions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*Navigation*/
|
||||||
|
|
||||||
|
public void addNavigation(String url,enums.navigationType type) {
|
||||||
|
navigation.add(new navigation_model(url,type));
|
||||||
|
}
|
||||||
|
public ArrayList<navigation_model> getNavigation() {
|
||||||
|
return navigation;
|
||||||
|
}
|
||||||
|
|
||||||
/*Helper Method*/
|
/*Helper Method*/
|
||||||
public boolean isUrlRepeatable(String url,String viewUrl){
|
public boolean isUrlRepeatable(String url,String viewUrl){
|
||||||
|
|
|
@ -38,7 +38,7 @@ public class application_controller extends AppCompatActivity
|
||||||
/*Redirection Objects*/
|
/*Redirection Objects*/
|
||||||
private geckoClients geckoclient = null;
|
private geckoClients geckoclient = null;
|
||||||
private webviewClient webviewclient = null;
|
private webviewClient webviewclient = null;
|
||||||
private eventHandler eventhandler = null;
|
private home_ehandler eventhandler = null;
|
||||||
|
|
||||||
/*-------------------------------------------------------INITIALIZATION-------------------------------------------------------*/
|
/*-------------------------------------------------------INITIALIZATION-------------------------------------------------------*/
|
||||||
@Override
|
@Override
|
||||||
|
@ -62,7 +62,7 @@ public class application_controller extends AppCompatActivity
|
||||||
orbot_manager.getInstance().reinitOrbot();
|
orbot_manager.getInstance().reinitOrbot();
|
||||||
viewController.getInstance().initialization(webView,loadingText,progressBar,searchbar,splashScreen,requestFailure,floatingButton, loadingIcon,splashlogo);
|
viewController.getInstance().initialization(webView,loadingText,progressBar,searchbar,splashScreen,requestFailure,floatingButton, loadingIcon,splashlogo);
|
||||||
firebase.getInstance().initialize();
|
firebase.getInstance().initialize();
|
||||||
geckoclient.initialize(geckoView,false);
|
geckoclient.initialize(geckoView);
|
||||||
app_model.getInstance().initialization();
|
app_model.getInstance().initialization();
|
||||||
initBoogle();
|
initBoogle();
|
||||||
}
|
}
|
||||||
|
@ -89,21 +89,43 @@ public class application_controller extends AppCompatActivity
|
||||||
{
|
{
|
||||||
if(status.search_status.equals(enums.searchEngine.Bing.toString()))
|
if(status.search_status.equals(enums.searchEngine.Bing.toString()))
|
||||||
{
|
{
|
||||||
geckoclient.setRootEngine(constants.backendBing);
|
|
||||||
webView.stopLoading();
|
webView.stopLoading();
|
||||||
onloadURL(constants.backendBing,true,false);
|
onloadURL(constants.backendBing,true,false);
|
||||||
|
if(app_model.getInstance().getNavigation().size()!=1)
|
||||||
|
{
|
||||||
|
app_model.getInstance().addNavigation(constants.backendBing,enums.navigationType.onion);
|
||||||
|
}
|
||||||
|
if(app_model.getInstance().getNavigation().size()>0)
|
||||||
|
{
|
||||||
|
app_model.getInstance().getNavigation().set(0,new navigation_model(constants.backendBing,enums.navigationType.onion));
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if(status.search_status.equals(enums.searchEngine.Google.toString()))
|
else if(status.search_status.equals(enums.searchEngine.Google.toString()))
|
||||||
{
|
{
|
||||||
geckoclient.setRootEngine(constants.backendGoogle);
|
|
||||||
webView.stopLoading();
|
webView.stopLoading();
|
||||||
onloadURL(constants.backendGoogle,true,false);
|
onloadURL(constants.backendGoogle,true,false);
|
||||||
|
if(app_model.getInstance().getNavigation().size()!=1)
|
||||||
|
{
|
||||||
|
app_model.getInstance().addNavigation(constants.backendGoogle,enums.navigationType.onion);
|
||||||
|
}
|
||||||
|
if(app_model.getInstance().getNavigation().size()>0)
|
||||||
|
{
|
||||||
|
app_model.getInstance().getNavigation().set(0,new navigation_model(constants.backendGoogle,enums.navigationType.onion));
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
onloadURL(constants.backendGenesis,false,false);
|
onloadURL(constants.backendGenesis,false,false);
|
||||||
|
if(app_model.getInstance().getNavigation().size()!=1)
|
||||||
|
{
|
||||||
|
app_model.getInstance().addNavigation(constants.backendGenesis,enums.navigationType.base);
|
||||||
|
}
|
||||||
|
if(app_model.getInstance().getNavigation().size()>0)
|
||||||
|
{
|
||||||
|
app_model.getInstance().getNavigation().set(0,new navigation_model(constants.backendGenesis,enums.navigationType.base));
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -131,12 +153,12 @@ public class application_controller extends AppCompatActivity
|
||||||
|
|
||||||
webviewclient = new webviewClient();
|
webviewclient = new webviewClient();
|
||||||
geckoclient = new geckoClients();
|
geckoclient = new geckoClients();
|
||||||
eventhandler = new eventHandler();
|
eventhandler = new home_ehandler();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initializeCrashlytics()
|
public void initializeCrashlytics()
|
||||||
{
|
{
|
||||||
//fabricManager.getInstance().init();
|
fabricManager.getInstance().init();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initializeWebView()
|
public void initializeWebView()
|
||||||
|
@ -275,7 +297,7 @@ public class application_controller extends AppCompatActivity
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onReInitGeckoView() {
|
public void onReInitGeckoView() {
|
||||||
geckoclient.initialize(geckoView,true);
|
geckoclient.initialize(geckoView);
|
||||||
if(webView.getVisibility() != View.VISIBLE)
|
if(webView.getVisibility() != View.VISIBLE)
|
||||||
{
|
{
|
||||||
geckoclient.onReloadHiddenView();
|
geckoclient.onReloadHiddenView();
|
||||||
|
@ -287,13 +309,13 @@ public class application_controller extends AppCompatActivity
|
||||||
geckoclient.onHiddenGoBack(geckoView);
|
geckoclient.onHiddenGoBack(geckoView);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getHiddenQueueLength()
|
public void releaseSession()
|
||||||
{
|
{
|
||||||
return geckoclient.getHiddenQueueLength();
|
geckoclient.releaseSession(geckoView);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stopHiddenView(boolean releaseView) {
|
public void stopHiddenView(boolean releaseView,boolean backPressed) {
|
||||||
geckoclient.stopHiddenView(geckoView,releaseView);
|
geckoclient.stopHiddenView(geckoView,releaseView,backPressed);
|
||||||
//geckoclient.removeHistory();
|
//geckoclient.removeHistory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,8 +18,8 @@ import java.util.ArrayList;
|
||||||
class geckoClients
|
class geckoClients
|
||||||
{
|
{
|
||||||
private GeckoSession session1 = null;
|
private GeckoSession session1 = null;
|
||||||
|
private GeckoRuntime runtime1 = null;
|
||||||
private final Handler internetErrorHandler = new Handler();
|
private final Handler internetErrorHandler = new Handler();
|
||||||
private ArrayList<String> urlList = new ArrayList<>();
|
|
||||||
|
|
||||||
private boolean isRunning = false;
|
private boolean isRunning = false;
|
||||||
private boolean isContentLoading = false;
|
private boolean isContentLoading = false;
|
||||||
|
@ -46,24 +46,21 @@ class geckoClients
|
||||||
this.isUrlSavable = isUrlSavable;
|
this.isUrlSavable = isUrlSavable;
|
||||||
navigatedURL = "";
|
navigatedURL = "";
|
||||||
loadingCompeleted = false;
|
loadingCompeleted = false;
|
||||||
initialize(geckoView,false);
|
initialize(geckoView);
|
||||||
session1.loadUri(url);
|
session1.loadUri(url);
|
||||||
app_model.getInstance().getAppInstance().onRequestTriggered(true,url);
|
app_model.getInstance().getAppInstance().onRequestTriggered(true,url);
|
||||||
app_model.getInstance().getAppInstance().onProgressBarUpdateView(4);
|
app_model.getInstance().getAppInstance().onProgressBarUpdateView(4);
|
||||||
isFirstTimeLoad = true;
|
isFirstTimeLoad = true;
|
||||||
if(isUrlSavable)
|
wasBackPressed = false;
|
||||||
{
|
isContentLoading = false;
|
||||||
urlList.clear();
|
isRunning = false;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void initialize(GeckoView geckoView,boolean release)
|
void initialize(GeckoView geckoView)
|
||||||
{
|
|
||||||
if(urlList.size()<=0 || release)
|
|
||||||
{
|
{
|
||||||
session1 = new GeckoSession();
|
session1 = new GeckoSession();
|
||||||
GeckoRuntime runtime1 = GeckoRuntime.getDefault(app_model.getInstance().getAppContext());
|
runtime1 = GeckoRuntime.getDefault(app_model.getInstance().getAppContext());
|
||||||
runtime1.getSettings().setJavaScriptEnabled(status.java_status);
|
runtime1.getSettings().setJavaScriptEnabled(status.java_status);
|
||||||
session1.open(runtime1);
|
session1.open(runtime1);
|
||||||
geckoView.releaseSession();
|
geckoView.releaseSession();
|
||||||
|
@ -73,7 +70,6 @@ class geckoClients
|
||||||
geckoView.setVisibility(View.VISIBLE);
|
geckoView.setVisibility(View.VISIBLE);
|
||||||
geckoView.setAlpha(1);
|
geckoView.setAlpha(1);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
class navigationDelegate implements GeckoSession.NavigationDelegate
|
class navigationDelegate implements GeckoSession.NavigationDelegate
|
||||||
{
|
{
|
||||||
|
@ -124,7 +120,7 @@ class geckoClients
|
||||||
{
|
{
|
||||||
app_model.getInstance().getAppInstance().hideSplashScreen();
|
app_model.getInstance().getAppInstance().hideSplashScreen();
|
||||||
}
|
}
|
||||||
if(!success && !isContentLoading)
|
if(!success && !isContentLoading && !wasBackPressed)
|
||||||
{
|
{
|
||||||
app_model.getInstance().getAppInstance().onPageFinished(true);
|
app_model.getInstance().getAppInstance().onPageFinished(true);
|
||||||
app_model.getInstance().getAppInstance().onInternetErrorView();
|
app_model.getInstance().getAppInstance().onInternetErrorView();
|
||||||
|
@ -132,11 +128,6 @@ class geckoClients
|
||||||
}
|
}
|
||||||
else if(success)
|
else if(success)
|
||||||
{
|
{
|
||||||
if((urlList.size() == 0 || !urlList.get(urlList.size() - 1).equals(navigatedURL)) && !wasBackPressed)
|
|
||||||
{
|
|
||||||
urlList.add(navigatedURL);
|
|
||||||
}
|
|
||||||
|
|
||||||
urlRequestCount++;
|
urlRequestCount++;
|
||||||
if(urlRequestCount==5)
|
if(urlRequestCount==5)
|
||||||
{
|
{
|
||||||
|
@ -148,27 +139,34 @@ class geckoClients
|
||||||
}
|
}
|
||||||
else if(isAppRated)
|
else if(isAppRated)
|
||||||
{
|
{
|
||||||
if(isFirstTimeLoad)
|
if(isFirstTimeLoad && navigatedURL.contains(".onion"))
|
||||||
{
|
{
|
||||||
app_model.getInstance().getAppInstance().onShowAd(enums.adID.hidden);
|
app_model.getInstance().getAppInstance().onShowAd(enums.adID.hidden_onion_start);
|
||||||
}
|
}
|
||||||
else
|
else if(!isFirstTimeLoad && navigatedURL.contains(".onion"))
|
||||||
{
|
{
|
||||||
app_model.getInstance().getAppInstance().onShowAd(enums.adID.internal);
|
app_model.getInstance().getAppInstance().onShowAd(enums.adID.hidden_onion);
|
||||||
|
}
|
||||||
|
else if(!isFirstTimeLoad && !navigatedURL.contains(".onion"))
|
||||||
|
{
|
||||||
|
app_model.getInstance().getAppInstance().onShowAd(enums.adID.hidden_base);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isUrlSavable && !urlList.get(urlList.size()-1).equals("navigatedURL"))
|
|
||||||
{
|
|
||||||
app_model.getInstance().addHistory(navigatedURL);
|
|
||||||
}
|
|
||||||
isUrlSavable = true;
|
|
||||||
app_model.getInstance().getAppInstance().onDisableInternetError();
|
app_model.getInstance().getAppInstance().onDisableInternetError();
|
||||||
app_model.getInstance().getAppInstance().onProgressBarUpdateView(0);
|
app_model.getInstance().getAppInstance().onProgressBarUpdateView(0);
|
||||||
fabricManager.getInstance().sendEvent("ONION GECKO_CLIENT URL SUCCESS : " + success + "--" + isContentLoading);
|
fabricManager.getInstance().sendEvent("ONION GECKO_CLIENT URL SUCCESS : " + success + "--" + isContentLoading);
|
||||||
app_model.getInstance().getAppInstance().onPageFinished(true);
|
app_model.getInstance().getAppInstance().onPageFinished(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(isUrlSavable && !app_model.getInstance().getNavigation().get(app_model.getInstance().getNavigation().size()-1).equals(navigatedURL))
|
||||||
|
{
|
||||||
|
app_model.getInstance().addHistory(navigatedURL);
|
||||||
|
app_model.getInstance().addNavigation(navigatedURL,enums.navigationType.onion);
|
||||||
|
}
|
||||||
|
isUrlSavable = true;
|
||||||
isFirstTimeLoad = false;
|
isFirstTimeLoad = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, 500);
|
}, 500);
|
||||||
|
@ -203,59 +201,39 @@ class geckoClients
|
||||||
|
|
||||||
void onHiddenGoBack(GeckoView geckoView)
|
void onHiddenGoBack(GeckoView geckoView)
|
||||||
{
|
{
|
||||||
if(urlList.size()>1)
|
isRunning = false;
|
||||||
{
|
loadingCompeleted = false;
|
||||||
urlList.remove(urlList.size() - 1);
|
isUrlSavable = false;
|
||||||
|
|
||||||
wasBackPressed = true;
|
wasBackPressed = true;
|
||||||
session1.stop();
|
session1.stop();
|
||||||
session1.loadUri(urlList.get(urlList.size() - 1));
|
|
||||||
app_model.getInstance().getAppInstance().onUpdateSearchBarView(urlList.get(urlList.size()-1));
|
session1.loadUri(app_model.getInstance().getNavigation().get(app_model.getInstance().getNavigation().size()-1).getURL());
|
||||||
}
|
|
||||||
else if(isRunning)
|
|
||||||
{
|
|
||||||
if(navigatedURL.equals(constants.backendGoogle) && status.search_status.equals(strings.google_text) || navigatedURL.equals(constants.backendBing) && status.search_status.equals(strings.bing_text))
|
|
||||||
{
|
|
||||||
helperMethod.onMinimizeApp();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if(urlList.size()>0)
|
|
||||||
{
|
|
||||||
urlList.remove(urlList.size()-1);
|
|
||||||
}
|
|
||||||
stopHiddenView(geckoView,false);
|
|
||||||
app_model.getInstance().getAppInstance().onUpdateView(true);
|
|
||||||
app_model.getInstance().getAppInstance().onDisableInternetError();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void stopHiddenView(GeckoView geckoView,boolean releaseView)
|
void stopHiddenView(GeckoView geckoView,boolean releaseView,boolean backPressed)
|
||||||
{
|
{
|
||||||
if(session1!=null)
|
if(session1!=null)
|
||||||
{
|
{
|
||||||
isRunning = false;
|
isRunning = false;
|
||||||
loadingCompeleted = false;
|
loadingCompeleted = false;
|
||||||
|
wasBackPressed = backPressed;
|
||||||
|
|
||||||
session1.stop();
|
session1.stop();
|
||||||
if(!releaseView)
|
if(!releaseView)
|
||||||
{
|
{
|
||||||
session1.close();
|
//session1.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int getHiddenQueueLength()
|
public void releaseSession(GeckoView geckoView)
|
||||||
{
|
{
|
||||||
return urlList.size();
|
geckoView.releaseSession();
|
||||||
}
|
}
|
||||||
|
|
||||||
void setRootEngine(String url)
|
void setRootEngine(String url)
|
||||||
{
|
{
|
||||||
if(urlList.size()>1)
|
|
||||||
{
|
|
||||||
urlList.set(0,url);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isGeckoViewRunning()
|
boolean isGeckoViewRunning()
|
||||||
|
@ -265,11 +243,16 @@ class geckoClients
|
||||||
|
|
||||||
void onReloadHiddenView()
|
void onReloadHiddenView()
|
||||||
{
|
{
|
||||||
if(urlList.size()>0)
|
if(app_model.getInstance().getNavigation().get(app_model.getInstance().getNavigation().size()-1).type().equals(enums.navigationType.onion))
|
||||||
{
|
{
|
||||||
|
isRunning = false;
|
||||||
|
loadingCompeleted = false;
|
||||||
|
isUrlSavable = false;
|
||||||
|
|
||||||
wasBackPressed = true;
|
wasBackPressed = true;
|
||||||
session1.stop();
|
session1.stop();
|
||||||
session1.loadUri(urlList.get(urlList.size()-1));
|
|
||||||
|
session1.loadUri(app_model.getInstance().getNavigation().get(app_model.getInstance().getNavigation().size()-1).getURL());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,11 +19,11 @@ import com.example.myapplication.R;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
|
||||||
public class eventHandler
|
public class home_ehandler
|
||||||
{
|
{
|
||||||
application_controller appContoller;
|
application_controller appContoller;
|
||||||
|
|
||||||
public eventHandler()
|
public home_ehandler()
|
||||||
{
|
{
|
||||||
appContoller = app_model.getInstance().getAppInstance();
|
appContoller = app_model.getInstance().getAppInstance();
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@ public class eventHandler
|
||||||
|
|
||||||
public void onHomeButtonPressed()
|
public void onHomeButtonPressed()
|
||||||
{
|
{
|
||||||
appContoller.stopHiddenView(true);
|
appContoller.stopHiddenView(true,false);
|
||||||
fabricManager.getInstance().sendEvent("HOME BUTTON PRESSSED : ");
|
fabricManager.getInstance().sendEvent("HOME BUTTON PRESSSED : ");
|
||||||
viewController.getInstance().checkSSLTextColor();
|
viewController.getInstance().checkSSLTextColor();
|
||||||
appContoller.initSearchEngine();
|
appContoller.initSearchEngine();
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.darkweb.genesissearchengine.appManager.home_activity;
|
||||||
|
|
||||||
|
import com.darkweb.genesissearchengine.constants.enums;
|
||||||
|
|
||||||
|
public class navigation_model
|
||||||
|
{
|
||||||
|
private String url;
|
||||||
|
private enums.navigationType type;
|
||||||
|
|
||||||
|
/*Initializations*/
|
||||||
|
|
||||||
|
public navigation_model(String url, enums.navigationType type) {
|
||||||
|
this.url = url;
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Variable Getters*/
|
||||||
|
|
||||||
|
public String getURL() {
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
public enums.navigationType type() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -42,7 +42,6 @@ public class viewController
|
||||||
private boolean pageLoadedSuccessfully = true;
|
private boolean pageLoadedSuccessfully = true;
|
||||||
private boolean isSplashLoading = false;
|
private boolean isSplashLoading = false;
|
||||||
private Handler updateUIHandler = null;
|
private Handler updateUIHandler = null;
|
||||||
private AutoCompleteAdapter suggestionAdapter;
|
|
||||||
|
|
||||||
/*ProgressBar Delayed Updater*/
|
/*ProgressBar Delayed Updater*/
|
||||||
Handler progressBarHandler = null;
|
Handler progressBarHandler = null;
|
||||||
|
@ -59,7 +58,7 @@ public class viewController
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initialization(WebView webView1, TextView loadingText, ProgressBar progressBar, AutoCompleteTextView searchbar, ConstraintLayout splashScreen, ConstraintLayout requestFailure, FloatingActionButton floatingButton, ImageView loading, ImageView splashlogo)
|
void initialization(WebView webView1, TextView loadingText, ProgressBar progressBar, AutoCompleteTextView searchbar, ConstraintLayout splashScreen, ConstraintLayout requestFailure, FloatingActionButton floatingButton, ImageView loading, ImageView splashlogo)
|
||||||
{
|
{
|
||||||
this.webView = webView1;
|
this.webView = webView1;
|
||||||
this.progressBar = progressBar;
|
this.progressBar = progressBar;
|
||||||
|
@ -82,7 +81,7 @@ public class viewController
|
||||||
|
|
||||||
private void initializeSuggestionView()
|
private void initializeSuggestionView()
|
||||||
{
|
{
|
||||||
suggestionAdapter = new AutoCompleteAdapter(app_model.getInstance().getAppInstance(), R.layout.hint_view, R.id.hintCompletionHeader,app_model.getInstance().getSuggestions());
|
AutoCompleteAdapter suggestionAdapter = new AutoCompleteAdapter(app_model.getInstance().getAppInstance(), R.layout.hint_view, R.id.hintCompletionHeader, app_model.getInstance().getSuggestions());
|
||||||
|
|
||||||
int width = Math.round(helperMethod.screenWidth());
|
int width = Math.round(helperMethod.screenWidth());
|
||||||
searchbar.setThreshold(2);
|
searchbar.setThreshold(2);
|
||||||
|
@ -102,22 +101,22 @@ public class viewController
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reInitializeSuggestion()
|
void reInitializeSuggestion()
|
||||||
{
|
{
|
||||||
initializeSuggestionView();
|
initializeSuggestionView();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isHiddenView()
|
private boolean isHiddenView()
|
||||||
{
|
{
|
||||||
return app_model.getInstance().getAppInstance().isGeckoViewRunning();
|
return app_model.getInstance().getAppInstance().isGeckoViewRunning();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initViews()
|
private void initViews()
|
||||||
{
|
{
|
||||||
floatingButton.setVisibility(View.INVISIBLE);
|
floatingButton.setVisibility(View.INVISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initLock()
|
private void initLock()
|
||||||
{
|
{
|
||||||
Drawable img = app_model.getInstance().getAppInstance().getResources().getDrawable( R.drawable.icon_lock);
|
Drawable img = app_model.getInstance().getAppInstance().getResources().getDrawable( R.drawable.icon_lock);
|
||||||
searchbar.measure(0, 0);
|
searchbar.measure(0, 0);
|
||||||
|
@ -125,7 +124,7 @@ public class viewController
|
||||||
searchbar.setCompoundDrawables( img, null, null, null );
|
searchbar.setCompoundDrawables( img, null, null, null );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onRequestTriggered(boolean isHiddenWeb,String url)
|
void onRequestTriggered(boolean isHiddenWeb, String url)
|
||||||
{
|
{
|
||||||
onProgressBarUpdate(4);
|
onProgressBarUpdate(4);
|
||||||
helperMethod.hideKeyboard();
|
helperMethod.hideKeyboard();
|
||||||
|
@ -141,7 +140,7 @@ public class viewController
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Helper Methods*/
|
/*Helper Methods*/
|
||||||
public void onInternetError()
|
void onInternetError()
|
||||||
{
|
{
|
||||||
disableSplashScreen();
|
disableSplashScreen();
|
||||||
requestFailure.setVisibility(View.VISIBLE);
|
requestFailure.setVisibility(View.VISIBLE);
|
||||||
|
@ -151,9 +150,10 @@ public class viewController
|
||||||
onClearSearchBarCursor();
|
onClearSearchBarCursor();
|
||||||
onProgressBarUpdate(0);
|
onProgressBarUpdate(0);
|
||||||
disableFloatingView();
|
disableFloatingView();
|
||||||
|
app_model.getInstance().getAppInstance().releaseSession();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disableSplashScreen()
|
private void disableSplashScreen()
|
||||||
{
|
{
|
||||||
if(!isSplashLoading)
|
if(!isSplashLoading)
|
||||||
{
|
{
|
||||||
|
@ -214,14 +214,18 @@ public class viewController
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public void hideSplashScreen()
|
void hideSplashScreen()
|
||||||
|
{
|
||||||
|
if(splashScreen.getVisibility()!=View.GONE)
|
||||||
{
|
{
|
||||||
status.isApplicationLoaded = true;
|
|
||||||
splashScreen.animate().alpha(0.0f).setDuration(200).setListener(null).withEndAction((() -> splashScreen.setVisibility(View.GONE)));
|
|
||||||
onWelcomeMessageCheck();
|
onWelcomeMessageCheck();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean onDisableInternetError()
|
status.isApplicationLoaded = true;
|
||||||
|
splashScreen.animate().alpha(0.0f).setDuration(200).setListener(null).withEndAction((() -> splashScreen.setVisibility(View.GONE)));
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean onDisableInternetError()
|
||||||
{
|
{
|
||||||
if(requestFailure.getAlpha()==1)
|
if(requestFailure.getAlpha()==1)
|
||||||
{
|
{
|
||||||
|
@ -235,7 +239,7 @@ public class viewController
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("RestrictedApi")
|
@SuppressLint("RestrictedApi")
|
||||||
public void onPageFinished(boolean status)
|
void onPageFinished(boolean status)
|
||||||
{
|
{
|
||||||
helperMethod.hideKeyboard();
|
helperMethod.hideKeyboard();
|
||||||
progressBar.setProgress(100);
|
progressBar.setProgress(100);
|
||||||
|
@ -251,7 +255,7 @@ public class viewController
|
||||||
disableSplashScreen();
|
disableSplashScreen();
|
||||||
floatingButton.animate().alpha(0).withEndAction((() -> floatingButton.setVisibility(View.GONE)));
|
floatingButton.animate().alpha(0).withEndAction((() -> floatingButton.setVisibility(View.GONE)));
|
||||||
|
|
||||||
app_model.getInstance().getAppInstance().stopHiddenView(false);
|
app_model.getInstance().getAppInstance().stopHiddenView(false,false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -260,7 +264,7 @@ public class viewController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void checkSSLTextColor()
|
void checkSSLTextColor()
|
||||||
{
|
{
|
||||||
if (searchbar == null)
|
if (searchbar == null)
|
||||||
{
|
{
|
||||||
|
@ -287,24 +291,24 @@ public class viewController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClearSearchBarCursor()
|
void onClearSearchBarCursor()
|
||||||
{
|
{
|
||||||
searchbar.clearFocus();
|
searchbar.clearFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disableFloatingView()
|
void disableFloatingView()
|
||||||
{
|
{
|
||||||
floatingButton.animate().alpha(0).withEndAction((() -> floatingButton.setVisibility(View.GONE)));
|
floatingButton.animate().alpha(0).withEndAction((() -> floatingButton.setVisibility(View.GONE)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onUpdateSearchBar(String url)
|
void onUpdateSearchBar(String url)
|
||||||
{
|
{
|
||||||
searchbar.setText(url.replace(constants.backendUrlHost,constants.frontEndUrlHost_v1));
|
searchbar.setText(url.replace(constants.backendUrlHost,constants.frontEndUrlHost_v1));
|
||||||
checkSSLTextColor();
|
checkSSLTextColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initSplashScreen()
|
private void initSplashScreen()
|
||||||
{
|
{
|
||||||
boolean hasSoftKey = helperMethod.hasSoftKeys(app_model.getInstance().getAppInstance().getWindowManager());
|
boolean hasSoftKey = helperMethod.hasSoftKeys(app_model.getInstance().getAppInstance().getWindowManager());
|
||||||
int height = helperMethod.screenHeight(hasSoftKey);
|
int height = helperMethod.screenHeight(hasSoftKey);
|
||||||
|
@ -314,7 +318,7 @@ public class viewController
|
||||||
loading.setLayoutParams(helperMethod.getCenterScreenPoint(loading.getLayoutParams()));
|
loading.setLayoutParams(helperMethod.getCenterScreenPoint(loading.getLayoutParams()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onProgressBarUpdate(int progress)
|
void onProgressBarUpdate(int progress)
|
||||||
{
|
{
|
||||||
if(progress==0)
|
if(progress==0)
|
||||||
{
|
{
|
||||||
|
@ -335,38 +339,53 @@ public class viewController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onBackPressed()
|
void onBackPressed()
|
||||||
{
|
{
|
||||||
|
if(app_model.getInstance().getNavigation().size()>0)
|
||||||
|
{
|
||||||
|
if(app_model.getInstance().getNavigation().size()==1)
|
||||||
|
{
|
||||||
|
onProgressBarUpdate(0);
|
||||||
|
helperMethod.onMinimizeApp();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if(app_model.getInstance().getNavigation().get(app_model.getInstance().getNavigation().size()-2).type().equals(enums.navigationType.base))
|
||||||
|
{
|
||||||
|
app_model.getInstance().getAppInstance().stopHiddenView(true,true);
|
||||||
if(webView.getVisibility()==View.VISIBLE)
|
if(webView.getVisibility()==View.VISIBLE)
|
||||||
{
|
{
|
||||||
if(!webView.canGoBack())
|
onProgressBarUpdate(4);
|
||||||
{
|
|
||||||
if(app_model.getInstance().getAppInstance().getHiddenQueueLength()>0)
|
|
||||||
{
|
|
||||||
onUpdateView(false);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
helperMethod.onMinimizeApp();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
webView.goBack();
|
webView.goBack();
|
||||||
|
app_model.getInstance().getNavigation().remove(app_model.getInstance().getNavigation().size()-1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
onProgressBarUpdate(0);
|
||||||
|
}
|
||||||
webView.bringToFront();
|
webView.bringToFront();
|
||||||
webView.setAlpha(1);
|
webView.setAlpha(1);
|
||||||
webView.setVisibility(View.VISIBLE);
|
webView.setVisibility(View.VISIBLE);
|
||||||
requestFailure.animate().alpha(0f).setDuration(200).withEndAction((() -> requestFailure.setVisibility(View.INVISIBLE)));
|
requestFailure.animate().alpha(0f).setDuration(200).withEndAction((() -> requestFailure.setVisibility(View.INVISIBLE)));
|
||||||
onUpdateSearchBar(webView.getUrl());
|
onUpdateSearchBar(webView.getUrl());
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
app_model.getInstance().getAppInstance().stopHiddenView(true,true);
|
||||||
|
app_model.getInstance().getNavigation().remove(app_model.getInstance().getNavigation().size()-1);
|
||||||
|
if(webView.getVisibility()==View.VISIBLE)
|
||||||
|
{
|
||||||
|
app_model.getInstance().getAppInstance().onReInitGeckoView();
|
||||||
|
app_model.getInstance().getAppInstance().onReloadHiddenView();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
app_model.getInstance().getAppInstance().onHiddenGoBack();
|
app_model.getInstance().getAppInstance().onHiddenGoBack();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void onUpdateView(boolean status)
|
void onUpdateView(boolean status)
|
||||||
{
|
{
|
||||||
if(status)
|
if(status)
|
||||||
{
|
{
|
||||||
|
@ -383,7 +402,7 @@ public class viewController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onWelcomeMessageCheck()
|
private void onWelcomeMessageCheck()
|
||||||
{
|
{
|
||||||
if(!preference_manager.getInstance().getBool("FirstTimeLoaded",false))
|
if(!preference_manager.getInstance().getBool("FirstTimeLoaded",false))
|
||||||
{
|
{
|
||||||
|
@ -397,7 +416,7 @@ public class viewController
|
||||||
startPostTask(messages.SHOW_ADS);
|
startPostTask(messages.SHOW_ADS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void openMenu(View view)
|
void openMenu(View view)
|
||||||
{
|
{
|
||||||
LinearLayout parentView = (LinearLayout)view.getParent();
|
LinearLayout parentView = (LinearLayout)view.getParent();
|
||||||
|
|
||||||
|
@ -414,9 +433,9 @@ public class viewController
|
||||||
view.bringToFront();
|
view.bringToFront();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onReload()
|
void onReload()
|
||||||
{
|
{
|
||||||
if(!isHiddenView())
|
if(app_model.getInstance().getNavigation().get(app_model.getInstance().getNavigation().size()-1).type()==enums.navigationType.base)
|
||||||
{
|
{
|
||||||
onRequestTriggered(false,webView.getUrl());
|
onRequestTriggered(false,webView.getUrl());
|
||||||
webView.reload();
|
webView.reload();
|
||||||
|
@ -427,7 +446,7 @@ public class viewController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSearchBarUrl()
|
String getSearchBarUrl()
|
||||||
{
|
{
|
||||||
return searchbar.getText().toString();
|
return searchbar.getText().toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class webviewClient
|
||||||
}
|
}
|
||||||
if(!url.contains("boogle"))
|
if(!url.contains("boogle"))
|
||||||
{
|
{
|
||||||
app_model.getInstance().getAppInstance().stopHiddenView(false);
|
app_model.getInstance().getAppInstance().stopHiddenView(false,false);
|
||||||
fabricManager.getInstance().sendEvent("BASE SIMPLE SEARCHED : " + url);
|
fabricManager.getInstance().sendEvent("BASE SIMPLE SEARCHED : " + url);
|
||||||
isGeckoView = true;
|
isGeckoView = true;
|
||||||
if(orbot_manager.getInstance().initOrbot(url))
|
if(orbot_manager.getInstance().initOrbot(url))
|
||||||
|
@ -39,6 +39,7 @@ public class webviewClient
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
app_model.getInstance().addNavigation(url,enums.navigationType.base);
|
||||||
app_model.getInstance().addHistory(url);
|
app_model.getInstance().addHistory(url);
|
||||||
fabricManager.getInstance().sendEvent("BASE ONION SEARCHED : " + url);
|
fabricManager.getInstance().sendEvent("BASE ONION SEARCHED : " + url);
|
||||||
app_model.getInstance().getAppInstance().onRequestTriggered(false,url);
|
app_model.getInstance().getAppInstance().onRequestTriggered(false,url);
|
||||||
|
|
|
@ -36,8 +36,11 @@ class setting_view_controller
|
||||||
private void initViews()
|
private void initViews()
|
||||||
{
|
{
|
||||||
search.setDropDownVerticalOffset(15);
|
search.setDropDownVerticalOffset(15);
|
||||||
|
search.setDropDownHorizontalOffset(-15);
|
||||||
javascript.setDropDownVerticalOffset(15);
|
javascript.setDropDownVerticalOffset(15);
|
||||||
|
javascript.setDropDownHorizontalOffset(-15);
|
||||||
history.setDropDownVerticalOffset(15);
|
history.setDropDownVerticalOffset(15);
|
||||||
|
history.setDropDownHorizontalOffset(-15);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initJavascript()
|
private void initJavascript()
|
||||||
|
|
|
@ -30,12 +30,12 @@ public class settings_ehandler
|
||||||
|
|
||||||
private void onJavaScriptListener(int position)
|
private void onJavaScriptListener(int position)
|
||||||
{
|
{
|
||||||
if(position==1 && java_status)
|
if(position==1 && setting_model.getInstance().java_status)
|
||||||
{
|
{
|
||||||
setting_model.getInstance().java_status = false;
|
setting_model.getInstance().java_status = false;
|
||||||
preference_manager.getInstance().setBool(keys.java_script, false);
|
preference_manager.getInstance().setBool(keys.java_script, false);
|
||||||
}
|
}
|
||||||
else if(!java_status)
|
else if(!setting_model.getInstance().java_status)
|
||||||
{
|
{
|
||||||
setting_model.getInstance().java_status = true;
|
setting_model.getInstance().java_status = true;
|
||||||
preference_manager.getInstance().setBool(keys.java_script, true);
|
preference_manager.getInstance().setBool(keys.java_script, true);
|
||||||
|
@ -44,7 +44,7 @@ public class settings_ehandler
|
||||||
|
|
||||||
private void onSearchListner(AdapterView<?> parentView,int position)
|
private void onSearchListner(AdapterView<?> parentView,int position)
|
||||||
{
|
{
|
||||||
if(!search_status.equals(parentView.getItemAtPosition(position).toString()))
|
if(!setting_model.getInstance().search_status.equals(parentView.getItemAtPosition(position).toString()))
|
||||||
{
|
{
|
||||||
setting_model.getInstance().search_status = parentView.getItemAtPosition(position).toString();
|
setting_model.getInstance().search_status = parentView.getItemAtPosition(position).toString();
|
||||||
preference_manager.getInstance().setString(keys.search_engine, setting_model.getInstance().search_status);
|
preference_manager.getInstance().setString(keys.search_engine, setting_model.getInstance().search_status);
|
||||||
|
@ -53,12 +53,12 @@ public class settings_ehandler
|
||||||
|
|
||||||
private void onHistoryListener(int position)
|
private void onHistoryListener(int position)
|
||||||
{
|
{
|
||||||
if(position==1 && history_status)
|
if(position==1 && setting_model.getInstance().history_status)
|
||||||
{
|
{
|
||||||
setting_model.getInstance().history_status = false;
|
setting_model.getInstance().history_status = false;
|
||||||
preference_manager.getInstance().setBool(keys.history_clear, false);
|
preference_manager.getInstance().setBool(keys.history_clear, false);
|
||||||
}
|
}
|
||||||
else if(!java_status)
|
else if(!setting_model.getInstance().history_status)
|
||||||
{
|
{
|
||||||
setting_model.getInstance().history_status = true;
|
setting_model.getInstance().history_status = true;
|
||||||
preference_manager.getInstance().setBool(keys.history_clear, true);
|
preference_manager.getInstance().setBool(keys.history_clear, true);
|
||||||
|
|
|
@ -12,16 +12,15 @@ public class constants
|
||||||
/*URL CONSTANTS*/
|
/*URL CONSTANTS*/
|
||||||
|
|
||||||
public static String backendGenesis = "https://boogle.store/";
|
public static String backendGenesis = "https://boogle.store/";
|
||||||
public static String backendGoogle = "https://www.google.com/";
|
|
||||||
public static String backendBing = "https://www.bing.com/";
|
|
||||||
public static String backendUrlHost = "boogle.store";
|
public static String backendUrlHost = "boogle.store";
|
||||||
public static String backendUrlSlashed = "https://boogle.store/";
|
public static String updateUrl = "https://boogle.store/manual?abi=";
|
||||||
public static String frontUrlSlashed = "https://genesis.onion/";
|
|
||||||
public static String frontEndUrlHost = "genesis.store";
|
public static String frontEndUrlHost = "genesis.store";
|
||||||
public static String frontEndUrlHost_v1 = "genesis.onion";
|
public static String frontEndUrlHost_v1 = "genesis.onion";
|
||||||
|
|
||||||
|
public static String backendGoogle = "https://www.google.com/";
|
||||||
|
public static String backendBing = "https://www.bing.com/";
|
||||||
public static String allowedHost = ".onion";
|
public static String allowedHost = ".onion";
|
||||||
public static String reportUrl = "https://boogle.store/reportus?r_key=";
|
|
||||||
public static String updateUrl = "https://boogle.store/manual?abi=";
|
|
||||||
public static String playstoreUrl = "https://play.google.com/store/apps/details?id=com.darkweb.genesissearchengine";
|
public static String playstoreUrl = "https://play.google.com/store/apps/details?id=com.darkweb.genesissearchengine";
|
||||||
|
|
||||||
/*BUILD CONSTANTS*/
|
/*BUILD CONSTANTS*/
|
||||||
|
|
|
@ -5,6 +5,7 @@ public class enums
|
||||||
/*SETTINGS*/
|
/*SETTINGS*/
|
||||||
|
|
||||||
public enum searchEngine{Darkweb,Bing,Google}
|
public enum searchEngine{Darkweb,Bing,Google}
|
||||||
public enum adID{hidden, internal}
|
public enum adID{hidden_onion, hidden_onion_start,hidden_base}
|
||||||
|
public enum navigationType{onion, base}
|
||||||
|
|
||||||
}
|
}
|
|
@ -3,12 +3,15 @@ package com.darkweb.genesissearchengine.constants;
|
||||||
public class keys
|
public class keys
|
||||||
{
|
{
|
||||||
/*Welcome Message Prefs*/
|
/*Welcome Message Prefs*/
|
||||||
|
|
||||||
public static String first_time_loaded = "FirstTimeLoaded";
|
public static String first_time_loaded = "FirstTimeLoaded";
|
||||||
|
|
||||||
/*Home page*/
|
/*Home page*/
|
||||||
|
|
||||||
public static String homepage_html_key = "internalhtml";
|
public static String homepage_html_key = "internalhtml";
|
||||||
|
|
||||||
/*Proxy Manager*/
|
/*Proxy Manager*/
|
||||||
|
|
||||||
public static String proxy_type = "network.proxy.type";
|
public static String proxy_type = "network.proxy.type";
|
||||||
public static String proxy_socks = "network.proxy.socks";
|
public static String proxy_socks = "network.proxy.socks";
|
||||||
public static String proxy_socks_port = "network.proxy.socks_port";
|
public static String proxy_socks_port = "network.proxy.socks_port";
|
||||||
|
@ -24,6 +27,7 @@ public class keys
|
||||||
public static String list_type = "list_type";
|
public static String list_type = "list_type";
|
||||||
|
|
||||||
/*Settings*/
|
/*Settings*/
|
||||||
|
|
||||||
public static String search_engine = "search_engine";
|
public static String search_engine = "search_engine";
|
||||||
public static String java_script = "java_script";
|
public static String java_script = "java_script";
|
||||||
public static String history_clear = "history_clear";
|
public static String history_clear = "history_clear";
|
||||||
|
|
|
@ -6,12 +6,14 @@ import com.darkweb.genesissearchengine.dataManager.preference_manager;
|
||||||
public class status
|
public class status
|
||||||
{
|
{
|
||||||
/*App Level*/
|
/*App Level*/
|
||||||
|
|
||||||
public static boolean isApplicationLoaded = false;
|
public static boolean isApplicationLoaded = false;
|
||||||
public static boolean isPlayStoreInstalled = true;
|
public static boolean isPlayStoreInstalled = true;
|
||||||
public static boolean isTorInitialized = false;
|
public static boolean isTorInitialized = false;
|
||||||
public static String version_code = "6.0";
|
public static String version_code = "7.0";
|
||||||
|
|
||||||
/*Settings Level*/
|
/*Settings Level*/
|
||||||
|
|
||||||
public static String search_status = strings.emptyStr;
|
public static String search_status = strings.emptyStr;
|
||||||
public static boolean java_status = false;
|
public static boolean java_status = false;
|
||||||
public static boolean history_status = true;
|
public static boolean history_status = true;
|
||||||
|
|
|
@ -7,6 +7,7 @@ import com.darkweb.genesissearchengine.appManager.home_activity.app_model;
|
||||||
public class preference_manager
|
public class preference_manager
|
||||||
{
|
{
|
||||||
/*Private Declarations*/
|
/*Private Declarations*/
|
||||||
|
|
||||||
private static final preference_manager ourInstance = new preference_manager();
|
private static final preference_manager ourInstance = new preference_manager();
|
||||||
private SharedPreferences prefs;
|
private SharedPreferences prefs;
|
||||||
private SharedPreferences.Editor edit;
|
private SharedPreferences.Editor edit;
|
||||||
|
@ -17,6 +18,7 @@ public class preference_manager
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Initializations*/
|
/*Initializations*/
|
||||||
|
|
||||||
private preference_manager()
|
private preference_manager()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -28,6 +30,7 @@ public class preference_manager
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Saving Preferences*/
|
/*Saving Preferences*/
|
||||||
|
|
||||||
public void setString(String valueKey, String value)
|
public void setString(String valueKey, String value)
|
||||||
{
|
{
|
||||||
edit.putString(valueKey, value);
|
edit.putString(valueKey, value);
|
||||||
|
@ -41,6 +44,7 @@ public class preference_manager
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Recieving Preferences*/
|
/*Recieving Preferences*/
|
||||||
|
|
||||||
public String getString(String valueKey, String valueDefault)
|
public String getString(String valueKey, String valueDefault)
|
||||||
{
|
{
|
||||||
return prefs.getString(valueKey, valueDefault);
|
return prefs.getString(valueKey, valueDefault);
|
||||||
|
|
|
@ -33,16 +33,14 @@ import java.util.Locale;
|
||||||
public class helperMethod
|
public class helperMethod
|
||||||
{
|
{
|
||||||
/*Helper Methods*/
|
/*Helper Methods*/
|
||||||
public static boolean isNetworkAvailable()
|
|
||||||
{
|
public static boolean isNetworkAvailable(){
|
||||||
ConnectivityManager cm = (ConnectivityManager) app_model.getInstance().getAppContext().getSystemService(Context.CONNECTIVITY_SERVICE);
|
ConnectivityManager cm = (ConnectivityManager) app_model.getInstance().getAppContext().getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||||
NetworkInfo networkInfo = cm.getActiveNetworkInfo();
|
NetworkInfo networkInfo = cm.getActiveNetworkInfo();
|
||||||
return networkInfo != null && networkInfo.isConnected();
|
return networkInfo != null && networkInfo.isConnected();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String completeURL(String url){
|
||||||
public static String completeURL(String url)
|
|
||||||
{
|
|
||||||
if(!url.startsWith("www.")&& !url.startsWith("http://")&& !url.startsWith("https://")){
|
if(!url.startsWith("www.")&& !url.startsWith("http://")&& !url.startsWith("https://")){
|
||||||
url = "www."+url;
|
url = "www."+url;
|
||||||
}
|
}
|
||||||
|
@ -52,8 +50,7 @@ public class helperMethod
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void hideKeyboard()
|
public static void hideKeyboard() {
|
||||||
{
|
|
||||||
View view = app_model.getInstance().getAppInstance().findViewById(android.R.id.content);
|
View view = app_model.getInstance().getAppInstance().findViewById(android.R.id.content);
|
||||||
if (view != null)
|
if (view != null)
|
||||||
{
|
{
|
||||||
|
@ -62,8 +59,52 @@ public class helperMethod
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int screenHeight(boolean hasSoftKeys)
|
public static void rateApp(){
|
||||||
|
preference_manager.getInstance().setBool(keys.isAppRated,true);
|
||||||
|
app_model.getInstance().getAppInstance().startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.darkweb.genesissearchengine")));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void shareApp() {
|
||||||
|
ShareCompat.IntentBuilder.from(app_model.getInstance().getAppInstance())
|
||||||
|
.setType("text/plain")
|
||||||
|
.setChooserTitle("Hi! Check out this Awesome App")
|
||||||
|
.setSubject("Hi! Check out this Awesome App")
|
||||||
|
.setText("Genesis | Onion Search | http://play.google.com/store/apps/details?id=" + app_model.getInstance().getAppInstance().getPackageName())
|
||||||
|
.startChooser();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getHost(String link){
|
||||||
|
URL url = null;
|
||||||
|
try
|
||||||
{
|
{
|
||||||
|
url = new URL(link);
|
||||||
|
String host = url.getHost();
|
||||||
|
return host;
|
||||||
|
}
|
||||||
|
catch (MalformedURLException e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void openActivity( Class<?> cls,int type){
|
||||||
|
Intent myIntent = new Intent(app_model.getInstance().getAppInstance(), cls);
|
||||||
|
myIntent.putExtra(keys.list_type, type);
|
||||||
|
app_model.getInstance().getAppInstance().startActivity(myIntent);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void onMinimizeApp(){
|
||||||
|
Intent startMain = new Intent(Intent.ACTION_MAIN);
|
||||||
|
startMain.addCategory(Intent.CATEGORY_HOME);
|
||||||
|
startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
app_model.getInstance().getAppInstance().startActivity(startMain);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Splash Screen Initializations*/
|
||||||
|
|
||||||
|
public static int screenHeight(boolean hasSoftKeys) {
|
||||||
if(!hasSoftKeys)
|
if(!hasSoftKeys)
|
||||||
{
|
{
|
||||||
return Resources.getSystem().getDisplayMetrics().heightPixels -(helperMethod.getNavigationBarHeight());
|
return Resources.getSystem().getDisplayMetrics().heightPixels -(helperMethod.getNavigationBarHeight());
|
||||||
|
@ -88,16 +129,14 @@ public class helperMethod
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static RotateAnimation getRotationAnimation()
|
public static RotateAnimation getRotationAnimation(){
|
||||||
{
|
|
||||||
RotateAnimation rotate = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,0.5f);
|
RotateAnimation rotate = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,0.5f);
|
||||||
rotate.setDuration(2000);
|
rotate.setDuration(2000);
|
||||||
rotate.setRepeatCount(Animation.INFINITE);
|
rotate.setRepeatCount(Animation.INFINITE);
|
||||||
return rotate;
|
return rotate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ViewGroup.MarginLayoutParams getCenterScreenPoint(ViewGroup.LayoutParams itemLayoutParams)
|
public static ViewGroup.MarginLayoutParams getCenterScreenPoint(ViewGroup.LayoutParams itemLayoutParams) {
|
||||||
{
|
|
||||||
double heightloader = Resources.getSystem().getDisplayMetrics().heightPixels*0.78;
|
double heightloader = Resources.getSystem().getDisplayMetrics().heightPixels*0.78;
|
||||||
ViewGroup.MarginLayoutParams params_loading = (ViewGroup.MarginLayoutParams) itemLayoutParams;
|
ViewGroup.MarginLayoutParams params_loading = (ViewGroup.MarginLayoutParams) itemLayoutParams;
|
||||||
params_loading.topMargin = (int)(heightloader);
|
params_loading.topMargin = (int)(heightloader);
|
||||||
|
@ -105,8 +144,7 @@ public class helperMethod
|
||||||
return params_loading;
|
return params_loading;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean hasSoftKeys(WindowManager windowManager)
|
public static boolean hasSoftKeys(WindowManager windowManager){
|
||||||
{
|
|
||||||
Display d = windowManager.getDefaultDisplay();
|
Display d = windowManager.getDefaultDisplay();
|
||||||
|
|
||||||
DisplayMetrics realDisplayMetrics = new DisplayMetrics();
|
DisplayMetrics realDisplayMetrics = new DisplayMetrics();
|
||||||
|
@ -124,89 +162,9 @@ public class helperMethod
|
||||||
return (realWidth - displayWidth) > 0 || (realHeight - displayHeight) > 0;
|
return (realWidth - displayWidth) > 0 || (realHeight - displayHeight) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isBuildValid ()
|
public static boolean isBuildValid (){
|
||||||
{
|
|
||||||
return BuildConfig.FLAVOR.equals("aarch64") && Build.SUPPORTED_ABIS[0].equals("arm64-v8a") || BuildConfig.FLAVOR.equals("arm") && Build.SUPPORTED_ABIS[0].equals("armeabi-v7a") || BuildConfig.FLAVOR.equals("x86") && Build.SUPPORTED_ABIS[0].equals("x86") || BuildConfig.FLAVOR.equals("x86_64") && Build.SUPPORTED_ABIS[0].equals("x86_64");
|
return BuildConfig.FLAVOR.equals("aarch64") && Build.SUPPORTED_ABIS[0].equals("arm64-v8a") || BuildConfig.FLAVOR.equals("arm") && Build.SUPPORTED_ABIS[0].equals("armeabi-v7a") || BuildConfig.FLAVOR.equals("x86") && Build.SUPPORTED_ABIS[0].equals("x86") || BuildConfig.FLAVOR.equals("x86_64") && Build.SUPPORTED_ABIS[0].equals("x86_64");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void rateApp()
|
|
||||||
{
|
|
||||||
preference_manager.getInstance().setBool(keys.isAppRated,true);
|
|
||||||
app_model.getInstance().getAppInstance().startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.darkweb.genesissearchengine")));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void shareApp()
|
|
||||||
{
|
|
||||||
ShareCompat.IntentBuilder.from(app_model.getInstance().getAppInstance())
|
|
||||||
.setType("text/plain")
|
|
||||||
.setChooserTitle("Hi! Check out this Awesome App")
|
|
||||||
.setSubject("Hi! Check out this Awesome App")
|
|
||||||
.setText("Genesis | Onion Search | http://play.google.com/store/apps/details?id=" + app_model.getInstance().getAppInstance().getPackageName())
|
|
||||||
.startChooser();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getHost(String link)
|
|
||||||
{
|
|
||||||
URL url = null;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
url = new URL(link);
|
|
||||||
String host = url.getHost();
|
|
||||||
return host;
|
|
||||||
}
|
|
||||||
catch (MalformedURLException e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void openActivity( Class<?> cls,int type)
|
|
||||||
{
|
|
||||||
Intent myIntent = new Intent(app_model.getInstance().getAppInstance(), cls);
|
|
||||||
myIntent.putExtra(keys.list_type, type);
|
|
||||||
app_model.getInstance().getAppInstance().startActivity(myIntent);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static CharSequence highlight(String search, String originalText) {
|
|
||||||
// ignore case and accents
|
|
||||||
// the same thing should have been done for the search text
|
|
||||||
String normalizedText = Normalizer
|
|
||||||
.normalize(originalText, Normalizer.Form.NFD)
|
|
||||||
.replaceAll("\\p{InCombiningDiacriticalMarks}+", "")
|
|
||||||
.toLowerCase(Locale.ENGLISH);
|
|
||||||
|
|
||||||
int start = normalizedText.indexOf(search.toLowerCase(Locale.ENGLISH));
|
|
||||||
if (start < 0) {
|
|
||||||
// not found, nothing to to
|
|
||||||
return originalText;
|
|
||||||
} else {
|
|
||||||
// highlight each appearance in the original text
|
|
||||||
// while searching in normalized text
|
|
||||||
Spannable highlighted = new SpannableString(originalText);
|
|
||||||
while (start >= 0) {
|
|
||||||
int spanStart = Math.min(start, originalText.length());
|
|
||||||
int spanEnd = Math.min(start + search.length(),
|
|
||||||
originalText.length());
|
|
||||||
|
|
||||||
highlighted.setSpan(new ForegroundColorSpan(Color.BLUE),
|
|
||||||
spanStart, spanEnd, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
|
||||||
|
|
||||||
start = normalizedText.indexOf(search, spanEnd);
|
|
||||||
}
|
|
||||||
|
|
||||||
return highlighted;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void onMinimizeApp()
|
|
||||||
{
|
|
||||||
Intent startMain = new Intent(Intent.ACTION_MAIN);
|
|
||||||
startMain.addCategory(Intent.CATEGORY_HOME);
|
|
||||||
startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
app_model.getInstance().getAppInstance().startActivity(startMain);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,8 +11,9 @@ public class admanager
|
||||||
|
|
||||||
/*Private Variables*/
|
/*Private Variables*/
|
||||||
private static final admanager ourInstance = new admanager();
|
private static final admanager ourInstance = new admanager();
|
||||||
private InterstitialAd mInterstitialHidden;
|
private InterstitialAd mInterstitialHidden_onion;
|
||||||
private InterstitialAd mInterstitialInternal;
|
private InterstitialAd mInterstitialInternal;
|
||||||
|
private InterstitialAd mInterstitialHidden_base;
|
||||||
private int adCount = 0;
|
private int adCount = 0;
|
||||||
boolean isAdShown = false;
|
boolean isAdShown = false;
|
||||||
|
|
||||||
|
@ -28,26 +29,33 @@ public class admanager
|
||||||
public void initialize()
|
public void initialize()
|
||||||
{
|
{
|
||||||
MobileAds.initialize(app_model.getInstance().getAppInstance(), "ca-app-pub-5074525529134731~2926711128");
|
MobileAds.initialize(app_model.getInstance().getAppInstance(), "ca-app-pub-5074525529134731~2926711128");
|
||||||
initAd(mInterstitialHidden,"ca-app-pub-5074525529134731/4332539288");
|
mInterstitialHidden_base = initAd("ca-app-pub-5074525529134731/1637043432");
|
||||||
initAd(mInterstitialInternal,"ca-app-pub-5074525529134731/8478420705");
|
mInterstitialHidden_onion = initAd("ca-app-pub-5074525529134731/4332539288");
|
||||||
|
mInterstitialInternal = initAd("ca-app-pub-5074525529134731/8478420705");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initAd(InterstitialAd adInstance,String id)
|
public InterstitialAd initAd(String id)
|
||||||
{
|
{
|
||||||
adInstance = new InterstitialAd(app_model.getInstance().getAppInstance());
|
InterstitialAd adInstance = new InterstitialAd(app_model.getInstance().getAppInstance());
|
||||||
|
|
||||||
adInstance.setAdUnitId(id);
|
adInstance.setAdUnitId(id);
|
||||||
adInstance.loadAd(new AdRequest.Builder().build());
|
adInstance.loadAd(new AdRequest.Builder().build());
|
||||||
|
|
||||||
|
return adInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Helper Methods*/
|
/*Helper Methods*/
|
||||||
|
|
||||||
public void showAd(enums.adID id)
|
public void showAd(enums.adID id)
|
||||||
{
|
{
|
||||||
if(id.equals(enums.adID.hidden))
|
if(id.equals(enums.adID.hidden_base))
|
||||||
{
|
{
|
||||||
mInterstitialHidden.show();
|
mInterstitialHidden_base.show();
|
||||||
mInterstitialHidden.loadAd(new AdRequest.Builder().build());
|
mInterstitialHidden_base.loadAd(new AdRequest.Builder().build());
|
||||||
|
}
|
||||||
|
else if(id.equals(enums.adID.hidden_onion))
|
||||||
|
{
|
||||||
|
mInterstitialHidden_onion.show();
|
||||||
|
mInterstitialHidden_onion.loadAd(new AdRequest.Builder().build());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,6 +11,7 @@ import java.util.UUID;
|
||||||
public class analyticmanager
|
public class analyticmanager
|
||||||
{
|
{
|
||||||
/*Private Variables*/
|
/*Private Variables*/
|
||||||
|
|
||||||
private static final analyticmanager ourInstance = new analyticmanager();
|
private static final analyticmanager ourInstance = new analyticmanager();
|
||||||
private String uniqueID = null;
|
private String uniqueID = null;
|
||||||
|
|
||||||
|
@ -19,6 +20,7 @@ public class analyticmanager
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Initializations*/
|
/*Initializations*/
|
||||||
|
|
||||||
private analyticmanager()
|
private analyticmanager()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,17 @@
|
||||||
package com.darkweb.genesissearchengine.pluginManager;
|
package com.darkweb.genesissearchengine.pluginManager;
|
||||||
|
|
||||||
|
import com.crashlytics.android.Crashlytics;
|
||||||
|
import com.darkweb.genesissearchengine.appManager.home_activity.app_model;
|
||||||
|
import io.fabric.sdk.android.Fabric;
|
||||||
|
|
||||||
public class fabricManager
|
public class fabricManager
|
||||||
{
|
{
|
||||||
|
/*Private Variables*/
|
||||||
|
|
||||||
private static final fabricManager ourInstance = new fabricManager();
|
private static final fabricManager ourInstance = new fabricManager();
|
||||||
|
|
||||||
|
/*Initializations*/
|
||||||
|
|
||||||
public static fabricManager getInstance()
|
public static fabricManager getInstance()
|
||||||
{
|
{
|
||||||
return ourInstance;
|
return ourInstance;
|
||||||
|
@ -15,13 +23,15 @@ public class fabricManager
|
||||||
|
|
||||||
public void init()
|
public void init()
|
||||||
{
|
{
|
||||||
//Fabric.with(app_model.getInstance().getAppContext(), new Crashlytics());
|
Fabric.with(app_model.getInstance().getAppContext(), new Crashlytics());
|
||||||
//analyticmanager.getInstance().initialize(app_model.getInstance().getAppContext());
|
analyticmanager.getInstance().initialize(app_model.getInstance().getAppContext());
|
||||||
//analyticmanager.getInstance().logUser();
|
analyticmanager.getInstance().logUser();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*Helper Methods*/
|
||||||
|
|
||||||
public void sendEvent(String value)
|
public void sendEvent(String value)
|
||||||
{
|
{
|
||||||
//analyticmanager.getInstance().sendEvent(value);
|
analyticmanager.getInstance().sendEvent(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,8 +4,12 @@ package com.darkweb.genesissearchengine.pluginManager;
|
||||||
|
|
||||||
public class firebase
|
public class firebase
|
||||||
{
|
{
|
||||||
|
/*Private Variables*/
|
||||||
|
|
||||||
private static final firebase ourInstance = new firebase();
|
private static final firebase ourInstance = new firebase();
|
||||||
|
|
||||||
|
/*Initializations*/
|
||||||
|
|
||||||
public static firebase getInstance()
|
public static firebase getInstance()
|
||||||
{
|
{
|
||||||
return ourInstance;
|
return ourInstance;
|
||||||
|
@ -18,6 +22,8 @@ public class firebase
|
||||||
//mFirebaseAnalytics = FirebaseAnalytics.getInstance(app_model.getInstance().getAppContext());
|
//mFirebaseAnalytics = FirebaseAnalytics.getInstance(app_model.getInstance().getAppContext());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*Helper Methods*/
|
||||||
|
|
||||||
public void logEvent(String value,String id)
|
public void logEvent(String value,String id)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.darkweb.genesissearchengine.constants.constants;
|
||||||
import com.darkweb.genesissearchengine.constants.keys;
|
import com.darkweb.genesissearchengine.constants.keys;
|
||||||
import com.darkweb.genesissearchengine.constants.status;
|
import com.darkweb.genesissearchengine.constants.status;
|
||||||
import com.darkweb.genesissearchengine.constants.strings;
|
import com.darkweb.genesissearchengine.constants.strings;
|
||||||
|
import com.darkweb.genesissearchengine.helperMethod;
|
||||||
import com.msopentech.thali.android.toronionproxy.AndroidOnionProxyManager;
|
import com.msopentech.thali.android.toronionproxy.AndroidOnionProxyManager;
|
||||||
import com.msopentech.thali.toronionproxy.OnionProxyManager;
|
import com.msopentech.thali.toronionproxy.OnionProxyManager;
|
||||||
import org.mozilla.gecko.PrefsHelper;
|
import org.mozilla.gecko.PrefsHelper;
|
||||||
|
@ -12,12 +13,15 @@ import org.mozilla.gecko.PrefsHelper;
|
||||||
public class orbot_manager {
|
public class orbot_manager {
|
||||||
|
|
||||||
/*Private Variables*/
|
/*Private Variables*/
|
||||||
|
|
||||||
private boolean isLoading = false;
|
private boolean isLoading = false;
|
||||||
private int threadCounter = 100;
|
private int threadCounter = 100;
|
||||||
/*Local Initialization*/
|
|
||||||
private static final orbot_manager ourInstance = new orbot_manager();
|
|
||||||
private OnionProxyManager onionProxyManager = null;
|
private OnionProxyManager onionProxyManager = null;
|
||||||
|
|
||||||
|
/*Local Initialization*/
|
||||||
|
|
||||||
|
private static final orbot_manager ourInstance = new orbot_manager();
|
||||||
|
|
||||||
public static orbot_manager getInstance()
|
public static orbot_manager getInstance()
|
||||||
{
|
{
|
||||||
return ourInstance;
|
return ourInstance;
|
||||||
|
@ -28,6 +32,7 @@ public class orbot_manager {
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Orbot Initialization*/
|
/*Orbot Initialization*/
|
||||||
|
|
||||||
public boolean initOrbot(String url)
|
public boolean initOrbot(String url)
|
||||||
{
|
{
|
||||||
if(!status.isTorInitialized)
|
if(!status.isTorInitialized)
|
||||||
|
@ -59,8 +64,14 @@ public class orbot_manager {
|
||||||
status.isTorInitialized = true;
|
status.isTorInitialized = true;
|
||||||
threadCounter = 5000;
|
threadCounter = 5000;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
status.isTorInitialized = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(!isLoading && !status.isTorInitialized)
|
if(!isLoading && !status.isTorInitialized)
|
||||||
|
{
|
||||||
|
if(helperMethod.isNetworkAvailable())
|
||||||
{
|
{
|
||||||
if(onionProxyManager == null)
|
if(onionProxyManager == null)
|
||||||
{
|
{
|
||||||
|
@ -70,6 +81,7 @@ public class orbot_manager {
|
||||||
status.isTorInitialized = false;
|
status.isTorInitialized = false;
|
||||||
initializeTorClient();
|
initializeTorClient();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sleep(threadCounter);
|
sleep(threadCounter);
|
||||||
|
@ -85,21 +97,6 @@ public class orbot_manager {
|
||||||
}.start();
|
}.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()
|
public void initializeTorClient()
|
||||||
{
|
{
|
||||||
if(!isLoading)
|
if(!isLoading)
|
||||||
|
@ -142,13 +139,14 @@ public class orbot_manager {
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Proxy Initialization*/
|
/*Proxy Initialization*/
|
||||||
|
|
||||||
public void initializeProxy()
|
public void initializeProxy()
|
||||||
{
|
{
|
||||||
PrefsHelper.setPref(keys.proxy_type, constants.proxy_type); //manual proxy settings
|
PrefsHelper.setPref(keys.proxy_type, constants.proxy_type);
|
||||||
PrefsHelper.setPref(keys.proxy_socks,constants.proxy_socks); //manual proxy settings
|
PrefsHelper.setPref(keys.proxy_socks,constants.proxy_socks);
|
||||||
PrefsHelper.setPref(keys.proxy_socks_port, app_model.getInstance().getPort()); //manual proxy settings
|
PrefsHelper.setPref(keys.proxy_socks_port, app_model.getInstance().getPort());
|
||||||
PrefsHelper.setPref(keys.proxy_socks_version,constants.proxy_socks_version); //manual proxy settings
|
PrefsHelper.setPref(keys.proxy_socks_version,constants.proxy_socks_version);
|
||||||
PrefsHelper.setPref(keys.proxy_socks_remote_dns,constants.proxy_socks_remote_dns); //manual proxy settings
|
PrefsHelper.setPref(keys.proxy_socks_remote_dns,constants.proxy_socks_remote_dns);
|
||||||
PrefsHelper.setPref(keys.proxy_cache,constants.proxy_cache);
|
PrefsHelper.setPref(keys.proxy_cache,constants.proxy_cache);
|
||||||
PrefsHelper.setPref(keys.proxy_memory,constants.proxy_memory);
|
PrefsHelper.setPref(keys.proxy_memory,constants.proxy_memory);
|
||||||
PrefsHelper.setPref(keys.proxy_useragent_override, constants.proxy_useragent_override);
|
PrefsHelper.setPref(keys.proxy_useragent_override, constants.proxy_useragent_override);
|
||||||
|
@ -156,6 +154,21 @@ public class orbot_manager {
|
||||||
PrefsHelper.setPref(keys.proxy_donottrackheader_value,constants.proxy_donottrackheader_value);
|
PrefsHelper.setPref(keys.proxy_donottrackheader_value,constants.proxy_donottrackheader_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*Helper Methods*/
|
||||||
|
|
||||||
|
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";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,7 +93,7 @@
|
||||||
android:layout_marginTop="1dp"
|
android:layout_marginTop="1dp"
|
||||||
|
|
||||||
style="@style/Widget.AppCompat.DropDownItem.Spinner"
|
style="@style/Widget.AppCompat.DropDownItem.Spinner"
|
||||||
android:dropDownWidth="200dp"
|
android:dropDownWidth="160dp"
|
||||||
android:popupBackground="@android:color/white"
|
android:popupBackground="@android:color/white"
|
||||||
android:overlapAnchor="false"
|
android:overlapAnchor="false"
|
||||||
android:popupTheme="@style/AppTheme.PopupOverlay"
|
android:popupTheme="@style/AppTheme.PopupOverlay"
|
||||||
|
@ -138,7 +138,7 @@
|
||||||
android:popupTheme="@style/AppTheme.PopupOverlay"
|
android:popupTheme="@style/AppTheme.PopupOverlay"
|
||||||
|
|
||||||
style="@style/Widget.AppCompat.DropDownItem.Spinner"
|
style="@style/Widget.AppCompat.DropDownItem.Spinner"
|
||||||
android:dropDownWidth="200dp"
|
android:dropDownWidth="160dp"
|
||||||
android:popupBackground="@android:color/white"
|
android:popupBackground="@android:color/white"
|
||||||
android:overlapAnchor="false"
|
android:overlapAnchor="false"
|
||||||
android:popupElevation="3dp"
|
android:popupElevation="3dp"
|
||||||
|
@ -181,7 +181,7 @@
|
||||||
android:popupTheme="@style/AppTheme.PopupOverlay"
|
android:popupTheme="@style/AppTheme.PopupOverlay"
|
||||||
|
|
||||||
style="@style/Widget.AppCompat.DropDownItem.Spinner"
|
style="@style/Widget.AppCompat.DropDownItem.Spinner"
|
||||||
android:dropDownWidth="200dp"
|
android:dropDownWidth="160dp"
|
||||||
android:popupBackground="@android:color/white"
|
android:popupBackground="@android:color/white"
|
||||||
android:overlapAnchor="false"
|
android:overlapAnchor="false"
|
||||||
android:popupElevation="3dp"
|
android:popupElevation="3dp"
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
/*arm versions*/
|
/*arm versions*/
|
||||||
project.ext.arm_vname = '180'
|
project.ext.arm_vname = '188'
|
||||||
project.ext.arm_vcode = 180
|
project.ext.arm_vcode = 188
|
||||||
|
|
||||||
/*aarch versions*/
|
/*aarch versions*/
|
||||||
project.ext.aarch_vname = '181'
|
project.ext.aarch_vname = '189'
|
||||||
project.ext.aarch_vcode = 181
|
project.ext.aarch_vcode = 189
|
||||||
|
|
||||||
/*x86 versions*/
|
/*x86 versions*/
|
||||||
project.ext.x86_vname = '182'
|
project.ext.x86_vname = '190'
|
||||||
project.ext.x86_vcode = 182
|
project.ext.x86_vcode = 190
|
||||||
|
|
||||||
/*x64 versions*/
|
/*x64 versions*/
|
||||||
project.ext.x64_vname = '183'
|
project.ext.x64_vname = '191'
|
||||||
project.ext.x64_vcode = 183
|
project.ext.x64_vcode = 191
|
||||||
|
|
||||||
/*dimension*/
|
/*dimension*/
|
||||||
project.ext.dimen = 'abi'
|
project.ext.dimen = 'abi'
|
||||||
|
|
Loading…
Reference in New Issue