bug fixes
|
@ -1,5 +1,40 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="NullableNotNullManager">
|
||||
<option name="myDefaultNullable" value="org.jetbrains.annotations.Nullable" />
|
||||
<option name="myDefaultNotNull" value="androidx.annotation.NonNull" />
|
||||
<option name="myNullables">
|
||||
<value>
|
||||
<list size="10">
|
||||
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
|
||||
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
|
||||
<item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
|
||||
<item index="3" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
|
||||
<item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
|
||||
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.Nullable" />
|
||||
<item index="6" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" />
|
||||
<item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.Nullable" />
|
||||
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableDecl" />
|
||||
<item index="9" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableType" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
<option name="myNotNulls">
|
||||
<value>
|
||||
<list size="9">
|
||||
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
|
||||
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
|
||||
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
|
||||
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
|
||||
<item index="4" class="java.lang.String" itemvalue="androidx.annotation.NonNull" />
|
||||
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" />
|
||||
<item index="6" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.NonNull" />
|
||||
<item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullDecl" />
|
||||
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullType" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
|
|
|
@ -49,13 +49,13 @@ android {
|
|||
versionName "180"
|
||||
dimension "abi"
|
||||
buildConfigField "String", "VARIANT", "\"arm\""
|
||||
}
|
||||
}*/
|
||||
aarch64 {
|
||||
versionCode 181
|
||||
versionName "181"
|
||||
dimension "abi"
|
||||
buildConfigField "String", "VARIANT", "\"aarch64\""
|
||||
}*/
|
||||
}/*
|
||||
x86 {
|
||||
versionCode 182
|
||||
versionName "182"
|
||||
|
@ -108,10 +108,10 @@ dependencies {
|
|||
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.20190613202504"
|
||||
//x86Implementation "org.mozilla.geckoview:geckoview-x86:67.0.20190613202504"
|
||||
//x86_64Implementation "org.mozilla.geckoview:geckoview-x86_64:67.0.20190613202504"
|
||||
//armImplementation "org.mozilla.geckoview:geckoview-armeabi-v7a:67.0.20190613202504"
|
||||
//aarch64Implementation "org.mozilla.geckoview:geckoview-arm64-v8a:67.0.20190613202504"
|
||||
aarch64Implementation "org.mozilla.geckoview:geckoview-arm64-v8a:67.0.20190613202504"
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.0.2'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
|
@ -130,7 +130,7 @@ dependencies {
|
|||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0-alpha03'
|
||||
|
||||
implementation('com.crashlytics.sdk.android:crashlytics:2.10.1@aar') {
|
||||
transitive = true;
|
||||
transitive = true
|
||||
}
|
||||
implementation 'com.android.support:appcompat-v7:28.0.0'
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
android:windowSoftInputMode="adjustNothing"
|
||||
android:label="@string/title_activity_setting_controller">
|
||||
</activity>
|
||||
<activity android:name="com.darkweb.genesissearchengine.appManager.list_activity.list_controller"
|
||||
<activity android:name="com.darkweb.genesissearchengine.appManager.list_manager.list_controller"
|
||||
android:windowSoftInputMode="adjustNothing">
|
||||
</activity>
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
|||
android:required="false"/>
|
||||
|
||||
<activity
|
||||
android:name="com.darkweb.genesissearchengine.appManager.main_activity.application_controller"
|
||||
android:name="com.darkweb.genesissearchengine.appManager.home_activity.application_controller"
|
||||
android:windowSoftInputMode="adjustNothing"
|
||||
android:screenOrientation="portrait">
|
||||
<intent-filter>
|
||||
|
|
|
@ -1,135 +0,0 @@
|
|||
package com.darkweb.genesissearchengine.appManager.data_helper;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.database.sqlite.SQLiteException;
|
||||
import android.database.sqlite.SQLiteOpenHelper;
|
||||
import com.darkweb.genesissearchengine.appManager.list_activity.list_model;
|
||||
import com.darkweb.genesissearchengine.appManager.list_activity.list_row_model;
|
||||
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class database_helper extends SQLiteOpenHelper
|
||||
{
|
||||
private Context mContext;
|
||||
private String mDbPath;
|
||||
private String mDbName;
|
||||
private int mDbVersion;
|
||||
|
||||
public SQLiteDatabase db;
|
||||
|
||||
public database_helper(Context context, String dbName, int version) {
|
||||
super(context, dbName, null, version);
|
||||
mContext = context;
|
||||
mDbPath = context.getApplicationInfo().dataDir + "/databases/";
|
||||
mDbName = dbName;
|
||||
mDbVersion = version;
|
||||
}
|
||||
|
||||
public boolean exists() {
|
||||
SQLiteDatabase db = null;
|
||||
|
||||
try {
|
||||
db = SQLiteDatabase.openDatabase(mDbPath + mDbName, null, SQLiteDatabase.OPEN_READONLY);
|
||||
}
|
||||
catch (SQLiteException e) {
|
||||
//database does not exist yet.
|
||||
}
|
||||
|
||||
if (db != null) {
|
||||
db.close();
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void openDatabase(int flag) throws SQLiteException, IOException {
|
||||
if (!exists()) {
|
||||
if (flag == SQLiteDatabase.OPEN_READONLY) {
|
||||
this.getReadableDatabase();
|
||||
} else if (flag == SQLiteDatabase.OPEN_READWRITE) {
|
||||
this.getWritableDatabase();
|
||||
}
|
||||
InputStream iStream = null;
|
||||
OutputStream oStream = null;
|
||||
try {
|
||||
iStream = mContext.getAssets().open(mDbName);
|
||||
oStream = new FileOutputStream(mDbPath + mDbName);
|
||||
byte[] buffer = new byte[1024];
|
||||
int length;
|
||||
|
||||
while ((length = iStream.read(buffer)) > 0) {
|
||||
oStream.write(buffer, 0, length);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw e;
|
||||
} finally {
|
||||
if (iStream != null) {
|
||||
iStream.close();
|
||||
}
|
||||
|
||||
if (oStream != null) {
|
||||
oStream.flush();
|
||||
oStream.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
if (flag == SQLiteDatabase.OPEN_READONLY) {
|
||||
db = SQLiteDatabase.openDatabase(mDbPath + mDbName, null,
|
||||
SQLiteDatabase.OPEN_READONLY);
|
||||
} else if (flag == SQLiteDatabase.OPEN_READWRITE) {
|
||||
db = SQLiteDatabase.openDatabase(mDbPath + mDbName, null,
|
||||
SQLiteDatabase.OPEN_READWRITE);
|
||||
}
|
||||
} catch (SQLiteException e) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void close() {
|
||||
if (db != null) {
|
||||
db.close();
|
||||
}
|
||||
super.close();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(SQLiteDatabase db) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
||||
|
||||
}
|
||||
|
||||
public void runQuery(String query)
|
||||
{
|
||||
db.execSQL(query);
|
||||
}
|
||||
|
||||
public ArrayList<list_row_model> selectHistory()
|
||||
{
|
||||
ArrayList<list_row_model> tempmodel = new ArrayList<list_row_model>();
|
||||
Cursor c = db.rawQuery("SELECT * FROM history ", null);
|
||||
if (c.moveToFirst()){
|
||||
do {
|
||||
tempmodel.add(new list_row_model(c.getString(0),c.getString(1),Integer.parseInt(c.getString(0))));
|
||||
} while(c.moveToNext());
|
||||
}
|
||||
c.close();
|
||||
///db.close();
|
||||
|
||||
return tempmodel;
|
||||
}
|
||||
}
|
|
@ -1,14 +1,11 @@
|
|||
package com.darkweb.genesissearchengine.appManager.data_helper;
|
||||
package com.darkweb.genesissearchengine.appManager.database_manager;
|
||||
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.database.sqlite.SQLiteException;
|
||||
import com.darkweb.genesissearchengine.appManager.list_activity.list_row_model;
|
||||
import com.darkweb.genesissearchengine.appManager.main_activity.app_model;
|
||||
import com.darkweb.genesissearchengine.appManager.list_manager.list_row_model;
|
||||
import com.darkweb.genesissearchengine.appManager.home_activity.app_model;
|
||||
import com.darkweb.genesissearchengine.constants.constants;
|
||||
import com.darkweb.genesissearchengine.helperMethod;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import static android.content.Context.MODE_PRIVATE;
|
||||
|
@ -32,7 +29,7 @@ public class database_controller
|
|||
{
|
||||
try
|
||||
{
|
||||
database_instance = app_model.getInstance().getAppInstance().openOrCreateDatabase("DatabaseName", MODE_PRIVATE, null);
|
||||
database_instance = app_model.getInstance().getAppInstance().openOrCreateDatabase(constants.databae_name, MODE_PRIVATE, null);
|
||||
database_instance.execSQL("CREATE TABLE IF NOT EXISTS " + "history" + " (id INT(4),date VARCHAR,url VARCHAR);");
|
||||
database_instance.execSQL("CREATE TABLE IF NOT EXISTS " + "bookmark" + " (id INT(4),title VARCHAR,url VARCHAR);");
|
||||
|
||||
|
@ -51,7 +48,7 @@ public class database_controller
|
|||
|
||||
public ArrayList<list_row_model> selectHistory()
|
||||
{
|
||||
ArrayList<list_row_model> tempmodel = new ArrayList<list_row_model>();
|
||||
ArrayList<list_row_model> tempmodel = new ArrayList<>();
|
||||
Cursor c = database_instance.rawQuery("SELECT * FROM history ORDER BY id DESC ", null);
|
||||
if (c.moveToFirst()){
|
||||
do {
|
||||
|
@ -66,7 +63,7 @@ public class database_controller
|
|||
|
||||
public ArrayList<list_row_model> selectBookmark()
|
||||
{
|
||||
ArrayList<list_row_model> tempmodel = new ArrayList<list_row_model>();
|
||||
ArrayList<list_row_model> tempmodel = new ArrayList<>();
|
||||
Cursor c = database_instance.rawQuery("SELECT * FROM bookmark ORDER BY id DESC ", null);
|
||||
|
||||
if (c.moveToFirst()){
|
|
@ -1,4 +1,4 @@
|
|||
package com.darkweb.genesissearchengine.appManager.main_activity;
|
||||
package com.darkweb.genesissearchengine.appManager.home_activity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -9,6 +9,9 @@ import android.view.ViewGroup;
|
|||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Filter;
|
||||
import android.widget.Filterable;
|
||||
import android.widget.TextView;
|
||||
import com.darkweb.genesissearchengine.appManager.list_manager.list_model;
|
||||
import com.example.myapplication.R;
|
||||
|
||||
public class AutoCompleteAdapter extends ArrayAdapter<String> implements Filterable {
|
||||
|
|
@ -1,11 +1,10 @@
|
|||
package com.darkweb.genesissearchengine.appManager.main_activity;
|
||||
package com.darkweb.genesissearchengine.appManager.home_activity;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import com.darkweb.genesissearchengine.appManager.data_helper.database_controller;
|
||||
import com.darkweb.genesissearchengine.appManager.list_activity.list_controller;
|
||||
import com.darkweb.genesissearchengine.appManager.list_activity.list_model;
|
||||
import com.darkweb.genesissearchengine.appManager.list_activity.list_row_model;
|
||||
import com.darkweb.genesissearchengine.appManager.database_manager.database_controller;
|
||||
import com.darkweb.genesissearchengine.appManager.list_manager.list_controller;
|
||||
import com.darkweb.genesissearchengine.appManager.list_manager.list_row_model;
|
||||
import com.darkweb.genesissearchengine.constants.constants;
|
||||
import com.darkweb.genesissearchengine.constants.status;
|
||||
import com.darkweb.genesissearchengine.helperMethod;
|
||||
|
@ -24,9 +23,6 @@ public class app_model
|
|||
private Context appContext;
|
||||
private application_controller appInstance;
|
||||
|
||||
private Context listContext;
|
||||
private list_controller listInstance;
|
||||
|
||||
/*Initializations*/
|
||||
public void initialization()
|
||||
{
|
||||
|
@ -50,7 +46,7 @@ public class app_model
|
|||
}
|
||||
public void setPort(int port)
|
||||
{
|
||||
this.port = port;
|
||||
app_model.port = port;
|
||||
}
|
||||
|
||||
|
||||
|
@ -100,7 +96,7 @@ public class app_model
|
|||
}
|
||||
|
||||
addSuggestions(url);
|
||||
SimpleDateFormat d_form = new SimpleDateFormat("yyyy-MM-dd | HH-mm-ss");
|
||||
SimpleDateFormat d_form = new SimpleDateFormat("dd MMMM | hh:mm a");
|
||||
String date = d_form.format(new Date());
|
||||
database_controller.getInstance().execSQL("INSERT INTO history(id,date,url) VALUES("+autoval+",'"+date+"','"+url+"');");
|
||||
history.add(0,new list_row_model(url,date,autoval));
|
||||
|
@ -139,7 +135,7 @@ public class app_model
|
|||
|
||||
|
||||
public void initSuggestions(String url) {
|
||||
suggestions.add(url);
|
||||
suggestions.add(url.replace("https://","").replace("http://",""));
|
||||
}
|
||||
public void addSuggestions(String url) {
|
||||
if(url.contains("boogle.store"))
|
||||
|
@ -148,7 +144,7 @@ public class app_model
|
|||
String actual_url = uri.getQueryParameter("q");
|
||||
suggestions.add(actual_url);
|
||||
}
|
||||
suggestions.add(url);
|
||||
suggestions.add(url.replace("https://","").replace("http://",""));
|
||||
app_model.getInstance().getAppInstance().reInitializeSuggestion();
|
||||
}
|
||||
public ArrayList<String> getSuggestions() {
|
||||
|
@ -156,19 +152,10 @@ public class app_model
|
|||
}
|
||||
|
||||
|
||||
public void setListInstance(list_controller listInstance){
|
||||
this.listInstance = listInstance;
|
||||
}
|
||||
public list_controller getListInstance(){
|
||||
return listInstance;
|
||||
}
|
||||
/*Helper Method*/
|
||||
public boolean isUrlRepeatable(String url,String viewUrl){
|
||||
return url.equals(viewUrl) && !app_model.getInstance().getAppInstance().isInternetErrorOpened() || url.contains("https://boogle.store/search?q=&");
|
||||
|
||||
|
||||
public void setListContext(Context listContext) {
|
||||
this.listContext = listContext;
|
||||
}
|
||||
public Context getListContext(){
|
||||
return listContext;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package com.darkweb.genesissearchengine.appManager.main_activity;
|
||||
package com.darkweb.genesissearchengine.appManager.home_activity;
|
||||
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
|
@ -45,10 +45,10 @@ public class application_controller extends AppCompatActivity
|
|||
protected void onCreate(Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.home_view);
|
||||
|
||||
if(helperMethod.isBuildValid())
|
||||
{
|
||||
setContentView(R.layout.home_view);
|
||||
initializeAppModel();
|
||||
preference_manager.getInstance().initialize();
|
||||
|
||||
|
@ -60,16 +60,16 @@ public class application_controller extends AppCompatActivity
|
|||
initAdManager();
|
||||
|
||||
orbot_manager.getInstance().reinitOrbot();
|
||||
applicationViewController.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();
|
||||
geckoclient.initialize(geckoView);
|
||||
geckoclient.initialize(geckoView,false);
|
||||
app_model.getInstance().initialization();
|
||||
|
||||
initSearchEngine();
|
||||
initBoogle();
|
||||
}
|
||||
else
|
||||
{
|
||||
setContentView(R.layout.invalid_setup);
|
||||
initializeAppModel();
|
||||
setContentView(R.layout.invalid_setup_view);
|
||||
message_manager.getInstance().abiError(Build.SUPPORTED_ABIS[0]);
|
||||
}
|
||||
|
||||
|
@ -80,20 +80,31 @@ public class application_controller extends AppCompatActivity
|
|||
admanager.getInstance().initialize();
|
||||
}
|
||||
|
||||
public void initSearchEngine()
|
||||
public void initBoogle()
|
||||
{
|
||||
fabricManager.getInstance().sendEvent("HOME PAGE LOADING : " );
|
||||
if(status.search_status.equals(enums.searchEngine.Google.toString()))
|
||||
onloadURL(constants.backendGenesis,false,false);
|
||||
}
|
||||
|
||||
public Boolean initSearchEngine()
|
||||
{
|
||||
if(status.search_status.equals(enums.searchEngine.Bing.toString()))
|
||||
{
|
||||
webView.loadUrl(constants.backendGoogle);
|
||||
geckoclient.setRootEngine(constants.backendBing);
|
||||
webView.stopLoading();
|
||||
onloadURL(constants.backendBing,true,false);
|
||||
return false;
|
||||
}
|
||||
else if(status.search_status.equals(enums.searchEngine.Bing.toString()))
|
||||
else if(status.search_status.equals(enums.searchEngine.Google.toString()))
|
||||
{
|
||||
webView.loadUrl(constants.backendBing);
|
||||
geckoclient.setRootEngine(constants.backendGoogle);
|
||||
webView.stopLoading();
|
||||
onloadURL(constants.backendGoogle,true,false);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
webView.loadUrl(constants.backendGenesis);
|
||||
onloadURL(constants.backendGenesis,false,false);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -137,7 +148,7 @@ public class application_controller extends AppCompatActivity
|
|||
public void setWebViewSettings(WebView view)
|
||||
{
|
||||
view.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
|
||||
view.getSettings().setJavaScriptEnabled(false);
|
||||
view.getSettings().setJavaScriptEnabled(status.java_status);
|
||||
view.getSettings().setUseWideViewPort(true);
|
||||
}
|
||||
|
||||
|
@ -183,7 +194,7 @@ public class application_controller extends AppCompatActivity
|
|||
{
|
||||
geckoclient.loadGeckoURL(url,geckoView,isUrlSavable);
|
||||
}
|
||||
else
|
||||
else if(!app_model.getInstance().isUrlRepeatable(url,webView.getUrl()) || webView.getVisibility() == View.GONE)
|
||||
{
|
||||
webView.loadUrl(url);
|
||||
onRequestTriggered(isHiddenWeb,url);
|
||||
|
@ -191,76 +202,84 @@ public class application_controller extends AppCompatActivity
|
|||
}
|
||||
|
||||
public void onRequestTriggered(boolean isHiddenWeb,String url) {
|
||||
applicationViewController.getInstance().onRequestTriggered(isHiddenWeb,url);
|
||||
viewController.getInstance().onRequestTriggered(isHiddenWeb,url);
|
||||
}
|
||||
|
||||
public void onClearSearchBarCursorView()
|
||||
{
|
||||
applicationViewController.getInstance().onClearSearchBarCursor();
|
||||
viewController.getInstance().onClearSearchBarCursor();
|
||||
}
|
||||
|
||||
public void onUpdateSearchBarView(String url)
|
||||
{
|
||||
applicationViewController.getInstance().onUpdateSearchBar(url);
|
||||
viewController.getInstance().onUpdateSearchBar(url);
|
||||
}
|
||||
|
||||
public void onInternetErrorView() {
|
||||
applicationViewController.getInstance().onInternetError();
|
||||
applicationViewController.getInstance().disableFloatingView();
|
||||
viewController.getInstance().onInternetError();
|
||||
viewController.getInstance().disableFloatingView();
|
||||
}
|
||||
|
||||
public boolean onDisableInternetError()
|
||||
{
|
||||
return applicationViewController.getInstance().onDisableInternetError();
|
||||
return viewController.getInstance().onDisableInternetError();
|
||||
}
|
||||
|
||||
public void onProgressBarUpdateView(int progress) {
|
||||
applicationViewController.getInstance().onProgressBarUpdate(progress);
|
||||
viewController.getInstance().onProgressBarUpdate(progress);
|
||||
}
|
||||
|
||||
public void onBackPressedView()
|
||||
{
|
||||
applicationViewController.getInstance().onBackPressed();
|
||||
viewController.getInstance().onBackPressed();
|
||||
}
|
||||
|
||||
public void onPageFinished(boolean isHidden)
|
||||
{
|
||||
applicationViewController.getInstance().onPageFinished(isHidden);
|
||||
viewController.getInstance().onPageFinished(isHidden);
|
||||
}
|
||||
|
||||
public void onUpdateView(boolean status)
|
||||
{
|
||||
applicationViewController.getInstance().onUpdateView(status);
|
||||
viewController.getInstance().onUpdateView(status);
|
||||
}
|
||||
|
||||
public void onReload()
|
||||
{
|
||||
applicationViewController.getInstance().onReload();
|
||||
viewController.getInstance().onReload();
|
||||
}
|
||||
|
||||
public void onShowAds()
|
||||
public void onShowAd(enums.adID id)
|
||||
{
|
||||
applicationViewController.getInstance().onShowAds();
|
||||
admanager.getInstance().showAd(id);
|
||||
}
|
||||
|
||||
public void openMenu(View view) {
|
||||
applicationViewController.getInstance().openMenu(view);
|
||||
|
||||
viewController.getInstance().openMenu(view);
|
||||
}
|
||||
|
||||
public void reInitializeSuggestion() {
|
||||
applicationViewController.getInstance().reInitializeSuggestion();
|
||||
viewController.getInstance().reInitializeSuggestion();
|
||||
}
|
||||
|
||||
public void hideSplashScreen(){
|
||||
viewController.getInstance().hideSplashScreen();
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------Helper Method Out UI Redirection----------------------------------------------------*/
|
||||
|
||||
public String getSearchBarUrl()
|
||||
{
|
||||
return applicationViewController.getInstance().getSearchBarUrl();
|
||||
return viewController.getInstance().getSearchBarUrl();
|
||||
}
|
||||
|
||||
public void onReInitGeckoView() {
|
||||
geckoclient.initialize(geckoView);
|
||||
geckoclient.onReloadHiddenView();
|
||||
geckoclient.initialize(geckoView,true);
|
||||
if(webView.getVisibility() != View.VISIBLE)
|
||||
{
|
||||
geckoclient.onReloadHiddenView();
|
||||
}
|
||||
}
|
||||
|
||||
public void onHiddenGoBack()
|
||||
|
@ -268,9 +287,14 @@ public class application_controller extends AppCompatActivity
|
|||
geckoclient.onHiddenGoBack(geckoView);
|
||||
}
|
||||
|
||||
public void stopHiddenView() {
|
||||
geckoclient.stopHiddenView(geckoView);
|
||||
geckoclient.removeHistory();
|
||||
public int getHiddenQueueLength()
|
||||
{
|
||||
return geckoclient.getHiddenQueueLength();
|
||||
}
|
||||
|
||||
public void stopHiddenView(boolean releaseView) {
|
||||
geckoclient.stopHiddenView(geckoView,releaseView);
|
||||
//geckoclient.removeHistory();
|
||||
}
|
||||
|
||||
public void onReloadHiddenView()
|
|
@ -1,11 +1,12 @@
|
|||
package com.darkweb.genesissearchengine.appManager.main_activity;
|
||||
package com.darkweb.genesissearchengine.appManager.home_activity;
|
||||
|
||||
import android.util.Log;
|
||||
import android.util.Patterns;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.TextView;
|
||||
import com.darkweb.genesissearchengine.appManager.list_activity.list_controller;
|
||||
import com.darkweb.genesissearchengine.appManager.list_manager.list_controller;
|
||||
import com.darkweb.genesissearchengine.appManager.setting_manager.setting_controller;
|
||||
import com.darkweb.genesissearchengine.constants.constants;
|
||||
import com.darkweb.genesissearchengine.constants.enums;
|
||||
|
@ -100,12 +101,11 @@ public class eventHandler
|
|||
|
||||
public void onHomeButtonPressed()
|
||||
{
|
||||
appContoller.stopHiddenView();
|
||||
appContoller.stopHiddenView(true);
|
||||
fabricManager.getInstance().sendEvent("HOME BUTTON PRESSSED : ");
|
||||
applicationViewController.getInstance().checkSSLTextColor();
|
||||
viewController.getInstance().checkSSLTextColor();
|
||||
appContoller.initSearchEngine();
|
||||
helperMethod.hideKeyboard();
|
||||
appContoller.onUpdateSearchBarView(constants.frontUrlSlashed);
|
||||
}
|
||||
|
||||
public void onFloatingButtonPressed()
|
|
@ -1,47 +1,44 @@
|
|||
package com.darkweb.genesissearchengine.appManager.main_activity;
|
||||
package com.darkweb.genesissearchengine.appManager.home_activity;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import com.darkweb.genesissearchengine.constants.keys;
|
||||
import com.darkweb.genesissearchengine.constants.status;
|
||||
import com.darkweb.genesissearchengine.constants.*;
|
||||
import com.darkweb.genesissearchengine.dataManager.preference_manager;
|
||||
import com.darkweb.genesissearchengine.helperMethod;
|
||||
import com.darkweb.genesissearchengine.pluginManager.fabricManager;
|
||||
import com.darkweb.genesissearchengine.pluginManager.message_manager;
|
||||
import com.darkweb.genesissearchengine.pluginManager.orbot_manager;
|
||||
import org.mozilla.geckoview.GeckoResult;
|
||||
import org.mozilla.geckoview.GeckoRuntime;
|
||||
import org.mozilla.geckoview.GeckoSession;
|
||||
import org.mozilla.geckoview.GeckoView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class geckoClients
|
||||
class geckoClients
|
||||
{
|
||||
private GeckoSession session1 = null;
|
||||
private GeckoRuntime runtime1;
|
||||
private final Handler internetErrorHandler = new Handler();
|
||||
private ArrayList<String> urlList = new ArrayList<>();
|
||||
|
||||
boolean canSessionGoBack = false;
|
||||
boolean isRunning = false;
|
||||
boolean isContentLoading = false;
|
||||
String navigatedURL = "";
|
||||
boolean isFirstTimeLoad = true;
|
||||
ArrayList<String> urlList = new ArrayList<>();
|
||||
private boolean isRunning = false;
|
||||
private boolean isContentLoading = false;
|
||||
private String navigatedURL = "";
|
||||
private boolean isFirstTimeLoad = true;
|
||||
|
||||
private boolean loadingCompeleted = false;
|
||||
private String currentURL = "";
|
||||
private boolean wasBackPressed = false;
|
||||
private boolean isUrlSavable = true;
|
||||
|
||||
private int urlRequestCount = 0;
|
||||
private boolean isAppRated = false;
|
||||
|
||||
public geckoClients()
|
||||
geckoClients()
|
||||
{
|
||||
isAppRated = preference_manager.getInstance().getBool(keys.isAppRated,false);
|
||||
}
|
||||
|
||||
public void loadGeckoURL(String url,GeckoView geckoView,boolean isUrlSavable)
|
||||
void loadGeckoURL(String url,GeckoView geckoView,boolean isUrlSavable)
|
||||
{
|
||||
boolean init_status = orbot_manager.getInstance().initOrbot(url);
|
||||
if (init_status)
|
||||
|
@ -49,7 +46,7 @@ public class geckoClients
|
|||
this.isUrlSavable = isUrlSavable;
|
||||
navigatedURL = "";
|
||||
loadingCompeleted = false;
|
||||
initialize(geckoView);
|
||||
initialize(geckoView,false);
|
||||
session1.loadUri(url);
|
||||
app_model.getInstance().getAppInstance().onRequestTriggered(true,url);
|
||||
app_model.getInstance().getAppInstance().onProgressBarUpdateView(4);
|
||||
|
@ -61,12 +58,12 @@ public class geckoClients
|
|||
}
|
||||
}
|
||||
|
||||
public void initialize(GeckoView geckoView)
|
||||
void initialize(GeckoView geckoView,boolean release)
|
||||
{
|
||||
if(urlList.size()<=0)
|
||||
if(urlList.size()<=0 || release)
|
||||
{
|
||||
session1 = new GeckoSession();
|
||||
runtime1 = GeckoRuntime.getDefault(app_model.getInstance().getAppContext());
|
||||
GeckoRuntime runtime1 = GeckoRuntime.getDefault(app_model.getInstance().getAppContext());
|
||||
runtime1.getSettings().setJavaScriptEnabled(status.java_status);
|
||||
session1.open(runtime1);
|
||||
geckoView.releaseSession();
|
||||
|
@ -87,10 +84,12 @@ public class geckoClients
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onCanGoBack(GeckoSession session, boolean canGoBack)
|
||||
public GeckoResult<GeckoSession> onNewSession(GeckoSession session, String uri)
|
||||
{
|
||||
canSessionGoBack = canGoBack;
|
||||
session1.loadUri(uri);
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class progressDelegate implements GeckoSession.ProgressDelegate
|
||||
|
@ -101,20 +100,11 @@ public class geckoClients
|
|||
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;
|
||||
}
|
||||
else
|
||||
{
|
||||
isContentLoading = true;
|
||||
}
|
||||
isContentLoading = !navigatedURL.equals(url);
|
||||
|
||||
Log.i("SHITJ2",""+navigatedURL + "--" + currentURL + "--" + isContentLoading);
|
||||
navigatedURL = url;
|
||||
}
|
||||
|
||||
|
@ -123,12 +113,17 @@ public class geckoClients
|
|||
{
|
||||
internetErrorHandler.removeCallbacksAndMessages(null);
|
||||
|
||||
internetErrorHandler.postDelayed(new Runnable() {
|
||||
internetErrorHandler.postDelayed(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if(loadingCompeleted)
|
||||
{
|
||||
if(isFirstTimeLoad)
|
||||
{
|
||||
app_model.getInstance().getAppInstance().hideSplashScreen();
|
||||
}
|
||||
if(!success && !isContentLoading)
|
||||
{
|
||||
app_model.getInstance().getAppInstance().onPageFinished(true);
|
||||
|
@ -137,21 +132,11 @@ public class geckoClients
|
|||
}
|
||||
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)
|
||||
if((urlList.size() == 0 || !urlList.get(urlList.size() - 1).equals(navigatedURL)) && !wasBackPressed)
|
||||
{
|
||||
urlList.add(navigatedURL);
|
||||
}
|
||||
|
||||
if(urlList.size()>0)
|
||||
{
|
||||
//admanager.getInstance().showAd(false);
|
||||
}
|
||||
urlRequestCount++;
|
||||
if(urlRequestCount==5)
|
||||
{
|
||||
|
@ -161,9 +146,16 @@ public class geckoClients
|
|||
message_manager.getInstance().rateApp();
|
||||
}
|
||||
}
|
||||
else if(urlRequestCount>=4 && isAppRated)
|
||||
else if(isAppRated)
|
||||
{
|
||||
app_model.getInstance().getAppInstance().onShowAds();
|
||||
if(isFirstTimeLoad)
|
||||
{
|
||||
app_model.getInstance().getAppInstance().onShowAd(enums.adID.hidden);
|
||||
}
|
||||
else
|
||||
{
|
||||
app_model.getInstance().getAppInstance().onShowAd(enums.adID.internal);
|
||||
}
|
||||
}
|
||||
|
||||
if(isUrlSavable && !urlList.get(urlList.size()-1).equals("navigatedURL"))
|
||||
|
@ -176,6 +168,7 @@ public class geckoClients
|
|||
fabricManager.getInstance().sendEvent("ONION GECKO_CLIENT URL SUCCESS : " + success + "--" + isContentLoading);
|
||||
app_model.getInstance().getAppInstance().onPageFinished(true);
|
||||
}
|
||||
isFirstTimeLoad = false;
|
||||
}
|
||||
}
|
||||
}, 500);
|
||||
|
@ -191,8 +184,7 @@ public class geckoClients
|
|||
loadingCompeleted = true;
|
||||
isContentLoading = false;
|
||||
}
|
||||
|
||||
if(progress>=5)
|
||||
else if(progress>=5)
|
||||
{
|
||||
app_model.getInstance().getAppInstance().onProgressBarUpdateView(progress);
|
||||
}
|
||||
|
@ -209,7 +201,7 @@ public class geckoClients
|
|||
|
||||
}
|
||||
|
||||
public void onHiddenGoBack(GeckoView geckoView)
|
||||
void onHiddenGoBack(GeckoView geckoView)
|
||||
{
|
||||
if(urlList.size()>1)
|
||||
{
|
||||
|
@ -221,19 +213,24 @@ public class geckoClients
|
|||
}
|
||||
else if(isRunning)
|
||||
{
|
||||
if(urlList.size()>0)
|
||||
if(navigatedURL.equals(constants.backendGoogle) && status.search_status.equals(strings.google_text) || navigatedURL.equals(constants.backendBing) && status.search_status.equals(strings.bing_text))
|
||||
{
|
||||
urlList.remove(urlList.size()-1);
|
||||
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();
|
||||
}
|
||||
stopHiddenView(geckoView);
|
||||
app_model.getInstance().getAppInstance().onUpdateView(true);
|
||||
app_model.getInstance().getAppInstance().onDisableInternetError();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void stopHiddenView(GeckoView geckoView)
|
||||
void stopHiddenView(GeckoView geckoView,boolean releaseView)
|
||||
{
|
||||
if(session1!=null)
|
||||
{
|
||||
|
@ -241,30 +238,38 @@ public class geckoClients
|
|||
loadingCompeleted = false;
|
||||
|
||||
session1.stop();
|
||||
session1.close();
|
||||
if(!releaseView)
|
||||
{
|
||||
session1.close();
|
||||
}
|
||||
}
|
||||
|
||||
geckoView.releaseSession();
|
||||
|
||||
}
|
||||
|
||||
public void removeHistory()
|
||||
int getHiddenQueueLength()
|
||||
{
|
||||
urlList.clear();
|
||||
return urlList.size();
|
||||
}
|
||||
|
||||
public boolean isGeckoViewRunning()
|
||||
void setRootEngine(String url)
|
||||
{
|
||||
if(urlList.size()>1)
|
||||
{
|
||||
urlList.set(0,url);
|
||||
}
|
||||
}
|
||||
|
||||
boolean isGeckoViewRunning()
|
||||
{
|
||||
return isRunning;
|
||||
}
|
||||
|
||||
public void onReloadHiddenView()
|
||||
void onReloadHiddenView()
|
||||
{
|
||||
if(urlList.size()>0)
|
||||
{
|
||||
wasBackPressed = true;
|
||||
session1.stop();
|
||||
session1.loadUri(navigatedURL);
|
||||
session1.loadUri(urlList.get(urlList.size()-1));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
package com.darkweb.genesissearchengine.appManager.main_activity;
|
||||
package com.darkweb.genesissearchengine.appManager.home_activity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Handler;
|
||||
|
@ -9,17 +10,12 @@ import android.text.SpannableString;
|
|||
import android.text.Spanned;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.util.Log;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.view.*;
|
||||
import android.webkit.WebView;
|
||||
import android.widget.*;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.core.view.MenuCompat;
|
||||
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.constants.*;
|
||||
import com.darkweb.genesissearchengine.dataManager.preference_manager;
|
||||
import com.darkweb.genesissearchengine.helperMethod;
|
||||
import com.darkweb.genesissearchengine.httpManager.serverRequestManager;
|
||||
|
@ -29,9 +25,7 @@ import com.darkweb.genesissearchengine.pluginManager.orbot_manager;
|
|||
import com.example.myapplication.R;
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class applicationViewController
|
||||
public class viewController
|
||||
{
|
||||
/*ViewControllers*/
|
||||
private WebView webView;
|
||||
|
@ -54,14 +48,14 @@ public class applicationViewController
|
|||
Handler progressBarHandler = null;
|
||||
|
||||
/*Initializations*/
|
||||
private static final applicationViewController ourInstance = new applicationViewController();
|
||||
private static final viewController ourInstance = new viewController();
|
||||
|
||||
public static applicationViewController getInstance()
|
||||
public static viewController getInstance()
|
||||
{
|
||||
return ourInstance;
|
||||
}
|
||||
|
||||
private applicationViewController()
|
||||
private viewController()
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -88,15 +82,23 @@ public class applicationViewController
|
|||
|
||||
private void initializeSuggestionView()
|
||||
{
|
||||
suggestionAdapter = new AutoCompleteAdapter(app_model.getInstance().getAppInstance(), R.layout.hint_completion_layout, R.id.hintCompletionText,app_model.getInstance().getSuggestions());
|
||||
suggestionAdapter = new AutoCompleteAdapter(app_model.getInstance().getAppInstance(), R.layout.hint_view, R.id.hintCompletionHeader,app_model.getInstance().getSuggestions());
|
||||
|
||||
int width = Math.round(helperMethod.screenWidth());
|
||||
searchbar.setThreshold(2);
|
||||
searchbar.setAdapter(suggestionAdapter);
|
||||
searchbar.setDropDownVerticalOffset(27);
|
||||
searchbar.setDropDownWidth(helperMethod.screenWidth()-80);
|
||||
searchbar.setDropDownHorizontalOffset(-88);
|
||||
searchbar.setDropDownHeight(Math.round(helperMethod.screenHeight(false)*0.35f));
|
||||
searchbar.setDropDownBackgroundDrawable(app_model.getInstance().getAppInstance().getResources().getDrawable(R.drawable.rouned_corner));
|
||||
searchbar.setDropDownVerticalOffset(22);
|
||||
searchbar.setDropDownWidth(Math.round(width*0.95f));
|
||||
searchbar.setDropDownHorizontalOffset(Math.round(width*0.114f)*-1);
|
||||
|
||||
Drawable drawable;
|
||||
Resources res = app_model.getInstance().getAppInstance().getResources();
|
||||
try {
|
||||
drawable = Drawable.createFromXml(res, res.getXml(R.xml.rouned_corner));
|
||||
searchbar.setDropDownBackgroundDrawable(drawable);
|
||||
} catch (Exception ex) {
|
||||
Log.i("sdfsdf", ex.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -163,11 +165,11 @@ public class applicationViewController
|
|||
try
|
||||
{
|
||||
boolean isFirstInstall = preference_manager.getInstance().getBool(keys.hasOrbotInstalled,true);
|
||||
//while (!status.isTorInitialized && isFirstInstall)
|
||||
//{
|
||||
// startPostTask(messages.UPDATE_LOADING_TEXT);
|
||||
// sleep(100);
|
||||
//}
|
||||
while (!status.isTorInitialized && (isFirstInstall || status.search_status.equals(enums.searchEngine.Google.toString()) || status.search_status.equals(enums.searchEngine.Bing.toString())))
|
||||
{
|
||||
startPostTask(messages.UPDATE_LOADING_TEXT);
|
||||
sleep(100);
|
||||
}
|
||||
preference_manager.getInstance().setBool(keys.hasOrbotInstalled,false);
|
||||
startPostTask(messages.DISABLE_SPLASH_SCREEN);
|
||||
}
|
||||
|
@ -201,10 +203,12 @@ public class applicationViewController
|
|||
}
|
||||
else 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();
|
||||
//app_model.getInstance().getAppInstance().initAdManager();
|
||||
boolean e_status = app_model.getInstance().getAppInstance().initSearchEngine();
|
||||
|
||||
if(e_status)
|
||||
{
|
||||
hideSplashScreen();
|
||||
}
|
||||
}
|
||||
else if(msg.what == messages.SHOW_ADS)
|
||||
{
|
||||
|
@ -214,11 +218,18 @@ public class applicationViewController
|
|||
};
|
||||
}
|
||||
|
||||
public void hideSplashScreen()
|
||||
{
|
||||
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)));;
|
||||
requestFailure.animate().alpha(0f).setDuration(150).withEndAction((() -> requestFailure.setVisibility(View.INVISIBLE)));
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
@ -242,14 +253,14 @@ public class applicationViewController
|
|||
}
|
||||
//onUpdateSearchBar(webView.getUrl());
|
||||
disableSplashScreen();
|
||||
floatingButton.animate().alpha(0).withEndAction((() -> floatingButton.setVisibility(View.GONE)));;
|
||||
floatingButton.animate().alpha(0).withEndAction((() -> floatingButton.setVisibility(View.GONE)));
|
||||
|
||||
app_model.getInstance().getAppInstance().stopHiddenView();
|
||||
app_model.getInstance().getAppInstance().stopHiddenView(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
onUpdateView(false);
|
||||
floatingButton.animate().alpha(1).withEndAction((() -> floatingButton.setVisibility(View.VISIBLE)));;
|
||||
floatingButton.animate().alpha(1).withEndAction((() -> floatingButton.setVisibility(View.VISIBLE)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -287,7 +298,7 @@ public class applicationViewController
|
|||
|
||||
public void disableFloatingView()
|
||||
{
|
||||
floatingButton.animate().alpha(0).withEndAction((() -> floatingButton.setVisibility(View.GONE)));;
|
||||
floatingButton.animate().alpha(0).withEndAction((() -> floatingButton.setVisibility(View.GONE)));
|
||||
|
||||
}
|
||||
|
||||
|
@ -309,28 +320,49 @@ public class applicationViewController
|
|||
|
||||
public void onProgressBarUpdate(int progress)
|
||||
{
|
||||
progressBar.setVisibility(View.VISIBLE);
|
||||
if(progress==0)
|
||||
{
|
||||
progressBar.animate().alpha(0).withEndAction((() -> progressBar.setProgress(progress)));
|
||||
}
|
||||
else
|
||||
else if(splashScreen.getVisibility() == View.GONE)
|
||||
{
|
||||
progressBar.setProgress(progress);
|
||||
if(progressBar.getVisibility()==View.INVISIBLE)
|
||||
{
|
||||
progressBar.setProgress(4);
|
||||
}
|
||||
else
|
||||
{
|
||||
progressBar.setProgress(progress);
|
||||
}
|
||||
progressBar.setVisibility(View.VISIBLE);
|
||||
progressBar.setAlpha(1);
|
||||
}
|
||||
}
|
||||
|
||||
public void onBackPressed()
|
||||
{
|
||||
if(!isHiddenView())
|
||||
if(webView.getVisibility() == View.VISIBLE)
|
||||
{
|
||||
webView.goBack();
|
||||
webView.bringToFront();
|
||||
webView.setAlpha(1);
|
||||
webView.setVisibility(View.VISIBLE);
|
||||
requestFailure.animate().alpha(0f).setDuration(200).withEndAction((() -> requestFailure.setVisibility(View.INVISIBLE)));
|
||||
onUpdateSearchBar(webView.getUrl());
|
||||
if(!webView.canGoBack())
|
||||
{
|
||||
if(app_model.getInstance().getAppInstance().getHiddenQueueLength()>0)
|
||||
{
|
||||
onUpdateView(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
helperMethod.onMinimizeApp();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
webView.goBack();
|
||||
webView.bringToFront();
|
||||
webView.setAlpha(1);
|
||||
webView.setVisibility(View.VISIBLE);
|
||||
requestFailure.animate().alpha(0f).setDuration(200).withEndAction((() -> requestFailure.setVisibility(View.INVISIBLE)));
|
||||
onUpdateSearchBar(webView.getUrl());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -342,7 +374,7 @@ public class applicationViewController
|
|||
{
|
||||
if(status)
|
||||
{
|
||||
floatingButton.animate().alpha(0).withEndAction((() -> floatingButton.setVisibility(View.GONE)));;
|
||||
floatingButton.animate().alpha(0).withEndAction((() -> floatingButton.setVisibility(View.GONE)));
|
||||
webView.setAlpha(1);
|
||||
webView.setVisibility(View.VISIBLE);
|
||||
webView.bringToFront();
|
||||
|
@ -371,11 +403,19 @@ public class applicationViewController
|
|||
|
||||
public void openMenu(View view)
|
||||
{
|
||||
PopupMenu popup = new PopupMenu(app_model.getInstance().getAppInstance(), view);
|
||||
LinearLayout parentView = (LinearLayout)view.getParent();
|
||||
|
||||
PopupMenu popup = new PopupMenu(app_model.getInstance().getAppInstance(), parentView,Gravity.RIGHT);
|
||||
MenuInflater inflater = popup.getMenuInflater();
|
||||
inflater.inflate(R.menu.menu_main, popup.getMenu());
|
||||
MenuCompat.setGroupDividerEnabled(popup.getMenu(), true);
|
||||
popup.setOnMenuItemClickListener(item ->
|
||||
{
|
||||
app_model.getInstance().getAppInstance().onMenuOptionSelected(item);
|
||||
return true;
|
||||
});
|
||||
popup.show();
|
||||
view.bringToFront();
|
||||
}
|
||||
|
||||
public void onReload()
|
|
@ -1,9 +1,10 @@
|
|||
package com.darkweb.genesissearchengine.appManager.main_activity;
|
||||
package com.darkweb.genesissearchengine.appManager.home_activity;
|
||||
|
||||
import android.webkit.WebChromeClient;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import com.darkweb.genesissearchengine.constants.constants;
|
||||
import com.darkweb.genesissearchengine.constants.enums;
|
||||
import com.darkweb.genesissearchengine.constants.status;
|
||||
import com.darkweb.genesissearchengine.pluginManager.fabricManager;
|
||||
import com.darkweb.genesissearchengine.pluginManager.orbot_manager;
|
||||
|
@ -20,14 +21,14 @@ public class webviewClient
|
|||
public boolean shouldOverrideUrlLoading(WebView view, String url)
|
||||
{
|
||||
isGeckoView = false;
|
||||
if(url.equals(view.getUrl()) && !app_model.getInstance().getAppInstance().isInternetErrorOpened() || url.contains("https://boogle.store/search?q=&"))
|
||||
if(app_model.getInstance().isUrlRepeatable(url,view.getUrl()))
|
||||
{
|
||||
app_model.getInstance().getAppInstance().onProgressBarUpdateView(0);
|
||||
return true;
|
||||
}
|
||||
if(!url.contains("boogle") && !url.equals(constants.backendGoogle) && !url.equals(constants.backendBing))
|
||||
if(!url.contains("boogle"))
|
||||
{
|
||||
app_model.getInstance().getAppInstance().stopHiddenView();
|
||||
app_model.getInstance().getAppInstance().stopHiddenView(false);
|
||||
fabricManager.getInstance().sendEvent("BASE SIMPLE SEARCHED : " + url);
|
||||
isGeckoView = true;
|
||||
if(orbot_manager.getInstance().initOrbot(url))
|
|
@ -1,159 +0,0 @@
|
|||
package com.darkweb.genesissearchengine.appManager.list_activity;
|
||||
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.*;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.darkweb.genesissearchengine.appManager.data_helper.database_controller;
|
||||
import com.darkweb.genesissearchengine.appManager.main_activity.app_model;
|
||||
import com.darkweb.genesissearchengine.constants.constants;
|
||||
import com.darkweb.genesissearchengine.helperMethod;
|
||||
import com.darkweb.genesissearchengine.pluginManager.orbot_manager;
|
||||
import com.example.myapplication.R;
|
||||
|
||||
public class list_adapter extends RecyclerView.Adapter<list_adapter.listViewHolder>
|
||||
{
|
||||
private ImageView empty_list;
|
||||
private list_controller controller;
|
||||
|
||||
public list_adapter()
|
||||
{
|
||||
}
|
||||
|
||||
public void initialize(ImageView empty_list,list_controller controller)
|
||||
{
|
||||
this.empty_list = empty_list;
|
||||
this.controller = controller;
|
||||
}
|
||||
|
||||
@Override
|
||||
public listViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_manager_row, parent, false);
|
||||
listViewHolder viewHolder = new listViewHolder(view);
|
||||
return viewHolder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(list_adapter.listViewHolder holder, int position)
|
||||
{
|
||||
holder.bindListView(list_model.getInstance().getModel().get(position));
|
||||
clearMessageItem(holder.messageButton,holder.empty_message,position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list_model.getInstance().getModel().size();
|
||||
}
|
||||
|
||||
public class listViewHolder extends RecyclerView.ViewHolder
|
||||
{
|
||||
public TextView heaaderText;
|
||||
public TextView descriptionText;
|
||||
public ImageButton messageButton;
|
||||
public ImageView empty_message;
|
||||
|
||||
public listViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
}
|
||||
|
||||
public void bindListView(list_row_model model) {
|
||||
|
||||
heaaderText = itemView.findViewById(R.id.header);
|
||||
descriptionText = itemView.findViewById(R.id.description);
|
||||
|
||||
String header = model.getHeader();
|
||||
descriptionText.setText(model.getDescription());
|
||||
|
||||
if(model.getHeader().length()<=2)
|
||||
{
|
||||
header = model.getDescription() + model.getHeader();
|
||||
}
|
||||
heaaderText.setText(header);
|
||||
|
||||
|
||||
messageButton = itemView.findViewById(R.id.message_button);
|
||||
empty_message = itemView.findViewById(R.id.empty_list);
|
||||
|
||||
setItemViewOnClickListener(itemView,header);
|
||||
}
|
||||
}
|
||||
|
||||
public void setItemViewOnClickListener(View itemView,String url)
|
||||
{
|
||||
itemView.setOnClickListener(new View.OnClickListener(){
|
||||
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
|
||||
String tempurl = url;
|
||||
isValidUrl(tempurl);
|
||||
controller.finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public boolean isValidUrl(String url)
|
||||
{
|
||||
url = helperMethod.completeURL(url);
|
||||
|
||||
if(!url.contains("boogle") && !url.equals(constants.backendGoogle) && !url.equals(constants.backendBing))
|
||||
{
|
||||
if(orbot_manager.getInstance().initOrbot(url))
|
||||
{
|
||||
app_model.getInstance().getAppInstance().onloadURL(url,true,false);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
app_model.getInstance().getAppInstance().onloadURL(url,false,false);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public void clearMessageItem(ImageButton messageButton,ImageView view,int index)
|
||||
{
|
||||
ImageView newview = view;
|
||||
messageButton.setOnClickListener(new View.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
deleteFromDatabase(list_model.getInstance().getModel().get(index).getId());
|
||||
list_model.getInstance().getModel().remove(index);
|
||||
list_model.getInstance().removeFromMainList(list_model.getInstance().getIndex().get(index));
|
||||
list_model.getInstance().removeIndex(index);
|
||||
list_adapter.this.notifyItemRemoved(index);
|
||||
list_adapter.this.notifyDataSetChanged();
|
||||
isListEmpty(newview);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void deleteFromDatabase(int index)
|
||||
{
|
||||
String table="bookmark";
|
||||
if(list_model.getInstance().getType()==constants.list_history)
|
||||
{
|
||||
table = "history";
|
||||
}
|
||||
Log.i("dgfdfg","delete from "+table+" where id="+index);
|
||||
database_controller.getInstance().execSQL("delete from "+table+" where id="+index);
|
||||
}
|
||||
|
||||
public void isListEmpty(ImageView view)
|
||||
{
|
||||
if(list_model.getInstance().getModel().size()<=0)
|
||||
{
|
||||
empty_list.setAlpha(0f);
|
||||
empty_list.setVisibility(View.VISIBLE);
|
||||
empty_list.animate().alpha(1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -1,152 +0,0 @@
|
|||
package com.darkweb.genesissearchengine.appManager.list_activity;
|
||||
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import android.os.Bundle;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.darkweb.genesissearchengine.appManager.data_helper.database_controller;
|
||||
import com.darkweb.genesissearchengine.appManager.main_activity.app_model;
|
||||
import com.darkweb.genesissearchengine.constants.constants;
|
||||
import com.darkweb.genesissearchengine.constants.keys;
|
||||
import com.darkweb.genesissearchengine.pluginManager.message_manager;
|
||||
import com.example.myapplication.R;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class list_controller extends AppCompatActivity
|
||||
{
|
||||
private ImageView empty_list;
|
||||
private EditText search_bar;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_app_list_manager);
|
||||
|
||||
initializeListInstance();
|
||||
initializeListModel();
|
||||
initializeListController();
|
||||
initSearchBar();
|
||||
updatelist();
|
||||
}
|
||||
|
||||
public void initializeListInstance()
|
||||
{
|
||||
app_model.getInstance().setListInstance(this);
|
||||
app_model.getInstance().setListContext(this);
|
||||
}
|
||||
|
||||
|
||||
public void initializeListModel()
|
||||
{
|
||||
Bundle bundle = getIntent().getExtras();
|
||||
if(bundle.getInt(keys.list_type)==constants.list_bookmark)
|
||||
{
|
||||
list_model.getInstance().setType(constants.list_bookmark);
|
||||
list_model.getInstance().setMainList(app_model.getInstance().getBookmark());
|
||||
}
|
||||
else
|
||||
{
|
||||
list_model.getInstance().setType(constants.list_history);
|
||||
list_model.getInstance().setMainList(app_model.getInstance().getHistory());
|
||||
}
|
||||
}
|
||||
|
||||
public void initializeListController()
|
||||
{
|
||||
empty_list = findViewById(R.id.empty_list);
|
||||
search_bar = findViewById(R.id.search);
|
||||
RecyclerView list_view = findViewById(R.id.listview);
|
||||
|
||||
list_adapter adapter = new list_adapter();
|
||||
adapter.initialize(empty_list,this);
|
||||
list_view.setAdapter(adapter);
|
||||
list_view.setLayoutManager(new LinearLayoutManager(this));
|
||||
isListEmpty();
|
||||
}
|
||||
|
||||
public void clearHistory(View view)
|
||||
{
|
||||
if(app_model.getInstance().getHistory().size()>0)
|
||||
{
|
||||
message_manager.getInstance().clearData();
|
||||
}
|
||||
}
|
||||
|
||||
public void clearAll()
|
||||
{
|
||||
list_model.getInstance().getModel().clear();
|
||||
list_model.getInstance().getMainList().clear();
|
||||
initializeListController();
|
||||
|
||||
empty_list.setAlpha(0f);
|
||||
empty_list.setVisibility(View.VISIBLE);
|
||||
empty_list.animate().alpha(1);
|
||||
search_bar.setText("");
|
||||
|
||||
String table="bookmark";
|
||||
if(list_model.getInstance().getType()==constants.list_history)
|
||||
{
|
||||
table = "history";
|
||||
}
|
||||
database_controller.getInstance().execSQL("delete from "+table+" where 1");
|
||||
|
||||
}
|
||||
|
||||
public void isListEmpty()
|
||||
{
|
||||
if(list_model.getInstance().getModel().size()<=0)
|
||||
{
|
||||
empty_list.setVisibility(View.VISIBLE);
|
||||
}
|
||||
else
|
||||
{
|
||||
empty_list.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void initSearchBar()
|
||||
{
|
||||
search_bar.setOnEditorActionListener((v, actionId, event) ->
|
||||
{
|
||||
if (actionId != EditorInfo.IME_ACTION_NEXT)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return updatelist();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public boolean updatelist()
|
||||
{
|
||||
String query = search_bar.getText().toString();
|
||||
ArrayList<list_row_model> temp_model = new ArrayList<list_row_model>();
|
||||
list_model.getInstance().getIndex().clear();
|
||||
for(int counter=0;counter<=list_model.getInstance().getMainList().size()-1;counter++)
|
||||
{
|
||||
if(list_model.getInstance().getMainList().get(counter).getHeader().contains(query) || list_model.getInstance().getMainList().get(counter).getDescription().contains(query))
|
||||
{
|
||||
temp_model.add(list_model.getInstance().getMainList().get(counter));
|
||||
list_model.getInstance().setIndex(counter);
|
||||
}
|
||||
}
|
||||
list_model.getInstance().setModel(temp_model);
|
||||
initializeListController();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void onBackPressed(View view)
|
||||
{
|
||||
finish();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,78 +0,0 @@
|
|||
package com.darkweb.genesissearchengine.appManager.list_activity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class list_model
|
||||
{
|
||||
private static final list_model ourInstance = new list_model();
|
||||
|
||||
public static list_model getInstance()
|
||||
{
|
||||
return ourInstance;
|
||||
}
|
||||
|
||||
private list_model()
|
||||
{
|
||||
}
|
||||
|
||||
public ArrayList<list_row_model> list_model = new ArrayList<list_row_model>();
|
||||
public ArrayList<Integer> list_index = new ArrayList<Integer>();
|
||||
private ArrayList<list_row_model> main_model_ref = new ArrayList<list_row_model>();
|
||||
|
||||
public int listType;
|
||||
|
||||
public void setType(int listType)
|
||||
{
|
||||
this.listType = listType;
|
||||
}
|
||||
|
||||
public int getType()
|
||||
{
|
||||
return listType;
|
||||
}
|
||||
|
||||
public void setModel(ArrayList<list_row_model> list_model)
|
||||
{
|
||||
this.list_model = list_model;
|
||||
}
|
||||
|
||||
public ArrayList<list_row_model> getModel()
|
||||
{
|
||||
return list_model;
|
||||
}
|
||||
|
||||
public void setIndex(int index)
|
||||
{
|
||||
list_index.add(index);
|
||||
}
|
||||
|
||||
public ArrayList<Integer> getIndex()
|
||||
{
|
||||
return list_index;
|
||||
}
|
||||
|
||||
public void removeIndex(int index)
|
||||
{
|
||||
list_index.remove(index);
|
||||
for(int counter=index;counter<=list_index.size()-1;counter++)
|
||||
{
|
||||
list_index.set(counter,list_index.get(counter)-1);
|
||||
}
|
||||
}
|
||||
|
||||
public void setMainList(ArrayList<list_row_model> model)
|
||||
{
|
||||
main_model_ref = model;
|
||||
}
|
||||
|
||||
public ArrayList<list_row_model> getMainList()
|
||||
{
|
||||
return main_model_ref;
|
||||
}
|
||||
|
||||
public void removeFromMainList(int index)
|
||||
{
|
||||
main_model_ref.remove(index);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,93 @@
|
|||
package com.darkweb.genesissearchengine.appManager.list_manager;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.*;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.darkweb.genesissearchengine.constants.constants;
|
||||
import com.example.myapplication.R;
|
||||
|
||||
public class list_adapter extends RecyclerView.Adapter<list_adapter.listViewHolder>
|
||||
{
|
||||
list_adapter() {
|
||||
}
|
||||
|
||||
/*Initializations*/
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public listViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_row_view, parent, false);
|
||||
return new listViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull list_adapter.listViewHolder holder, int position)
|
||||
{
|
||||
holder.bindListView(list_model.getInstance().getModel().get(position));
|
||||
clearMessageItem(holder.messageButton,position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list_model.getInstance().getModel().size();
|
||||
}
|
||||
|
||||
private void setItemViewOnClickListener(View itemView, String url)
|
||||
{
|
||||
itemView.setOnClickListener(v ->
|
||||
{
|
||||
list_model.getInstance().getListInstance().onUrlClick(url);
|
||||
});
|
||||
}
|
||||
|
||||
private void clearMessageItem(ImageButton clearButton, int index)
|
||||
{
|
||||
list_model.getInstance().getListInstance().onClickListenersInitialize(clearButton,index);
|
||||
}
|
||||
|
||||
/*View Holder Extensions*/
|
||||
class listViewHolder extends RecyclerView.ViewHolder
|
||||
{
|
||||
TextView heaaderText;
|
||||
TextView descriptionText;
|
||||
ImageButton messageButton;
|
||||
ImageView empty_message;
|
||||
|
||||
listViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
}
|
||||
|
||||
void bindListView(list_row_model model) {
|
||||
|
||||
heaaderText = itemView.findViewById(R.id.header);
|
||||
descriptionText = itemView.findViewById(R.id.description);
|
||||
|
||||
String header = model.getHeader();
|
||||
|
||||
if(model.getHeader().length()<=2)
|
||||
{
|
||||
header = model.getDescription() + model.getHeader();
|
||||
}
|
||||
|
||||
if(list_model.getInstance().getType() == constants.list_bookmark)
|
||||
{
|
||||
heaaderText.setText(list_model.getInstance().getListInstance().removeHttpRequest(model.getDescription()));
|
||||
descriptionText.setText(header);
|
||||
}
|
||||
else
|
||||
{
|
||||
heaaderText.setText(list_model.getInstance().getListInstance().removeHttpRequest(header));
|
||||
descriptionText.setText(model.getDescription());
|
||||
}
|
||||
|
||||
messageButton = itemView.findViewById(R.id.message_button);
|
||||
empty_message = itemView.findViewById(R.id.empty_list);
|
||||
|
||||
setItemViewOnClickListener(itemView,header);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,123 @@
|
|||
package com.darkweb.genesissearchengine.appManager.list_manager;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import android.os.Bundle;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.darkweb.genesissearchengine.appManager.home_activity.app_model;
|
||||
import com.darkweb.genesissearchengine.constants.constants;
|
||||
import com.darkweb.genesissearchengine.constants.keys;
|
||||
import com.example.myapplication.R;
|
||||
import java.util.Objects;
|
||||
|
||||
public class list_controller extends AppCompatActivity
|
||||
{
|
||||
/*Private Variables*/
|
||||
|
||||
private ImageView emptyListNotifier;
|
||||
private EditText searchBar;
|
||||
private RecyclerView listView;
|
||||
|
||||
private list_view_controller viewController;
|
||||
|
||||
/*Initializations*/
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState){
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.list_view);
|
||||
|
||||
initializeListInstance();
|
||||
initializeListModel();
|
||||
initializeViews();
|
||||
initializeList();
|
||||
initSearchBar();
|
||||
updatelist();
|
||||
}
|
||||
public void initializeListInstance(){
|
||||
list_model.getInstance().setListInstance(this);
|
||||
list_model.getInstance().setListContext(this);
|
||||
}
|
||||
public void initializeListModel(){
|
||||
Bundle bundle = getIntent().getExtras();
|
||||
if(Objects.requireNonNull(bundle).getInt(keys.list_type)==constants.list_bookmark)
|
||||
{
|
||||
list_model.getInstance().setType(constants.list_bookmark);
|
||||
list_model.getInstance().setMainList(app_model.getInstance().getBookmark());
|
||||
}
|
||||
else
|
||||
{
|
||||
list_model.getInstance().setType(constants.list_history);
|
||||
list_model.getInstance().setMainList(app_model.getInstance().getHistory());
|
||||
}
|
||||
}
|
||||
public void initializeViews(){
|
||||
emptyListNotifier = findViewById(R.id.empty_list);
|
||||
searchBar = findViewById(R.id.search);
|
||||
listView = findViewById(R.id.listview);
|
||||
viewController = new list_view_controller(emptyListNotifier,searchBar,listView);
|
||||
}
|
||||
public void initializeList(){
|
||||
list_adapter adapter = new list_adapter();
|
||||
listView.setAdapter(adapter);
|
||||
listView.setLayoutManager(new LinearLayoutManager(this));
|
||||
updateListStatus(false);
|
||||
}
|
||||
|
||||
/*View Handlers*/
|
||||
|
||||
public void onClearHistory(View view)
|
||||
{
|
||||
viewController.onClearHistory();
|
||||
}
|
||||
public void onClearAll(){
|
||||
viewController.onClearAll();
|
||||
initializeViews();
|
||||
}
|
||||
public void updateListStatus(boolean animate)
|
||||
{
|
||||
viewController.updateListStatus(animate);
|
||||
}
|
||||
public void initSearchBar()
|
||||
{
|
||||
list_ehandler.getInstance().onEditorActionListener(searchBar);
|
||||
}
|
||||
public boolean updatelist(){
|
||||
viewController.updateList();
|
||||
updateListStatus(false);
|
||||
return true;
|
||||
}
|
||||
public void closeView()
|
||||
{
|
||||
viewController.closeView();
|
||||
}
|
||||
public void onDatasetChanged(int index)
|
||||
{
|
||||
viewController.onDatasetChanged(index);
|
||||
}
|
||||
public void onClearSearchBarCursor() {
|
||||
viewController.onClearSearchBarCursor();
|
||||
}
|
||||
public String removeHttpRequest(String view){
|
||||
return viewController.removeHttpRequest(view);
|
||||
}
|
||||
|
||||
/*Event Handlers*/
|
||||
|
||||
public void onBackPressed(View view)
|
||||
{
|
||||
list_ehandler.getInstance().onBackPressed();
|
||||
}
|
||||
public void onUrlClick(String url)
|
||||
{
|
||||
list_ehandler.getInstance().onUrlClick(url);
|
||||
}
|
||||
public void onClickListenersInitialize(View view,int index) {
|
||||
list_ehandler.getInstance().onClickListenersInitialize(view,index);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,93 @@
|
|||
package com.darkweb.genesissearchengine.appManager.list_manager;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.EditText;
|
||||
import com.darkweb.genesissearchengine.appManager.home_activity.app_model;
|
||||
import com.darkweb.genesissearchengine.constants.constants;
|
||||
import com.darkweb.genesissearchengine.helperMethod;
|
||||
import com.darkweb.genesissearchengine.pluginManager.orbot_manager;
|
||||
import com.example.myapplication.R;
|
||||
|
||||
public class list_ehandler
|
||||
{
|
||||
/*Initializations*/
|
||||
|
||||
private static final list_ehandler ourInstance = new list_ehandler();
|
||||
public static list_ehandler getInstance()
|
||||
{
|
||||
return ourInstance;
|
||||
}
|
||||
private list_ehandler(){
|
||||
}
|
||||
|
||||
/*Listener Initializations*/
|
||||
|
||||
void onEditorActionListener(EditText view)
|
||||
{
|
||||
view.setOnEditorActionListener((v, actionId, event) ->
|
||||
{
|
||||
if (actionId != EditorInfo.IME_ACTION_NEXT)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
list_model.getInstance().getListInstance().onClearSearchBarCursor();
|
||||
InputMethodManager imm = (InputMethodManager) list_model.getInstance().getListInstance().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
|
||||
return list_model.getInstance().getListInstance().updatelist();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void onClickListenersInitialize(View view,int index)
|
||||
{
|
||||
view.setOnClickListener(v ->
|
||||
{
|
||||
if(v.getId() == R.id.message_button)
|
||||
{
|
||||
onManualClear(index);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/*Listeners*/
|
||||
|
||||
private void onManualClear(int index)
|
||||
{
|
||||
list_model.getInstance().deleteFromDatabase(list_model.getInstance().getModel().get(index).getId());
|
||||
list_model.getInstance().getModel().remove(index);
|
||||
list_model.getInstance().removeFromMainList(list_model.getInstance().getIndex().get(index));
|
||||
list_model.getInstance().removeIndex(index);
|
||||
list_model.getInstance().getListInstance().onDatasetChanged(index);
|
||||
list_model.getInstance().getListInstance().updateListStatus(true);
|
||||
}
|
||||
|
||||
void onBackPressed()
|
||||
{
|
||||
list_model.getInstance().getListInstance().closeView();
|
||||
}
|
||||
|
||||
void onUrlClick(String url)
|
||||
{
|
||||
String url_temp = helperMethod.completeURL(url);
|
||||
|
||||
if(!url_temp.contains("boogle") && !url_temp.equals(constants.backendGoogle) && !url_temp.equals(constants.backendBing))
|
||||
{
|
||||
if(orbot_manager.getInstance().initOrbot(url_temp))
|
||||
{
|
||||
app_model.getInstance().getAppInstance().onloadURL(url_temp,true,false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
app_model.getInstance().getAppInstance().onloadURL(url_temp,false,false);
|
||||
}
|
||||
list_model.getInstance().getListInstance().closeView();
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,108 @@
|
|||
package com.darkweb.genesissearchengine.appManager.list_manager;
|
||||
|
||||
import android.content.Context;
|
||||
import com.darkweb.genesissearchengine.appManager.database_manager.database_controller;
|
||||
import com.darkweb.genesissearchengine.constants.constants;
|
||||
import com.darkweb.genesissearchengine.constants.strings;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class list_model
|
||||
{
|
||||
/*Private Variables*/
|
||||
|
||||
private ArrayList<list_row_model> list_model = new ArrayList<>();
|
||||
private ArrayList<Integer> list_index;
|
||||
private ArrayList<list_row_model> main_model_ref = new ArrayList<>();
|
||||
private list_controller listInstance;
|
||||
private Context listContext;
|
||||
private int listType;
|
||||
|
||||
/*Initializations*/
|
||||
|
||||
private static final list_model ourInstance = new list_model();
|
||||
public static list_model getInstance()
|
||||
{
|
||||
return ourInstance;
|
||||
}
|
||||
private list_model(){
|
||||
list_index = new ArrayList<>();
|
||||
}
|
||||
|
||||
/*Helper Methods*/
|
||||
|
||||
void setType(int listType)
|
||||
{
|
||||
this.listType = listType;
|
||||
}
|
||||
int getType()
|
||||
{
|
||||
return listType;
|
||||
}
|
||||
|
||||
void setModel(ArrayList<list_row_model> list_model)
|
||||
{
|
||||
this.list_model = list_model;
|
||||
}
|
||||
ArrayList<list_row_model> getModel()
|
||||
{
|
||||
return list_model;
|
||||
}
|
||||
|
||||
void setIndex(int index){
|
||||
list_index.add(index);
|
||||
}
|
||||
void removeIndex(int index){
|
||||
list_index.remove(index);
|
||||
for(int counter=index;counter<=list_index.size()-1;counter++)
|
||||
{
|
||||
list_index.set(counter,list_index.get(counter)-1);
|
||||
}
|
||||
}
|
||||
ArrayList<Integer> getIndex(){
|
||||
return list_index;
|
||||
}
|
||||
|
||||
void setMainList(ArrayList<list_row_model> model)
|
||||
{
|
||||
main_model_ref = model;
|
||||
}
|
||||
ArrayList<list_row_model> getMainList()
|
||||
{
|
||||
return main_model_ref;
|
||||
}
|
||||
void removeFromMainList(int index)
|
||||
{
|
||||
main_model_ref.remove(index);
|
||||
}
|
||||
|
||||
public list_controller getListInstance()
|
||||
{
|
||||
return listInstance;
|
||||
}
|
||||
void setListInstance(list_controller listInstance)
|
||||
{
|
||||
this.listInstance = listInstance;
|
||||
}
|
||||
|
||||
public Context getListContext(){
|
||||
return listContext;
|
||||
}
|
||||
void setListContext(Context listContext)
|
||||
{
|
||||
this.listContext = listContext;
|
||||
}
|
||||
|
||||
/*Database Handler*/
|
||||
|
||||
void deleteFromDatabase(int index) {
|
||||
String table = strings.bookmark_text;
|
||||
if(getType()== constants.list_history)
|
||||
{
|
||||
table = strings.history_text;
|
||||
}
|
||||
database_controller.getInstance().execSQL("delete from "+table+" where id="+index);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,25 +1,29 @@
|
|||
package com.darkweb.genesissearchengine.appManager.list_activity;
|
||||
package com.darkweb.genesissearchengine.appManager.list_manager;
|
||||
|
||||
public class list_row_model
|
||||
{
|
||||
/*Private Variables*/
|
||||
|
||||
private int id;
|
||||
private String header;
|
||||
private String description;
|
||||
|
||||
/*Initializations*/
|
||||
|
||||
public list_row_model(String header, String description,int id) {
|
||||
this.id = id;
|
||||
this.header = header;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
/*Variable Getters*/
|
||||
|
||||
public String getHeader() {
|
||||
return header;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
|
@ -0,0 +1,165 @@
|
|||
package com.darkweb.genesissearchengine.appManager.list_manager;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.text.SpannableString;
|
||||
import android.text.Spanned;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.darkweb.genesissearchengine.appManager.database_manager.database_controller;
|
||||
import com.darkweb.genesissearchengine.appManager.home_activity.app_model;
|
||||
import com.darkweb.genesissearchengine.constants.constants;
|
||||
import com.darkweb.genesissearchengine.constants.strings;
|
||||
import com.darkweb.genesissearchengine.pluginManager.message_manager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Objects;
|
||||
|
||||
class list_view_controller
|
||||
{
|
||||
/*Private Variables*/
|
||||
|
||||
private ImageView emptyListNotifier;
|
||||
private EditText searchBar;
|
||||
private RecyclerView listView;
|
||||
|
||||
/*Initializations*/
|
||||
|
||||
list_view_controller(ImageView emptyListNotifier, EditText searchBar,RecyclerView listView)
|
||||
{
|
||||
this.emptyListNotifier = emptyListNotifier;
|
||||
this.searchBar = searchBar;
|
||||
this.listView = listView;
|
||||
}
|
||||
|
||||
/*Handlers*/
|
||||
|
||||
void onClearHistory()
|
||||
{
|
||||
if(app_model.getInstance().getHistory().size()>0)
|
||||
{
|
||||
message_manager.getInstance().clearData();
|
||||
}
|
||||
}
|
||||
|
||||
void onClearAll()
|
||||
{
|
||||
list_model.getInstance().getModel().clear();
|
||||
list_model.getInstance().getMainList().clear();
|
||||
app_model.getInstance().getSuggestions().clear();
|
||||
|
||||
emptyListNotifier.setAlpha(0f);
|
||||
emptyListNotifier.setVisibility(View.VISIBLE);
|
||||
emptyListNotifier.animate().alpha(1);
|
||||
searchBar.setText(strings.emptyStr);
|
||||
|
||||
String table = strings.bookmark_text;
|
||||
if(list_model.getInstance().getType()== constants.list_history)
|
||||
{
|
||||
table = strings.history_text;
|
||||
}
|
||||
database_controller.getInstance().execSQL("delete from "+table+" where 1");
|
||||
}
|
||||
|
||||
void updateListStatus(boolean animate)
|
||||
{
|
||||
if(list_model.getInstance().getModel().size()<=0)
|
||||
{
|
||||
if(animate)
|
||||
{
|
||||
emptyListNotifier.setAlpha(0f);
|
||||
emptyListNotifier.setVisibility(View.VISIBLE);
|
||||
emptyListNotifier.animate().alpha(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
emptyListNotifier.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
emptyListNotifier.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void updateList()
|
||||
{
|
||||
String query = searchBar.getText().toString();
|
||||
ArrayList<list_row_model> temp_model = new ArrayList<>();
|
||||
list_model.getInstance().getIndex().clear();
|
||||
for(int counter=0;counter<=list_model.getInstance().getMainList().size()-1;counter++)
|
||||
{
|
||||
if(list_model.getInstance().getMainList().get(counter).getHeader().contains(query) || list_model.getInstance().getMainList().get(counter).getDescription().contains(query))
|
||||
{
|
||||
temp_model.add(list_model.getInstance().getMainList().get(counter));
|
||||
list_model.getInstance().setIndex(counter);
|
||||
}
|
||||
}
|
||||
list_model.getInstance().setModel(temp_model);
|
||||
listView.getAdapter().notifyDataSetChanged();
|
||||
}
|
||||
|
||||
void onDatasetChanged(int index)
|
||||
{
|
||||
Objects.requireNonNull(listView.getAdapter()).notifyItemRemoved(index);
|
||||
listView.getAdapter().notifyDataSetChanged();
|
||||
}
|
||||
|
||||
|
||||
void closeView()
|
||||
{
|
||||
list_model.getInstance().getListInstance().finish();
|
||||
}
|
||||
|
||||
public void onClearSearchBarCursor()
|
||||
{
|
||||
searchBar.clearFocus();
|
||||
}
|
||||
|
||||
public String removeHttpRequest(String url)
|
||||
{
|
||||
|
||||
if (url.startsWith("https://"))
|
||||
{
|
||||
return url.substring(8);
|
||||
}
|
||||
else if (url.startsWith("http://"))
|
||||
{
|
||||
return url.substring(7);
|
||||
}
|
||||
else
|
||||
{
|
||||
return url;
|
||||
}
|
||||
/*
|
||||
if (view == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (view.getText().toString().contains("https://"))
|
||||
{
|
||||
SpannableString ss = new SpannableString(view.getText());
|
||||
ss.setSpan(new ForegroundColorSpan(Color.argb(255, 0, 123, 43)), 0, 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
ss.setSpan(new ForegroundColorSpan(Color.GRAY), 5, 8, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
view.setText(ss);
|
||||
} else if (view.getText().toString().contains("http://"))
|
||||
{
|
||||
SpannableString ss = new SpannableString(view.getText());
|
||||
ss.setSpan(new ForegroundColorSpan(Color.argb(255, 0, 128, 43)), 0, 4, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
ss.setSpan(new ForegroundColorSpan(Color.GRAY), 4, 7, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
view.setText(ss);
|
||||
} else
|
||||
{
|
||||
SpannableString ss = new SpannableString(view.getText());
|
||||
ss.setSpan(new ForegroundColorSpan(Color.BLACK), 0, view.getText().length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
view.setText(ss);
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -22,8 +22,9 @@ public class setting_controller extends AppCompatActivity
|
|||
protected void onCreate(Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.settings_activity);
|
||||
setContentView(R.layout.settings_view);
|
||||
|
||||
setting_model.getInstance().init_status();
|
||||
viewsInitializations();
|
||||
listenersInitializations();
|
||||
initializeModel();
|
||||
|
@ -64,6 +65,11 @@ public class setting_controller extends AppCompatActivity
|
|||
|
||||
/*View Handlers*/
|
||||
|
||||
@Override
|
||||
public void onBackPressed(){
|
||||
closeView();
|
||||
}
|
||||
|
||||
public void closeView()
|
||||
{
|
||||
viewController.closeView();
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package com.darkweb.genesissearchengine.appManager.setting_manager;
|
||||
|
||||
import com.darkweb.genesissearchengine.constants.status;
|
||||
import com.darkweb.genesissearchengine.constants.strings;
|
||||
|
||||
public class setting_model
|
||||
{
|
||||
private static final setting_model ourInstance = new setting_model();
|
||||
|
@ -20,4 +23,17 @@ public class setting_model
|
|||
{
|
||||
this.settingInstance = settingInstance;
|
||||
}
|
||||
|
||||
public void init_status()
|
||||
{
|
||||
setting_model.getInstance().search_status = status.search_status;
|
||||
setting_model.getInstance().history_status = status.history_status;
|
||||
setting_model.getInstance().java_status = status.java_status;
|
||||
}
|
||||
|
||||
/*Changed Status*/
|
||||
public String search_status = strings.emptyStr;
|
||||
public boolean java_status = false;
|
||||
public boolean history_status = true;
|
||||
|
||||
}
|
||||
|
|
|
@ -2,7 +2,9 @@ package com.darkweb.genesissearchengine.appManager.setting_manager;
|
|||
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Spinner;
|
||||
import com.darkweb.genesissearchengine.appManager.home_activity.app_model;
|
||||
import com.darkweb.genesissearchengine.constants.keys;
|
||||
import com.darkweb.genesissearchengine.constants.status;
|
||||
import com.darkweb.genesissearchengine.constants.strings;
|
||||
import com.darkweb.genesissearchengine.dataManager.preference_manager;
|
||||
|
||||
|
@ -22,14 +24,22 @@ class setting_view_controller
|
|||
setting_view_controller(Spinner search, Spinner javascript, Spinner history)
|
||||
{
|
||||
this.search = search;
|
||||
this.search = javascript;
|
||||
this.search = history;
|
||||
this.javascript = javascript;
|
||||
this.history = history;
|
||||
|
||||
initViews();
|
||||
initJavascript();
|
||||
initHistory();
|
||||
initSearchEngine();
|
||||
}
|
||||
|
||||
private void initViews()
|
||||
{
|
||||
search.setDropDownVerticalOffset(15);
|
||||
javascript.setDropDownVerticalOffset(15);
|
||||
history.setDropDownVerticalOffset(15);
|
||||
}
|
||||
|
||||
private void initJavascript()
|
||||
{
|
||||
if (java_status)
|
||||
|
@ -67,6 +77,20 @@ class setting_view_controller
|
|||
|
||||
void closeView()
|
||||
{
|
||||
|
||||
if(status.search_status != setting_model.getInstance().search_status)
|
||||
{
|
||||
status.search_status = setting_model.getInstance().search_status;
|
||||
app_model.getInstance().getAppInstance().initSearchEngine();
|
||||
}
|
||||
else if(status.java_status != setting_model.getInstance().java_status)
|
||||
{
|
||||
status.java_status = setting_model.getInstance().java_status;
|
||||
app_model.getInstance().getAppInstance().onReInitGeckoView();
|
||||
}
|
||||
|
||||
status.history_status = setting_model.getInstance().history_status;
|
||||
|
||||
setting_model.getInstance().getSettingInstance().finish();
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ package com.darkweb.genesissearchengine.appManager.setting_manager;
|
|||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.Spinner;
|
||||
import com.darkweb.genesissearchengine.appManager.main_activity.app_model;
|
||||
import com.darkweb.genesissearchengine.appManager.home_activity.app_model;
|
||||
import com.darkweb.genesissearchengine.constants.keys;
|
||||
import com.darkweb.genesissearchengine.dataManager.preference_manager;
|
||||
import com.example.myapplication.R;
|
||||
|
@ -28,20 +28,17 @@ public class settings_ehandler
|
|||
|
||||
/*Listeners*/
|
||||
|
||||
@SuppressWarnings("ConstantConditions")
|
||||
private void onJavaScriptListener(int position)
|
||||
{
|
||||
if(position==1 && java_status)
|
||||
{
|
||||
java_status = false;
|
||||
preference_manager.getInstance().setBool(keys.java_script, java_status);
|
||||
app_model.getInstance().getAppInstance().onReInitGeckoView();
|
||||
setting_model.getInstance().java_status = false;
|
||||
preference_manager.getInstance().setBool(keys.java_script, false);
|
||||
}
|
||||
else if(!java_status)
|
||||
{
|
||||
java_status = true;
|
||||
preference_manager.getInstance().setBool(keys.java_script, java_status);
|
||||
app_model.getInstance().getAppInstance().onReInitGeckoView();
|
||||
setting_model.getInstance().java_status = true;
|
||||
preference_manager.getInstance().setBool(keys.java_script, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,24 +46,22 @@ public class settings_ehandler
|
|||
{
|
||||
if(!search_status.equals(parentView.getItemAtPosition(position).toString()))
|
||||
{
|
||||
search_status = parentView.getItemAtPosition(position).toString();
|
||||
preference_manager.getInstance().setString(keys.search_engine, search_status);
|
||||
app_model.getInstance().getAppInstance().initSearchEngine();
|
||||
setting_model.getInstance().search_status = parentView.getItemAtPosition(position).toString();
|
||||
preference_manager.getInstance().setString(keys.search_engine, setting_model.getInstance().search_status);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("ConstantConditions")
|
||||
private void onHistoryListener(int position)
|
||||
{
|
||||
if(position==1 && history_status)
|
||||
{
|
||||
history_status = false;
|
||||
preference_manager.getInstance().setBool(keys.history_clear, history_status);
|
||||
setting_model.getInstance().history_status = false;
|
||||
preference_manager.getInstance().setBool(keys.history_clear, false);
|
||||
}
|
||||
else if(!java_status)
|
||||
{
|
||||
history_status = true;
|
||||
preference_manager.getInstance().setBool(keys.history_clear, history_status);
|
||||
setting_model.getInstance().history_status = true;
|
||||
preference_manager.getInstance().setBool(keys.history_clear, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -82,17 +77,17 @@ public class settings_ehandler
|
|||
view.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parentView, View selectedItemView, int position, long id) {
|
||||
if(selectedItemView.getId()== R.id.search_manager)
|
||||
if(parentView.getId()== R.id.search_manager)
|
||||
{
|
||||
settings_ehandler.getInstance().onJavaScriptListener(position);
|
||||
onSearchListner(parentView,position);
|
||||
}
|
||||
else if(selectedItemView.getId()== R.id.javascript_manager)
|
||||
else if(parentView.getId()== R.id.javascript_manager)
|
||||
{
|
||||
settings_ehandler.getInstance().onHistoryListener(position);
|
||||
onJavaScriptListener(position);
|
||||
}
|
||||
else if(selectedItemView.getId()== R.id.history_manager)
|
||||
else if(parentView.getId()== R.id.history_manager)
|
||||
{
|
||||
settings_ehandler.getInstance().onSearchListner(parentView,position);
|
||||
onHistoryListener(position);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
|
|
|
@ -3,13 +3,15 @@ package com.darkweb.genesissearchengine.constants;
|
|||
public class constants
|
||||
{
|
||||
/*LOCAL URL CONSTANTS*/
|
||||
|
||||
public static String blackMarket = "https://boogle.store/search?q=black+market&p_num=1&s_type=all";
|
||||
public static String leakedDocument = "https://boogle.store/search?q=leaked+document&p_num=1&s_type=all&p_num=1&s_type=all";
|
||||
public static String news = "https://boogle.store/search?q=latest%20news&p_num=1&s_type=news";
|
||||
public static String softwares = "https://boogle.store/search?q=softwares+tools&p_num=1&s_type=all&p_num=1&s_type=all";
|
||||
|
||||
/*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";
|
||||
|
@ -23,10 +25,12 @@ public class constants
|
|||
public static String playstoreUrl = "https://play.google.com/store/apps/details?id=com.darkweb.genesissearchengine";
|
||||
|
||||
/*BUILD CONSTANTS*/
|
||||
|
||||
public static String build_type = "playstore";
|
||||
//public static String build_type = "local";
|
||||
|
||||
/*BUILD PROXY*/
|
||||
/*PROXY CONSTANTS*/
|
||||
|
||||
public static int proxy_type = 1;
|
||||
public static String proxy_socks = "127.0.0.1";
|
||||
public static int proxy_socks_version = 5;
|
||||
|
@ -37,12 +41,15 @@ public class constants
|
|||
public static boolean proxy_donottrackheader_enabled = false;
|
||||
public static int proxy_donottrackheader_value = 1;
|
||||
|
||||
/*MENU CONSTANTS*/
|
||||
|
||||
public static int list_history = 1;
|
||||
public static int list_bookmark = 2;
|
||||
|
||||
public static String databae_name="genesis.db";
|
||||
public static int databae_version=1;
|
||||
/*SETTINGS CONSTANTS*/
|
||||
|
||||
public static int max_history_size=500;
|
||||
public static int max_bookmark_size=500;
|
||||
public static String databae_name="genesis_dbase";
|
||||
|
||||
public static int max_history_size=3;
|
||||
public static int max_bookmark_size=3;
|
||||
}
|
||||
|
|
|
@ -2,9 +2,9 @@ package com.darkweb.genesissearchengine.constants;
|
|||
|
||||
public class enums
|
||||
{
|
||||
/*Web Request*/
|
||||
public enum webRequestStatus{notRunning,running,repeat;}
|
||||
/*SETTINGS*/
|
||||
|
||||
public enum searchEngine{Darkweb,Bing,Google}
|
||||
public enum adID{hidden, internal}
|
||||
|
||||
}
|
|
@ -2,11 +2,10 @@ package com.darkweb.genesissearchengine.constants;
|
|||
|
||||
public class messages
|
||||
{
|
||||
/*Post Messages*/
|
||||
public final static int LOCAL_HOMEPAGE_CACHED =0;
|
||||
/*POST MESSAGES KEYS*/
|
||||
|
||||
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;
|
||||
public final static int SHOW_ADS =6;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.darkweb.genesissearchengine.constants;
|
||||
|
||||
import android.util.Log;
|
||||
import com.darkweb.genesissearchengine.dataManager.preference_manager;
|
||||
|
||||
public class status
|
||||
|
@ -11,7 +12,7 @@ public class status
|
|||
public static String version_code = "6.0";
|
||||
|
||||
/*Settings Level*/
|
||||
public static String search_status = "";
|
||||
public static String search_status = strings.emptyStr;
|
||||
public static boolean java_status = false;
|
||||
public static boolean history_status = true;
|
||||
|
||||
|
|
|
@ -2,8 +2,12 @@ package com.darkweb.genesissearchengine.constants;
|
|||
|
||||
public class strings
|
||||
{
|
||||
/*Orbot Manager*/
|
||||
|
||||
public static String torfolder = "torfiles";
|
||||
|
||||
/*Messsage Manager*/
|
||||
|
||||
public static String welcome_message_title = "Welcome | Deep Web Gateway";
|
||||
public static String welcome_message_desc = "\nWelcome to Deep Web | Dark Web Gateway. This application provide you a platform to Search and Open Dark Web urls.\n\nYou cannot open any url related to normal internet as its not the intended purpose. You can check out following urls to get yourself started\n\nHere are few Suggestions\n";
|
||||
public static String welcome_message_bt1 = "Deep Web Online Market";
|
||||
|
@ -58,7 +62,17 @@ public class strings
|
|||
public static String clear_bt1 = "Clear Data";
|
||||
public static String clear_bt2 = "Dismiss";
|
||||
|
||||
|
||||
/*Text Manager*/
|
||||
|
||||
public static String darkweb = "Darkweb";
|
||||
public static String emptyStr = "";
|
||||
public static String bookmark_text = "bookmark";
|
||||
public static String history_text = "history";
|
||||
public static String bing_text = "Bing";
|
||||
public static String google_text = "Google";
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package com.darkweb.genesissearchengine.dataManager;
|
|||
|
||||
import android.content.SharedPreferences;
|
||||
import android.preference.PreferenceManager;
|
||||
import com.darkweb.genesissearchengine.appManager.main_activity.app_model;
|
||||
import com.darkweb.genesissearchengine.appManager.home_activity.app_model;
|
||||
|
||||
public class preference_manager
|
||||
{
|
||||
|
|
|
@ -2,15 +2,15 @@ package com.darkweb.genesissearchengine;
|
|||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableString;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.Display;
|
||||
import android.view.View;
|
||||
|
@ -20,15 +20,15 @@ import android.view.animation.Animation;
|
|||
import android.view.animation.RotateAnimation;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import androidx.core.app.ShareCompat;
|
||||
import com.darkweb.genesissearchengine.appManager.list_activity.list_controller;
|
||||
import com.darkweb.genesissearchengine.appManager.main_activity.app_model;
|
||||
import com.darkweb.genesissearchengine.constants.constants;
|
||||
import com.darkweb.genesissearchengine.appManager.home_activity.app_model;
|
||||
import com.darkweb.genesissearchengine.constants.keys;
|
||||
import com.darkweb.genesissearchengine.dataManager.preference_manager;
|
||||
import com.example.myapplication.BuildConfig;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.text.Normalizer;
|
||||
import java.util.Locale;
|
||||
|
||||
public class helperMethod
|
||||
{
|
||||
|
@ -37,11 +37,7 @@ public class helperMethod
|
|||
{
|
||||
ConnectivityManager cm = (ConnectivityManager) app_model.getInstance().getAppContext().getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
NetworkInfo networkInfo = cm.getActiveNetworkInfo();
|
||||
if (networkInfo != null && networkInfo.isConnected())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return networkInfo != null && networkInfo.isConnected();
|
||||
}
|
||||
|
||||
|
||||
|
@ -70,17 +66,17 @@ public class helperMethod
|
|||
{
|
||||
if(!hasSoftKeys)
|
||||
{
|
||||
return (int)(Resources.getSystem().getDisplayMetrics().heightPixels)-(helperMethod.getNavigationBarHeight());
|
||||
return Resources.getSystem().getDisplayMetrics().heightPixels -(helperMethod.getNavigationBarHeight());
|
||||
}
|
||||
else
|
||||
{
|
||||
return (int)(Resources.getSystem().getDisplayMetrics().heightPixels);
|
||||
return (Resources.getSystem().getDisplayMetrics().heightPixels);
|
||||
}
|
||||
}
|
||||
|
||||
public static int screenWidth()
|
||||
{
|
||||
return (int)(Resources.getSystem().getDisplayMetrics().widthPixels);
|
||||
return (Resources.getSystem().getDisplayMetrics().widthPixels);
|
||||
}
|
||||
|
||||
public static int getNavigationBarHeight() {
|
||||
|
@ -130,14 +126,7 @@ public class helperMethod
|
|||
|
||||
public static boolean isBuildValid ()
|
||||
{
|
||||
if(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 true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
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");
|
||||
|
||||
}
|
||||
|
||||
|
@ -151,8 +140,9 @@ public class helperMethod
|
|||
{
|
||||
ShareCompat.IntentBuilder.from(app_model.getInstance().getAppInstance())
|
||||
.setType("text/plain")
|
||||
.setChooserTitle("Genesis | Onion Search")
|
||||
.setText("http://play.google.com/store/apps/details?id=" + app_model.getInstance().getAppInstance().getPackageName())
|
||||
.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();
|
||||
}
|
||||
|
||||
|
@ -180,4 +170,43 @@ public class helperMethod
|
|||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ public class httpclient
|
|||
{
|
||||
String c_url = url.replace("http://boogle","https://boogle").replaceAll("genesis.onion","boogle.store").replaceAll("genesis.store","boogle.store");
|
||||
|
||||
HttpClient client=new DefaultHttpClient();;
|
||||
HttpClient client=new DefaultHttpClient();
|
||||
SSLConnectionSocketFactory scsf = new SSLConnectionSocketFactory(
|
||||
SSLContexts.custom().loadTrustMaterial(null, new TrustSelfSignedStrategy()).build(),
|
||||
NoopHostnameVerifier.INSTANCE);
|
||||
|
|
|
@ -30,7 +30,7 @@ public class serverRequestManager
|
|||
try
|
||||
{
|
||||
HttpGet reportrequest = new HttpGet(url);
|
||||
HttpClient client=new DefaultHttpClient();;
|
||||
HttpClient client=new DefaultHttpClient();
|
||||
client.execute(reportrequest);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
|
@ -5,7 +5,7 @@ import android.os.Message;
|
|||
|
||||
|
||||
import android.os.Handler;
|
||||
import com.darkweb.genesissearchengine.appManager.main_activity.app_model;
|
||||
import com.darkweb.genesissearchengine.appManager.home_activity.app_model;
|
||||
import com.darkweb.genesissearchengine.constants.messages;
|
||||
|
||||
public class webRequestHandler
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.darkweb.genesissearchengine.pluginManager;
|
||||
|
||||
import com.darkweb.genesissearchengine.appManager.main_activity.app_model;
|
||||
import com.darkweb.genesissearchengine.appManager.home_activity.app_model;
|
||||
import com.darkweb.genesissearchengine.constants.enums;
|
||||
import com.google.android.gms.ads.AdRequest;
|
||||
import com.google.android.gms.ads.InterstitialAd;
|
||||
import com.google.android.gms.ads.MobileAds;
|
||||
|
@ -10,7 +11,8 @@ public class admanager
|
|||
|
||||
/*Private Variables*/
|
||||
private static final admanager ourInstance = new admanager();
|
||||
private InterstitialAd mInterstitialAd;
|
||||
private InterstitialAd mInterstitialHidden;
|
||||
private InterstitialAd mInterstitialInternal;
|
||||
private int adCount = 0;
|
||||
boolean isAdShown = false;
|
||||
|
||||
|
@ -26,51 +28,31 @@ public class admanager
|
|||
public void initialize()
|
||||
{
|
||||
MobileAds.initialize(app_model.getInstance().getAppInstance(), "ca-app-pub-5074525529134731~2926711128");
|
||||
mInterstitialAd = new InterstitialAd(app_model.getInstance().getAppInstance());
|
||||
mInterstitialAd.setAdUnitId("ca-app-pub-5074525529134731/8478420705");
|
||||
mInterstitialAd.loadAd(new AdRequest.Builder().build());
|
||||
initAd(mInterstitialHidden,"ca-app-pub-5074525529134731/4332539288");
|
||||
initAd(mInterstitialInternal,"ca-app-pub-5074525529134731/8478420705");
|
||||
}
|
||||
|
||||
public void initAd(InterstitialAd adInstance,String id)
|
||||
{
|
||||
adInstance = new InterstitialAd(app_model.getInstance().getAppInstance());
|
||||
|
||||
adInstance.setAdUnitId(id);
|
||||
adInstance.loadAd(new AdRequest.Builder().build());
|
||||
}
|
||||
|
||||
/*Helper Methods*/
|
||||
|
||||
public void showAd(boolean isAdForced)
|
||||
public void showAd(enums.adID id)
|
||||
{
|
||||
if(isAdShown)
|
||||
if(id.equals(enums.adID.hidden))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(!mInterstitialAd.isLoading() && !mInterstitialAd.isLoaded())
|
||||
{
|
||||
mInterstitialAd.loadAd(new AdRequest.Builder().build());
|
||||
if(isAdForced || adCount==0 || adCount%3==0)
|
||||
{
|
||||
adCount = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
adCount+=1;
|
||||
}
|
||||
mInterstitialHidden.show();
|
||||
mInterstitialHidden.loadAd(new AdRequest.Builder().build());
|
||||
}
|
||||
else
|
||||
{
|
||||
if(mInterstitialAd.isLoaded())
|
||||
{
|
||||
if(isAdForced)
|
||||
{
|
||||
isAdShown = true;
|
||||
mInterstitialAd.show();
|
||||
adCount = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(adCount%3==0)
|
||||
{
|
||||
mInterstitialAd.show();
|
||||
}
|
||||
adCount += 1;
|
||||
}
|
||||
}
|
||||
mInterstitialInternal.show();
|
||||
mInterstitialInternal.loadAd(new AdRequest.Builder().build());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,14 +6,13 @@ import android.content.DialogInterface;
|
|||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Handler;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.RelativeLayout.LayoutParams;
|
||||
import android.text.InputType;
|
||||
import android.widget.EditText;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import com.crowdfire.cfalertdialog.CFAlertDialog;
|
||||
import com.darkweb.genesissearchengine.appManager.main_activity.app_model;
|
||||
import com.darkweb.genesissearchengine.appManager.main_activity.application_controller;
|
||||
import com.darkweb.genesissearchengine.appManager.list_manager.list_model;
|
||||
import com.darkweb.genesissearchengine.appManager.home_activity.app_model;
|
||||
import com.darkweb.genesissearchengine.appManager.home_activity.application_controller;
|
||||
import com.darkweb.genesissearchengine.constants.constants;
|
||||
import com.darkweb.genesissearchengine.constants.keys;
|
||||
import com.darkweb.genesissearchengine.constants.strings;
|
||||
|
@ -187,15 +186,15 @@ public class message_manager
|
|||
|
||||
public void clearData()
|
||||
{
|
||||
Context application_context = app_model.getInstance().getListContext();
|
||||
CFAlertDialog.Builder builder = new CFAlertDialog.Builder(app_model.getInstance().getListContext())
|
||||
Context application_context = list_model.getInstance().getListContext();
|
||||
CFAlertDialog.Builder builder = new CFAlertDialog.Builder(list_model.getInstance().getListContext())
|
||||
.setDialogStyle(CFAlertDialog.CFAlertStyle.BOTTOM_SHEET)
|
||||
.setTitle(strings.clear_title)
|
||||
.setBackgroundColor(application_context.getResources().getColor(R.color.blue_dark_v2))
|
||||
.setTextColor(application_context.getResources().getColor(R.color.black))
|
||||
.setMessage(strings.clear_desc)
|
||||
.addButton(strings.clear_bt1, -1, -1, CFAlertDialog.CFAlertActionStyle.POSITIVE, CFAlertDialog.CFAlertActionAlignment.JUSTIFIED, (dialog, which) -> {
|
||||
app_model.getInstance().getListInstance().clearAll();
|
||||
list_model.getInstance().getListInstance().onClearAll();
|
||||
dialog.dismiss();
|
||||
})
|
||||
.addButton(strings.clear_bt2, -1, -1, CFAlertDialog.CFAlertActionStyle.NEGATIVE, CFAlertDialog.CFAlertActionAlignment.JUSTIFIED, (dialog, which) -> {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package com.darkweb.genesissearchengine.pluginManager;
|
||||
|
||||
import com.darkweb.genesissearchengine.appManager.main_activity.app_model;
|
||||
import com.darkweb.genesissearchengine.appManager.home_activity.app_model;
|
||||
import com.darkweb.genesissearchengine.constants.constants;
|
||||
import com.darkweb.genesissearchengine.constants.keys;
|
||||
import com.darkweb.genesissearchengine.constants.status;
|
||||
|
|
After Width: | Height: | Size: 720 B |
Before Width: | Height: | Size: 9.8 KiB After Width: | Height: | Size: 8.1 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.5 KiB |
|
@ -3,7 +3,6 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="15dp"
|
||||
android:layout_marginTop="60dp"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingBottom="-35dp"
|
||||
android:background="@color/white"
|
||||
|
@ -11,19 +10,22 @@
|
|||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/hintCompletionText"
|
||||
android:id="@+id/hintCompletionHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/transparent"
|
||||
android:padding="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:paddingTop="0dp"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:textColor="@color/holo_gray"
|
||||
android:textSize="15.5sp"
|
||||
android:textStyle="bold" />
|
||||
android:textColor="@color/text_color_v1"
|
||||
android:textSize="15.5sp"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/white_dark" />
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
tools:context="com.darkweb.genesissearchengine.appManager.main_activity.application_controller">
|
||||
tools:context="com.darkweb.genesissearchengine.appManager.home_activity.application_controller">
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
@ -153,14 +153,16 @@
|
|||
android:textColorHighlight="@color/text_color_highlight_v1"
|
||||
android:background="@xml/search_back_default"
|
||||
android:textCursorDrawable="@xml/search_cursor_state"
|
||||
android:hint="@string/SearchHint"
|
||||
android:hint="@string/SearchHintMain"
|
||||
android:text="@string/homeUrl"
|
||||
android:ems="10"
|
||||
android:layout_marginTop="8dp"
|
||||
android:dropDownHeight="220dp"
|
||||
android:inputType="textNoSuggestions"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:completionHintView="@layout/hint_completion_layout"
|
||||
android:completionHintView="@layout/hint_view"
|
||||
android:layout_marginEnd="0dp"
|
||||
android:dropDownSelector="@xml/rouned_corner"
|
||||
android:layout_marginStart="10dp"
|
||||
android:maxLines="1"
|
||||
android:id="@+id/search" android:layout_weight="1" android:importantForAutofill="no"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
</RelativeLayout>
|
|
@ -11,9 +11,9 @@
|
|||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginLeft="45px"
|
||||
android:layout_marginStart="20dp"
|
||||
android:id="@+id/item_container"
|
||||
android:paddingRight="8px"
|
||||
android:paddingEnd="8dp"
|
||||
android:layout_weight="4"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
|||
android:id="@+id/header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/black"
|
||||
android:singleLine="true"
|
||||
/>
|
||||
|
||||
|
@ -29,8 +30,10 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:layout_marginTop="2dp"
|
||||
android:ellipsize="end"
|
||||
android:textColor="@color/ease_blue"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/holo_dark_gray"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -38,7 +41,7 @@
|
|||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginTop="0dp"
|
||||
android:id="@+id/message_button"
|
||||
android:onClick="onHomeButtonPressed"
|
||||
android:scaleType="fitCenter"
|
|
@ -6,7 +6,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
tools:context="com.darkweb.genesissearchengine.appManager.list_activity.list_controller">
|
||||
tools:context="com.darkweb.genesissearchengine.appManager.list_manager.list_controller">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -33,7 +33,7 @@
|
|||
<EditText
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:textSize="16sp"
|
||||
android:textSize="15sp"
|
||||
android:textColor="@color/text_color_v2"
|
||||
android:selectAllOnFocus="true"
|
||||
android:paddingLeft="18dp"
|
||||
|
@ -51,25 +51,18 @@
|
|||
android:maxLines="1"
|
||||
android:id="@+id/search" android:layout_weight="1" android:importantForAutofill="no"
|
||||
tools:targetApi="o"/>
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="0dp"
|
||||
style="?android:attr/borderlessButtonStyle"
|
||||
android:layout_marginStart="0dp"
|
||||
android:paddingBottom="19dp"
|
||||
android:paddingTop="19dp"
|
||||
android:layout_marginEnd="0dp"
|
||||
<ImageButton
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:id="@+id/menu"
|
||||
android:onClick="clearHistory"
|
||||
android:onClick="onClearHistory"
|
||||
android:scaleType="fitCenter"
|
||||
android:text="Clear"
|
||||
|
||||
android:bottomRightRadius="15dp"
|
||||
android:bottomLeftRadius="15dp"
|
||||
android:topLeftRadius="15dp"
|
||||
android:topRightRadius="15dp"
|
||||
|
||||
android:src="@drawable/dustbin"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/todo"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -89,5 +82,5 @@
|
|||
app:layout_constraintStart_toStartOf="parent" app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
/>
|
||||
android:contentDescription="@string/todo"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -9,15 +9,15 @@
|
|||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/white"
|
||||
android:layout_marginBottom="30dp"
|
||||
android:layout_marginBottom="0dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="115dp">
|
||||
android:layout_height="52dp">
|
||||
<ImageButton
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginBottom="0dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:id="@+id/home"
|
||||
android:onClick="onBackPressed"
|
||||
android:scaleType="fitCenter"
|
||||
|
@ -26,37 +26,62 @@
|
|||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/todo"/>
|
||||
<TextView
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/cursor_blue"
|
||||
android:textSize="20sp"
|
||||
android:textColor="@color/text_color_v1"
|
||||
android:textSize="19sp"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="40"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginStart="30dp"
|
||||
android:text="@string/settings_header"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:background="@color/white_dark" />
|
||||
|
||||
<!-- Title Header -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/white"
|
||||
android:layout_marginBottom="0dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="65dp">
|
||||
<TextView
|
||||
android:textColor="@color/cursor_blue"
|
||||
android:textSize="17.5sp"
|
||||
android:layout_width="0dp"
|
||||
android:textStyle="bold"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="40"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:text="@string/basic_settings"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Title Search Engine -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/white"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginTop="7dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:textStyle="bold"
|
||||
android:textSize="17sp"
|
||||
android:textSize="16sp"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="40"
|
||||
android:layout_marginStart="30dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:text="@string/settings_search_engine"
|
||||
/>
|
||||
<Spinner
|
||||
android:id="@+id/search_manager"
|
||||
android:textSize="13sp"
|
||||
android:textSize="12sp"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="40dp"
|
||||
android:paddingRight="30dp"
|
||||
|
@ -87,21 +112,20 @@
|
|||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/white"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:textStyle="bold"
|
||||
android:textSize="17sp"
|
||||
android:textSize="16sp"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="40"
|
||||
android:layout_marginStart="30dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:text="@string/settings_javascript"
|
||||
/>
|
||||
<Spinner
|
||||
android:id="@+id/javascript_manager"
|
||||
android:textSize="13sp"
|
||||
android:textSize="12sp"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="1dp"
|
||||
|
@ -131,26 +155,25 @@
|
|||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/white"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:textStyle="bold"
|
||||
android:textSize="17sp"
|
||||
android:textSize="16sp"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="40"
|
||||
android:layout_marginStart="30dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:text="@string/settings_clear_history"
|
||||
/>
|
||||
<Spinner
|
||||
android:id="@+id/history_manager"
|
||||
android:textSize="13sp"
|
||||
android:textSize="12sp"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="1dp"
|
||||
android:paddingRight="30dp"
|
||||
android:paddingLeft="30dp"
|
||||
android:paddingLeft="20dp"
|
||||
android:stateListAnimator="@xml/spinner_style_animate"
|
||||
android:background="@xml/spinner_style_background"
|
||||
android:drawSelectorOnTop="true"
|
|
@ -4,42 +4,34 @@
|
|||
tools:context="example.javatpoint.com.optionmenu.MainActivity">
|
||||
|
||||
<item android:id="@+id/menu1"
|
||||
android:onClick="onMenuOptionSelected"
|
||||
android:title="History"
|
||||
app:showAsAction="always"
|
||||
android:icon="@android:drawable/btn_star"/>
|
||||
<item android:id="@+id/menu2"
|
||||
android:onClick="onMenuOptionSelected"
|
||||
android:title="Manager Search Engine"
|
||||
app:showAsAction="always"
|
||||
android:icon="@android:drawable/btn_star"/>
|
||||
<item android:id="@+id/menu3"
|
||||
android:onClick="onMenuOptionSelected"
|
||||
android:title="Settings"
|
||||
app:showAsAction="always"
|
||||
android:icon="@android:drawable/btn_star"/>
|
||||
<group android:id="@+id/group_1" >
|
||||
<item android:id="@+id/menu4"
|
||||
android:onClick="onMenuOptionSelected"
|
||||
android:title="Bookmark This Page"
|
||||
app:showAsAction="always"
|
||||
android:icon="@android:drawable/btn_star"/>
|
||||
<item android:id="@+id/menu5"
|
||||
android:onClick="onMenuOptionSelected"
|
||||
android:title="Open Bookmarks"
|
||||
app:showAsAction="ifRoom"
|
||||
android:icon="@android:drawable/btn_plus"/>
|
||||
</group>
|
||||
<group android:id="@+id/group_2" >
|
||||
<item android:id="@+id/menu6"
|
||||
android:onClick="onMenuOptionSelected"
|
||||
android:title="Report Website"/>
|
||||
<item android:id="@+id/menu7"
|
||||
android:onClick="onMenuOptionSelected"
|
||||
android:title="Rate This App"
|
||||
app:showAsAction="withText"/>
|
||||
<item android:id="@+id/menu8"
|
||||
android:onClick="onMenuOptionSelected"
|
||||
android:title="Share"
|
||||
app:showAsAction="withText"/>
|
||||
</group>
|
||||
|
|
After Width: | Height: | Size: 7.8 KiB |
After Width: | Height: | Size: 730 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 730 B |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 730 B |
After Width: | Height: | Size: 9.2 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 9.2 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 730 B |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 24 KiB |
|
@ -13,6 +13,7 @@
|
|||
<color name="text_color_v1">#4d4d4d</color>
|
||||
<color name="text_color_v2">#333333</color>
|
||||
|
||||
<color name="holo_dark_gray">#737373</color>
|
||||
<color name="holo_gray">#b3b3b3</color>
|
||||
<color name="float_white">#bfbfbf</color>
|
||||
<color name="button_gray">#d9d9d9</color>
|
||||
|
@ -22,5 +23,7 @@
|
|||
|
||||
<color name="progress_tint">#f32323</color>
|
||||
|
||||
<color name="green_dark">#196619</color>
|
||||
|
||||
<color name="dark_purple">#CC212d45</color>
|
||||
</resources>
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
<!-- Application Strings -->
|
||||
<string name="app_name">Genesis</string>
|
||||
<string name="SearchHint">Search History</string>
|
||||
<string name="SearchHintMain">Search or type web address</string>
|
||||
<string name="homeUrl">https://genesis.onion</string>
|
||||
<string name="errorTiyle">\u0020\u0020\u0020Opps! Some Thing Went Wrong</string>
|
||||
<string name="todo">TODO</string>
|
||||
|
@ -28,11 +29,15 @@
|
|||
<string name="attachment_summary_off">Only download attachments when manually requested</string>
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="basic_settings">Basic Settings</string>
|
||||
<string name="settings_header">Settings</string>
|
||||
<string name="settings_search_engine">Search Engine</string>
|
||||
<string name="settings_javascript">Javascript</string>
|
||||
<string name="settings_clear_history">Auto Clear History</string>
|
||||
|
||||
<!-- List View -->
|
||||
<string name="listview_clear">Clear</string>
|
||||
|
||||
<string-array name="search_engines">
|
||||
<item>Darkweb</item>
|
||||
<item>Google</item>
|
||||
|
|
|
@ -9,24 +9,21 @@
|
|||
<item name="android:windowBackground">@xml/splash_gradient</item>
|
||||
<item name="android:statusBarColor">#000000</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.NoActionBar">
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
|
||||
|
||||
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light">
|
||||
<item name="android:paddingRight">21dp</item>
|
||||
</style>
|
||||
<item name="android:paddingRight">24dp</item>
|
||||
</style>
|
||||
|
||||
|
||||
<style name="SpinnerTheme" parent="android:Widget.DeviceDefault.Spinner">
|
||||
<item name="android:background">@xml/spinner_style_background</item>
|
||||
<item name="android:padding">8dp</item>
|
||||
<item name="android:paddingTop">5dp</item>
|
||||
<item name="android:textSize">18sp</item>
|
||||
<item name="android:textColor">@android:color/white</item>
|
||||
<item name="android:paddingBottom">5dp</item>
|
||||
<item name="android:paddingRight">15dp</item>
|
||||
<style name="AppTheme.popupMenuStyle" parent="Widget.AppCompat.PopupMenu">
|
||||
<item name="android:popupBackground" >@android:color/white</item>
|
||||
<item name="android:layout_marginTop" >1000dp</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -1,21 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<set>
|
||||
<objectAnimator
|
||||
android:duration="@android:integer/config_mediumAnimTime"
|
||||
android:propertyName="translationZ"
|
||||
android:valueTo="5dp" />
|
||||
</set>
|
||||
</item>
|
||||
<item android:state_selected="true">
|
||||
<set>
|
||||
<objectAnimator
|
||||
android:duration="@android:integer/config_shortAnimTime"
|
||||
android:propertyName="translationZ"
|
||||
android:valueTo="5dp" />
|
||||
</set>
|
||||
</item>
|
||||
<item>
|
||||
<set>
|
||||
<objectAnimator
|
||||
|
|
|
@ -1,11 +1,40 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:exitFadeDuration="@android:integer/config_mediumAnimTime">
|
||||
<item android:state_pressed="true" android:drawable="@android:color/white" />
|
||||
<item android:state_selected="true" android:drawable="@android:color/white" />
|
||||
|
||||
<item android:state_selected="true">
|
||||
<inset>
|
||||
<shape android:shape="rectangle">
|
||||
<corners
|
||||
android:bottomRightRadius="5dp" android:bottomLeftRadius="5dp"
|
||||
android:topLeftRadius="5dp" android:topRightRadius="5dp"/>
|
||||
<stroke android:width="0dp"
|
||||
android:color="#e6e6e6" />
|
||||
<solid android:color="@color/button_gray" />
|
||||
</shape>
|
||||
</inset>
|
||||
</item>
|
||||
|
||||
<item android:state_pressed="true">
|
||||
<inset>
|
||||
<shape android:shape="rectangle">
|
||||
<corners
|
||||
android:bottomRightRadius="5dp" android:bottomLeftRadius="5dp"
|
||||
android:topLeftRadius="5dp" android:topRightRadius="5dp"/>
|
||||
<stroke android:width="0dp"
|
||||
android:color="#e6e6e6" />
|
||||
<solid android:color="@color/button_gray" />
|
||||
|
||||
</shape>
|
||||
</inset>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<inset>
|
||||
<shape android:shape="rectangle">
|
||||
<corners
|
||||
android:bottomRightRadius="5dp" android:bottomLeftRadius="5dp"
|
||||
android:topLeftRadius="5dp" android:topRightRadius="5dp"/>
|
||||
<stroke android:width="0dp"
|
||||
android:color="#e6e6e6" />
|
||||
<solid android:color="#f3f3f3" />
|
||||
|
|
|
@ -7,7 +7,7 @@ buildscript {
|
|||
maven { url 'https://maven.fabric.io/public' }
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.4.1'
|
||||
classpath 'com.android.tools.build:gradle:3.4.2'
|
||||
classpath 'io.fabric.tools:gradle:1.29.0'
|
||||
classpath 'com.google.gms:google-services:4.2.0'
|
||||
}
|
||||
|
|