bug fixes

master
msmannan00 2019-08-15 21:38:32 +05:00
parent c8e907efed
commit e86fad1386
21 changed files with 194 additions and 43 deletions

View File

@ -18,6 +18,7 @@
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme" android:theme="@style/AppTheme"
android:usesCleartextTraffic="true"> android:usesCleartextTraffic="true">
<service android:name="com.darkweb.genesissearchengine.pluginManager.exitManager" android:stopWithTask="false" />
<activity <activity
android:name="com.darkweb.genesissearchengine.appManager.setting_manager.setting_controller" android:name="com.darkweb.genesissearchengine.appManager.setting_manager.setting_controller"
android:windowSoftInputMode="adjustNothing" android:windowSoftInputMode="adjustNothing"

View File

@ -47,10 +47,17 @@ public class database_controller
/*Helper Methods*/ /*Helper Methods*/
public void execSQL(String query) public void execSQL(String query,String[] params)
{
if(params==null)
{ {
database_instance.execSQL(query); database_instance.execSQL(query);
} }
else
{
database_instance.execSQL(query,params);
}
}
public ArrayList<list_row_model> selectHistory(){ public ArrayList<list_row_model> selectHistory(){
ArrayList<list_row_model> tempmodel = new ArrayList<>(); ArrayList<list_row_model> tempmodel = new ArrayList<>();

View File

@ -15,6 +15,7 @@ import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import com.darkweb.genesissearchengine.constants.*; import com.darkweb.genesissearchengine.constants.*;
import com.darkweb.genesissearchengine.dataManager.preference_manager; import com.darkweb.genesissearchengine.dataManager.preference_manager;
import com.darkweb.genesissearchengine.helperMethod;
import com.darkweb.genesissearchengine.pluginManager.fabricManager; import com.darkweb.genesissearchengine.pluginManager.fabricManager;
import com.darkweb.genesissearchengine.pluginManager.localNotification; import com.darkweb.genesissearchengine.pluginManager.localNotification;
import com.darkweb.genesissearchengine.pluginManager.message_manager; import com.darkweb.genesissearchengine.pluginManager.message_manager;
@ -27,7 +28,7 @@ import static com.google.ads.AdRequest.LOGTAG;
class geckoClients class geckoClients
{ {
private GeckoSession session1 = null; public GeckoSession session1 = null;
private GeckoRuntime runtime1 = null; private GeckoRuntime runtime1 = null;
private final Handler internetErrorHandler = new Handler(); private final Handler internetErrorHandler = new Handler();
@ -42,6 +43,7 @@ class geckoClients
private int urlRequestCount = 0; private int urlRequestCount = 0;
private boolean isAppRated = false; private boolean isAppRated = false;
private boolean canAdBeShown = false;
geckoClients() geckoClients()
{ {
@ -51,6 +53,8 @@ class geckoClients
void loadGeckoURL(String url,GeckoView geckoView,boolean isUrlSavable,boolean reinit) void loadGeckoURL(String url,GeckoView geckoView,boolean isUrlSavable,boolean reinit)
{ {
boolean init_status = orbot_manager.getInstance().initOrbot(url); boolean init_status = orbot_manager.getInstance().initOrbot(url);
canAdBeShown = true;
if (init_status) if (init_status)
{ {
if(reinit) if(reinit)
@ -163,9 +167,11 @@ class geckoClients
//message_manager.getInstance().rateApp(); //message_manager.getInstance().rateApp();
} }
} }
else if(isAppRated || 1==1) else if(helperMethod.getHost(navigatedURL).contains(".onion"))
{ {
if(isFirstTimeLoad && navigatedURL.contains(".onion")) home_model.getInstance().getHomeInstance().onShowAd(enums.adID.hidden_onion_start);
canAdBeShown = false;
/*if(isFirstTimeLoad && navigatedURL.contains(".onion"))
{ {
home_model.getInstance().getHomeInstance().onShowAd(enums.adID.hidden_onion_start); home_model.getInstance().getHomeInstance().onShowAd(enums.adID.hidden_onion_start);
} }
@ -176,7 +182,11 @@ class geckoClients
else if(!isFirstTimeLoad && !navigatedURL.contains(".onion")) else if(!isFirstTimeLoad && !navigatedURL.contains(".onion"))
{ {
home_model.getInstance().getHomeInstance().onShowAd(enums.adID.hidden_base); home_model.getInstance().getHomeInstance().onShowAd(enums.adID.hidden_base);
}*/
} }
else
{
canAdBeShown = true;
} }
home_model.getInstance().getHomeInstance().onDisableInternetError(); home_model.getInstance().getHomeInstance().onDisableInternetError();

View File

@ -1,7 +1,10 @@
package com.darkweb.genesissearchengine.appManager.home_activity; package com.darkweb.genesissearchengine.appManager.home_activity;
import android.content.ComponentCallbacks2;
import android.content.Intent;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log;
import android.view.*; import android.view.*;
import android.webkit.*; import android.webkit.*;
import android.widget.*; import android.widget.*;
@ -10,20 +13,22 @@ import androidx.constraintlayout.widget.ConstraintLayout;
import com.darkweb.genesissearchengine.*; import com.darkweb.genesissearchengine.*;
import com.darkweb.genesissearchengine.constants.constants; import com.darkweb.genesissearchengine.constants.constants;
import com.darkweb.genesissearchengine.constants.enums; import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.constants.keys;
import com.darkweb.genesissearchengine.constants.status; import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.dataManager.preference_manager; import com.darkweb.genesissearchengine.dataManager.preference_manager;
import com.darkweb.genesissearchengine.pluginManager.*; import com.darkweb.genesissearchengine.pluginManager.*;
import com.example.myapplication.R; import com.example.myapplication.R;
import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.android.material.floatingactionbutton.FloatingActionButton;
import org.mozilla.geckoview.GeckoSession;
import org.mozilla.geckoview.GeckoView; import org.mozilla.geckoview.GeckoView;
public class home_controller extends AppCompatActivity public class home_controller extends AppCompatActivity implements ComponentCallbacks2
{ {
/*View Webviews*/ /*View Webviews*/
private WebView webView; private WebView webView;
private GeckoView geckoView; private GeckoView geckoView = null;
/*View Objects*/ /*View Objects*/
private ProgressBar progressBar; private ProgressBar progressBar;
@ -58,6 +63,7 @@ public class home_controller extends AppCompatActivity
initializeWebView(); initializeWebView();
initializeLocalEventHandlers(); initializeLocalEventHandlers();
initAdManager(); initAdManager();
initExitService();
orbot_manager.getInstance().reinitOrbot(); orbot_manager.getInstance().reinitOrbot();
viewController.getInstance().initialization(webView,loadingText,progressBar,searchbar,splashScreen,requestFailure,floatingButton, loadingIcon,splashlogo); viewController.getInstance().initialization(webView,loadingText,progressBar,searchbar,splashScreen,requestFailure,floatingButton, loadingIcon,splashlogo);
@ -65,12 +71,9 @@ public class home_controller extends AppCompatActivity
geckoclient.initialize(geckoView); geckoclient.initialize(geckoView);
home_model.getInstance().initialization(); home_model.getInstance().initialization();
initBoogle(); initBoogle();
} }
else else
{ {
//initializeCrashlytics();
initializeAppModel(); initializeAppModel();
setContentView(R.layout.invalid_setup_view); setContentView(R.layout.invalid_setup_view);
message_manager.getInstance().abiError(Build.SUPPORTED_ABIS[0]); message_manager.getInstance().abiError(Build.SUPPORTED_ABIS[0]);
@ -78,9 +81,41 @@ public class home_controller extends AppCompatActivity
} }
public void initExitService()
{
startService(new Intent(getBaseContext(), exitManager.class));
}
public void lowMemoryError()
{
viewController.getInstance().lowMemoryError();
}
public void initAdManager() public void initAdManager()
{ {
admanager.getInstance().initialize(); }
@Override
public void onTrimMemory(int level)
{
if(level==80)
{
preference_manager.getInstance().setBool(keys.low_memory,true);
finish();
}
}
@Override
public void onResume()
{
lowMemoryError();
super.onResume();
}
@Override
public void onPause()
{
super.onPause();
} }
public void initBoogle() public void initBoogle()

View File

@ -159,6 +159,10 @@ public class home_ehandler
{ {
helperMethod.openDownloadFolder(); helperMethod.openDownloadFolder();
} }
else if (menuId == R.id.menu9)
{
helperMethod.openActivity(setting_controller.class,constants.list_history);
}
} }
@ -170,8 +174,8 @@ public class home_ehandler
if(status.search_status.equals("Google")) if(status.search_status.equals("Google"))
{ {
preference_manager.getInstance().setString(keys.search_engine,"Darkweb"); preference_manager.getInstance().setString(keys.search_engine,"Hidden Web");
status.search_status = "Darkweb"; status.search_status = "Hidden Web";
home_model.getInstance().getHomeInstance().initSearchEngine(); home_model.getInstance().getHomeInstance().initSearchEngine();
} }
else else

View File

@ -76,7 +76,7 @@ public class home_model
} }
else else
{ {
database_controller.getInstance().execSQL("delete from history where 1"); database_controller.getInstance().execSQL("delete from history where 1",null);
} }
home_model.getInstance().getHomeInstance().reInitializeSuggestion(); home_model.getInstance().getHomeInstance().reInitializeSuggestion();
} }
@ -84,7 +84,7 @@ public class home_model
if(history.size()> constants.max_history_size) if(history.size()> constants.max_history_size)
{ {
database_controller.getInstance().execSQL("delete from history where id="+history.get(history.size()-1).getId()); database_controller.getInstance().execSQL("delete from history where id="+history.get(history.size()-1).getId(),null);
history.remove(history.size()-1); history.remove(history.size()-1);
} }
@ -97,7 +97,11 @@ public class home_model
addSuggestions(url); addSuggestions(url);
SimpleDateFormat d_form = new SimpleDateFormat("dd MMMM | hh:mm a"); SimpleDateFormat d_form = new SimpleDateFormat("dd MMMM | hh:mm a");
String date = d_form.format(new Date()); String date = d_form.format(new Date());
database_controller.getInstance().execSQL("INSERT INTO history(id,date,url) VALUES("+autoval+",'"+date+"','"+url+"');");
String[] params = new String[1];
params[0] = url;
database_controller.getInstance().execSQL("INSERT INTO history(id,date,url) VALUES("+autoval+",'"+date+"',?);",params);
history.add(0,new list_row_model(url,date,autoval)); history.add(0,new list_row_model(url,date,autoval));
} }
public ArrayList<list_row_model> getHistory() { public ArrayList<list_row_model> getHistory() {
@ -105,14 +109,14 @@ public class home_model
} }
public void initializeBookmarks(){ private void initializeBookmarks(){
bookmarks = database_controller.getInstance().selectBookmark(); bookmarks = database_controller.getInstance().selectBookmark();
} }
public void addBookmark(String url,String title){ public void addBookmark(String url,String title){
int autoval = 0; int autoval = 0;
if(bookmarks.size()> constants.max_bookmark_size) if(bookmarks.size()> constants.max_bookmark_size)
{ {
database_controller.getInstance().execSQL("delete from bookmark where id="+bookmarks.get(bookmarks.size()-1).getId()); database_controller.getInstance().execSQL("delete from bookmark where id="+bookmarks.get(bookmarks.size()-1).getId(),null);
bookmarks.remove(history.size()-1); bookmarks.remove(history.size()-1);
} }
@ -125,7 +129,12 @@ public class home_model
{ {
title = "New_Bookmark"+autoval; title = "New_Bookmark"+autoval;
} }
database_controller.getInstance().execSQL("INSERT INTO bookmark(id,title,url) VALUES("+autoval+",'"+title+"','"+url+"');");
String[] params = new String[2];
params[0] = title;
params[1] = url;
database_controller.getInstance().execSQL("INSERT INTO bookmark(id,title,url) VALUES("+autoval+",?,?);",params);
bookmarks.add(0,new list_row_model(url,title,autoval)); bookmarks.add(0,new list_row_model(url,title,autoval));
} }
public ArrayList<list_row_model> getBookmark(){ public ArrayList<list_row_model> getBookmark(){

View File

@ -462,7 +462,7 @@ public class viewController
if(status.search_status.equals("Google")) if(status.search_status.equals("Google"))
{ {
item.setTitle("Switch | Secure Darkweb"); item.setTitle("Switch | Secure Hidden Web");
} }
else else
{ {
@ -491,4 +491,13 @@ public class viewController
return searchbar.getText().toString(); return searchbar.getText().toString();
} }
public void lowMemoryError()
{
if(preference_manager.getInstance().getBool(keys.low_memory,false))
{
preference_manager.getInstance().setBool(keys.low_memory,false);
helperMethod.showToast("App Closed Due To Low Memory");
}
}
} }

View File

@ -46,6 +46,29 @@ public class webviewClient
} }
else else
{ {
/* if(url.startsWith("https://boogle.store/search?"))
{
url = url.replace("https://boogle.store/search?q=random&p_num=1&s_type=image","https://duckduckgo.com/?q=onion+links+websites&iar=images&iax=images&ia=images");
url = url.replace("boogle.store/search?","duckduckgo.com/?");
url = url.replace("q=","q=onion+links+");
url = url.replace("&s_type=image","&ia=images&iax=images");
home_model.getInstance().getHomeInstance().stopHiddenView(false,false);
fabricManager.getInstance().sendEvent("BASE SIMPLE SEARCHED : " + url);
isGeckoView = true;
if(orbot_manager.getInstance().initOrbot(url))
{
home_model.getInstance().getHomeInstance().onloadURL(url,true,true);
}
return true;
}
else
{
home_model.getInstance().addNavigation(url,enums.navigationType.base);
home_model.getInstance().addHistory(url);
fabricManager.getInstance().sendEvent("BASE ONION SEARCHED : " + url);
home_model.getInstance().getHomeInstance().onRequestTriggered(false,url);
} */
home_model.getInstance().addNavigation(url,enums.navigationType.base); home_model.getInstance().addNavigation(url,enums.navigationType.base);
home_model.getInstance().addHistory(url); home_model.getInstance().addHistory(url);
fabricManager.getInstance().sendEvent("BASE ONION SEARCHED : " + url); fabricManager.getInstance().sendEvent("BASE ONION SEARCHED : " + url);

View File

@ -101,7 +101,7 @@ public class list_model
{ {
table = strings.history_text; table = strings.history_text;
} }
database_controller.getInstance().execSQL("delete from "+table+" where id="+index); database_controller.getInstance().execSQL("delete from "+table+" where id="+index,null);
} }

View File

@ -56,7 +56,7 @@ class list_view_controller
{ {
table = strings.history_text; table = strings.history_text;
} }
database_controller.getInstance().execSQL("delete from "+table+" where 1"); database_controller.getInstance().execSQL("delete from "+table+" where 1",null);
list_model.getInstance().getListInstance().initializeList(); list_model.getInstance().getListInstance().initializeList();
} }

View File

@ -9,6 +9,7 @@ public class keys
/*Home page*/ /*Home page*/
public static String homepage_html_key = "internalhtml"; public static String homepage_html_key = "internalhtml";
public static String low_memory = "low_memory";
/*Proxy Manager*/ /*Proxy Manager*/

View File

@ -22,7 +22,7 @@ public class status
{ {
status.java_status = preference_manager.getInstance().getBool(keys.java_script,true); status.java_status = preference_manager.getInstance().getBool(keys.java_script,true);
status.history_status = preference_manager.getInstance().getBool(keys.history_clear,true); status.history_status = preference_manager.getInstance().getBool(keys.history_clear,true);
status.search_status = preference_manager.getInstance().getString(keys.search_engine,"Darkweb"); status.search_status = preference_manager.getInstance().getString(keys.search_engine,"Hidden Web");
} }
} }

View File

@ -69,7 +69,7 @@ public class strings
/*Text Manager*/ /*Text Manager*/
public static String darkweb = "Darkweb"; public static String darkweb = "Hidden Web";
public static String emptyStr = ""; public static String emptyStr = "";
public static String bookmark_text = "bookmark"; public static String bookmark_text = "bookmark";
public static String history_text = "history"; public static String history_text = "history";

View File

@ -16,6 +16,7 @@ import android.view.WindowManager;
import android.view.animation.Animation; import android.view.animation.Animation;
import android.view.animation.RotateAnimation; import android.view.animation.RotateAnimation;
import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodManager;
import android.widget.Toast;
import androidx.core.app.ShareCompat; import androidx.core.app.ShareCompat;
import com.darkweb.genesissearchengine.appManager.home_activity.home_model; import com.darkweb.genesissearchengine.appManager.home_activity.home_model;
import com.darkweb.genesissearchengine.constants.keys; import com.darkweb.genesissearchengine.constants.keys;
@ -174,4 +175,9 @@ public class helperMethod
intent.setData(Uri.parse("market://details?id="+packageName)); intent.setData(Uri.parse("market://details?id="+packageName));
home_model.getInstance().getHomeInstance().startActivity(intent); home_model.getInstance().getHomeInstance().startActivity(intent);
} }
public static void showToast(String messaage)
{
Toast.makeText(home_model.getInstance().getHomeInstance().getApplicationContext(),messaage,Toast.LENGTH_SHORT).show();
}
} }

View File

@ -2,7 +2,9 @@ package com.darkweb.genesissearchengine.pluginManager;
import com.darkweb.genesissearchengine.appManager.home_activity.home_model; import com.darkweb.genesissearchengine.appManager.home_activity.home_model;
import com.darkweb.genesissearchengine.constants.enums; import com.darkweb.genesissearchengine.constants.enums;
import com.example.myapplication.R;
import com.google.android.gms.ads.AdRequest; import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import com.google.android.gms.ads.InterstitialAd; import com.google.android.gms.ads.InterstitialAd;
import com.google.android.gms.ads.MobileAds; import com.google.android.gms.ads.MobileAds;
@ -16,6 +18,7 @@ public class admanager
private InterstitialAd mInterstitialHidden_base; private InterstitialAd mInterstitialHidden_base;
private int adCount = 0; private int adCount = 0;
boolean isAdShown = false; boolean isAdShown = false;
private AdView bannerAds = null;
/*Initializations*/ /*Initializations*/
@ -30,19 +33,29 @@ public class admanager
{ {
MobileAds.initialize(home_model.getInstance().getHomeInstance(), "ca-app-pub-5074525529134731~2926711128"); MobileAds.initialize(home_model.getInstance().getHomeInstance(), "ca-app-pub-5074525529134731~2926711128");
mInterstitialHidden_base = initAd("ca-app-pub-5074525529134731/1637043432"); mInterstitialHidden_base = initAd("ca-app-pub-5074525529134731/1637043432");
//mInterstitialHidden_onion = initAd("ca-app-pub-5074525529134731/4332539288"); // initBannerAds();
//mInterstitialInternal = initAd("ca-app-pub-5074525529134731/8478420705"); // mInterstitialHidden_onion = initAd("ca-app-pub-5074525529134731/4332539288");
// mInterstitialInternal = initAd("ca-app-pub-5074525529134731/8478420705");
} }
public InterstitialAd initAd(String id) public InterstitialAd initAd(String id)
{ {
InterstitialAd adInstance = new InterstitialAd(home_model.getInstance().getHomeInstance()); InterstitialAd adInstance = new InterstitialAd(home_model.getInstance().getHomeInstance());
adInstance.setAdUnitId(id); adInstance.setAdUnitId(id);
adInstance.loadAd(new AdRequest.Builder().build()); adInstance.loadAd(new AdRequest.Builder().addTestDevice("5AAFC2DFAE5C3906292EB576F0822FD7").build());
return adInstance; return adInstance;
} }
private void initBannerAds()
{
// bannerAds = home_model.getInstance().getHomeInstance().findViewById(R.id.adView);
// AdRequest request = new AdRequest.Builder()
// .addTestDevice("5AAFC2DFAE5C3906292EB576F0822FD7")
// .build();
// bannerAds.loadAd(request );
}
/*Helper Methods*/ /*Helper Methods*/
public void showAd(enums.adID id) public void showAd(enums.adID id)
@ -50,7 +63,7 @@ public class admanager
if(id.equals(enums.adID.hidden_onion_start)) if(id.equals(enums.adID.hidden_onion_start))
{ {
mInterstitialHidden_base.show(); mInterstitialHidden_base.show();
mInterstitialHidden_base.loadAd(new AdRequest.Builder().build()); mInterstitialHidden_base.loadAd(new AdRequest.Builder().addTestDevice("5AAFC2DFAE5C3906292EB576F0822FD7").build());
} }
/*else if(id.equals(enums.adID.hidden_onion)) /*else if(id.equals(enums.adID.hidden_onion))
{ {

View File

@ -0,0 +1,32 @@
package com.darkweb.genesissearchengine.pluginManager;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import com.darkweb.genesissearchengine.constants.keys;
import com.darkweb.genesissearchengine.dataManager.preference_manager;
public class exitManager extends Service {
@Override
public IBinder onBind(Intent intent) {
return null;
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
return START_NOT_STICKY;
}
@Override
public void onDestroy() {
super.onDestroy();
preference_manager.getInstance().setBool(keys.low_memory,false);
}
@Override
public void onTaskRemoved(Intent rootIntent) {
stopSelf();
preference_manager.getInstance().setBool(keys.low_memory,false);
}
}

View File

@ -252,7 +252,4 @@
app:layout_constraintEnd_toEndOf="parent" android:layout_marginBottom="24dp" app:layout_constraintEnd_toEndOf="parent" android:layout_marginBottom="24dp"
android:layout_marginEnd="24dp"/> android:layout_marginEnd="24dp"/>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -8,6 +8,10 @@
android:title="Switch | Secure Google" android:title="Switch | Secure Google"
app:showAsAction="always" app:showAsAction="always"
android:icon="@android:drawable/btn_star"/> android:icon="@android:drawable/btn_star"/>
<item android:id="@+id/menu9"
android:title="Manage Search Engine"
app:showAsAction="always"
android:icon="@android:drawable/btn_star"/>
</group> </group>
<item android:id="@+id/menu0" <item android:id="@+id/menu0"
android:title="Downloads" android:title="Downloads"

View File

@ -39,7 +39,7 @@
<string name="listview_clear">Clear</string> <string name="listview_clear">Clear</string>
<string-array name="search_engines"> <string-array name="search_engines">
<item>Darkweb</item> <item>Hidden Web</item>
<item>Google</item> <item>Google</item>
<item>Bing</item> <item>Bing</item>
</string-array> </string-array>

View File

@ -1,24 +1,24 @@
/*arm versions*/ /*arm versions*/
project.ext.arm_vname = '205' project.ext.arm_vname = '225'
project.ext.arm_vcode = 205 project.ext.arm_vcode = 225
/*aarch versions*/ /*aarch versions*/
project.ext.aarch_vname = '206' project.ext.aarch_vname = '226'
project.ext.aarch_vcode = 206 project.ext.aarch_vcode = 226
/*x86 versions*/ /*x86 versions*/
project.ext.x86_vname = '207' project.ext.x86_vname = '227'
project.ext.x86_vcode = 207 project.ext.x86_vcode = 227
/*x64 versions*/ /*x64 versions*/
project.ext.x64_vname = '208' project.ext.x64_vname = '228'
project.ext.x64_vcode = 208 project.ext.x64_vcode = 228
/*dimension*/ /*dimension*/
project.ext.dimen = 'abi' project.ext.dimen = 'abi'
/*firefox version*/ /*firefox version*/
project.ext.firefox_version = "70.0.20190809215748" project.ext.firefox_version = "70.0.20190814094216"
project.ext.firefox_channel = "nightly" project.ext.firefox_channel = "nightly"
/*Application Preferences*/ /*Application Preferences*/