bug fixes

master
msmannan00 2019-08-12 01:12:53 +05:00
parent ed0c04e917
commit 64be476170
14 changed files with 123 additions and 35 deletions

View File

@ -2,6 +2,7 @@ apply plugin: 'com.android.application'
apply from: 'variables.gradle'
apply plugin: 'maven'
apply plugin: 'io.fabric'
ext {
@ -12,6 +13,7 @@ ext {
repositories {
maven {
url "https://maven.mozilla.org/maven2/"
maven { url 'https://maven.fabric.io/public' }
mavenLocal()
mavenCentral()
google()
@ -19,6 +21,7 @@ repositories {
}
}
android {
compileSdkVersion project.ext.compileSdkVersion
defaultConfig {
@ -96,13 +99,16 @@ dependencies {
implementation 'com.android.support:appcompat-v7:28.0.0'
/*Firefox ABI Splits*/
//implementation "org.mozilla.geckoview:geckoview-${geckoviewChannel}:${geckoviewVersion}"
//x86_64Implementation "org.mozilla.geckoview:geckoview-x86_64:68.0.20190711090008"
//armImplementation "org.mozilla.geckoview:geckoview-armeabi-v7a:68.0.20190711090008"
x86Implementation "org.mozilla.geckoview:geckoview-${geckoviewChannel}:${geckoviewVersion}"
x86_64Implementation "org.mozilla.geckoview:geckoview-${geckoviewChannel}:${geckoviewVersion}"
armImplementation "org.mozilla.geckoview:geckoview-${geckoviewChannel}:${geckoviewVersion}"
aarch64Implementation "org.mozilla.geckoview:geckoview-${geckoviewChannel}:${geckoviewVersion}"
/*Alert Dialog*/
implementation 'com.crowdfire.cfalertdialog:cfalertdialog:1.1.0'
implementation('com.crashlytics.sdk.android:crashlytics:2.10.1@aar') {
transitive = true;
}
/*Onion Proxy*/
implementation 'com.github.jehy:Tor-Onion-Proxy-Library:0.0.7'

View File

@ -4,6 +4,7 @@
package="com.example.myapplication">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
@ -20,9 +21,11 @@
<activity
android:name="com.darkweb.genesissearchengine.appManager.setting_manager.setting_controller"
android:windowSoftInputMode="adjustNothing"
android:screenOrientation="portrait"
android:label="@string/title_activity_setting_controller">
</activity>
<activity android:name="com.darkweb.genesissearchengine.appManager.list_manager.list_controller"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustNothing">
</activity>

View File

@ -5,6 +5,7 @@ import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
import android.os.Environment;
import android.os.Handler;
import android.util.Log;
@ -380,8 +381,10 @@ class geckoClients
void downloadFile()
{
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
localNotification.getInstance().createNotification("Downloading | " + downloadFile,"Starting Download");
}
home_model.getInstance().getHomeInstance().startService(DownloadFileService.getDownloadService(home_model.getInstance().getHomeInstance(), url.toString()+"__"+downloadFile, Environment.DIRECTORY_DOWNLOADS));
localNotification.getInstance().createNotification("Downloading | " + downloadFile,"Starting Download");
}
private class ExampleContentBlockingDelegate

View File

@ -51,9 +51,9 @@ public class home_controller extends AppCompatActivity
setContentView(R.layout.home_view);
initializeAppModel();
preference_manager.getInstance().initialize();
initializeCrashlytics();
status.initStatus();
initializeCrashlytics();
initializeConnections();
initializeWebView();
initializeLocalEventHandlers();
@ -70,6 +70,7 @@ public class home_controller extends AppCompatActivity
}
else
{
//initializeCrashlytics();
initializeAppModel();
setContentView(R.layout.invalid_setup_view);
message_manager.getInstance().abiError(Build.SUPPORTED_ABIS[0]);
@ -160,7 +161,7 @@ public class home_controller extends AppCompatActivity
public void initializeCrashlytics()
{
fabricManager.getInstance().init();
fabricManager.getInstance().init(this);
}
public void initializeWebView()

View File

@ -2,17 +2,22 @@ package com.darkweb.genesissearchengine.appManager.home_activity;
import android.util.Patterns;
import android.view.KeyEvent;
import android.view.MenuItem;
import android.view.View;
import android.view.inputmethod.EditorInfo;
import android.widget.TextView;
import com.darkweb.genesissearchengine.appManager.list_manager.list_controller;
import com.darkweb.genesissearchengine.appManager.setting_manager.setting_controller;
import com.darkweb.genesissearchengine.appManager.setting_manager.setting_model;
import com.darkweb.genesissearchengine.constants.constants;
import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.constants.keys;
import com.darkweb.genesissearchengine.constants.status;
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 com.example.myapplication.R;
import java.io.IOException;
@ -93,12 +98,12 @@ public class home_ehandler
appContoller.onReload();
}
public void onMenuButtonPressed(View view)
void onMenuButtonPressed(View view)
{
appContoller.openMenu(view);
}
public void onHomeButtonPressed()
void onHomeButtonPressed()
{
appContoller.stopHiddenView(true,false);
fabricManager.getInstance().sendEvent("HOME BUTTON PRESSSED : ");
@ -107,25 +112,25 @@ public class home_ehandler
helperMethod.hideKeyboard();
}
public void onFloatingButtonPressed()
void onFloatingButtonPressed()
{
fabricManager.getInstance().sendEvent("FLOATING BUTTON PRESSSED : ");
message_manager.getInstance().reportURL();
}
public void onBackPressed()
void onBackPressed()
{
fabricManager.getInstance().sendEvent("BACK BUTTON PRESSSED : ");
appContoller.onBackPressedView();
}
public void onMenuPressed(int menuId)
void onMenuPressed(int menuId)
{
if (menuId == R.id.menu1) {
helperMethod.openActivity(list_controller.class,constants.list_history);
}
else if (menuId == R.id.menu2) {
helperMethod.openActivity(setting_controller.class,constants.list_history);
switchSearchEngine();
}
else if (menuId == R.id.menu3) {
helperMethod.openActivity(setting_controller.class,constants.list_history);
@ -157,5 +162,29 @@ public class home_ehandler
}
private void switchSearchEngine()
{
setting_model.getInstance().search_status = "Google";
preference_manager.getInstance().setString(keys.search_engine, setting_model.getInstance().search_status);
if(status.search_status.equals("Google"))
{
preference_manager.getInstance().setString(keys.search_engine,"Darkweb");
status.search_status = "Darkweb";
home_model.getInstance().getHomeInstance().initSearchEngine();
}
else
{
if(orbot_manager.getInstance().initOrbot("https://google.com"))
{
preference_manager.getInstance().setString(keys.search_engine,"Google");
status.search_status = "Google";
home_model.getInstance().getHomeInstance().initSearchEngine();
}
}
}
}

View File

@ -1,6 +1,7 @@
package com.darkweb.genesissearchengine.appManager.home_activity;
import android.annotation.SuppressLint;
import android.content.pm.ActivityInfo;
import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
@ -15,6 +16,7 @@ import android.webkit.WebView;
import android.widget.*;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.view.MenuCompat;
import com.darkweb.genesissearchengine.appManager.setting_manager.setting_model;
import com.darkweb.genesissearchengine.constants.*;
import com.darkweb.genesissearchengine.dataManager.preference_manager;
import com.darkweb.genesissearchengine.helperMethod;
@ -164,11 +166,23 @@ public class viewController
try
{
boolean isFirstInstall = preference_manager.getInstance().getBool(keys.hasOrbotInstalled,true);
boolean isHidden = (status.search_status.equals(enums.searchEngine.Google.toString()) || status.search_status.equals(enums.searchEngine.Bing.toString()));
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);
}
if(isHidden)
{
if(!isFirstInstall)
{
startPostTask(messages.LOAD_COMPLETED);
}
else
{
startPostTask(messages.INSTALL_COMPLETED);
}
}
preference_manager.getInstance().setBool(keys.hasOrbotInstalled,false);
startPostTask(messages.DISABLE_SPLASH_SCREEN);
}
@ -196,7 +210,15 @@ public class viewController
@Override
public void handleMessage(Message msg)
{
if(msg.what == messages.UPDATE_LOADING_TEXT)
if(msg.what == messages.INSTALL_COMPLETED)
{
loadingText.setText("Installed Successfully | Starting Search");
}
else if(msg.what == messages.LOAD_COMPLETED)
{
loadingText.setText("Loading Successfully | Starting Search");
}
else if(msg.what == messages.UPDATE_LOADING_TEXT)
{
loadingText.setText(orbot_manager.getInstance().getLogs());
}
@ -436,6 +458,17 @@ public class viewController
home_model.getInstance().getHomeInstance().onMenuOptionSelected(item);
return true;
});
MenuItem item = popup.getMenu().findItem(R.id.menu2);
if(status.search_status.equals("Google"))
{
item.setTitle("Switch | Secure Darkweb");
}
else
{
item.setTitle("Switch | Secure Google");
}
popup.show();
view.bringToFront();
}

View File

@ -45,6 +45,7 @@ class setting_view_controller
private void initJavascript()
{
setting_model.getInstance().java_status = java_status;
if (java_status)
{
javascript.setSelection(0);
@ -57,6 +58,7 @@ class setting_view_controller
private void initHistory()
{
setting_model.getInstance().history_status = history_status;
if (history_status)
{
history.setSelection(0);
@ -71,6 +73,8 @@ class setting_view_controller
private void initSearchEngine()
{
String myString = preference_manager.getInstance().getString(keys.search_engine, strings.darkweb);
setting_model.getInstance().search_status = myString;
ArrayAdapter myAdap = (ArrayAdapter) search.getAdapter();
int spinnerPosition = myAdap.getPosition(myString);
search.setSelection(spinnerPosition);
@ -85,14 +89,17 @@ class setting_view_controller
{
status.search_status = setting_model.getInstance().search_status;
home_model.getInstance().getHomeInstance().initSearchEngine();
preference_manager.getInstance().setString(keys.search_engine, setting_model.getInstance().search_status);
}
else if(status.java_status != setting_model.getInstance().java_status)
{
status.java_status = setting_model.getInstance().java_status;
home_model.getInstance().getHomeInstance().onReInitGeckoView();
preference_manager.getInstance().setBool(keys.java_script, status.java_status);
}
status.history_status = setting_model.getInstance().history_status;
preference_manager.getInstance().setBool(keys.history_clear, status.history_status);
setting_model.getInstance().getSettingInstance().finish();
}

View File

@ -26,15 +26,13 @@ public class settings_ehandler
private void onJavaScriptListener(int position)
{
if(position==1 && setting_model.getInstance().java_status)
if(position==0 && setting_model.getInstance().java_status)
{
setting_model.getInstance().java_status = false;
preference_manager.getInstance().setBool(keys.java_script, false);
}
else if(!setting_model.getInstance().java_status)
{
setting_model.getInstance().java_status = true;
preference_manager.getInstance().setBool(keys.java_script, true);
}
}
@ -43,21 +41,18 @@ public class settings_ehandler
if(!setting_model.getInstance().search_status.equals(parentView.getItemAtPosition(position).toString()))
{
setting_model.getInstance().search_status = parentView.getItemAtPosition(position).toString();
preference_manager.getInstance().setString(keys.search_engine, setting_model.getInstance().search_status);
}
}
private void onHistoryListener(int position)
{
if(position==1 && setting_model.getInstance().history_status)
if(position==0 && setting_model.getInstance().history_status)
{
setting_model.getInstance().history_status = false;
preference_manager.getInstance().setBool(keys.history_clear, false);
}
else if(!setting_model.getInstance().history_status)
{
setting_model.getInstance().history_status = true;
preference_manager.getInstance().setBool(keys.history_clear, true);
}
}

View File

@ -10,4 +10,6 @@ public class messages
public final static int UPDATE_LOADING_TEXT =5;
public final static int SHOW_ADS =6;
public final static int DOWNLOAD_NOTIFICATION =7;
public final static int INSTALL_COMPLETED =8;
public final static int LOAD_COMPLETED =9;
}

View File

@ -1,5 +1,10 @@
package com.darkweb.genesissearchengine.pluginManager;
import android.content.Context;
import com.crashlytics.android.Crashlytics;
import com.darkweb.genesissearchengine.appManager.home_activity.home_model;
import io.fabric.sdk.android.Fabric;
public class fabricManager
{
/*Private Variables*/
@ -17,17 +22,17 @@ public class fabricManager
{
}
public void init()
public void init(Context context)
{
//Fabric.with(home_model.getInstance().getAppContext(), new Crashlytics());
//analyticmanager.getInstance().initialize(home_model.getInstance().getAppContext());
//analyticmanager.getInstance().logUser();
Fabric.with(context, new Crashlytics());
analyticmanager.getInstance().initialize(home_model.getInstance().getAppContext());
analyticmanager.getInstance().logUser();
}
/*Helper Methods*/
public void sendEvent(String value)
{
analyticmanager.getInstance().sendEvent(value);
//analyticmanager.getInstance().sendEvent(value);
}
}

View File

@ -166,7 +166,7 @@ public class orbot_manager {
return "Loading Please Wait";
}
Logs=Logs.replace("FAILED","Securing");
return Logs;
return "Installing | " + Logs;
}
return "Loading Please Wait";
}

View File

@ -174,6 +174,8 @@
android:layout_marginStart="0dp"
android:paddingBottom="19dp"
android:paddingTop="19dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:layout_marginEnd="0dp"
android:id="@+id/menu"
android:scaleType="fitCenter"
@ -230,9 +232,10 @@
android:layout_width="35dp"
android:layout_height="35dp"
app:srcCompat="@drawable/icon_loading"
android:id="@+id/imageView_loading_back" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintHorizontal_bias="0.5" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
android:id="@+id/imageView_loading_back"
app:layout_constraintStart_toEndOf="@+id/backsplash"
app:layout_constraintEnd_toStartOf="@+id/backsplash"
app:layout_constraintBottom_toTopOf="@+id/loadingText" android:layout_marginBottom="25dp"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>
<com.google.android.material.floatingactionbutton.FloatingActionButton

View File

@ -3,6 +3,12 @@
xmlns:tools="http://schemas.android.com/tools"
tools:context="example.javatpoint.com.optionmenu.MainActivity">
<group android:id="@+id/group_0" >
<item android:id="@+id/menu2"
android:title="Switch | Secure Google"
app:showAsAction="always"
android:icon="@android:drawable/btn_star"/>
</group>
<item android:id="@+id/menu0"
android:title="Downloads"
app:showAsAction="always"
@ -11,10 +17,6 @@
android:title="History"
app:showAsAction="always"
android:icon="@android:drawable/btn_star"/>
<item android:id="@+id/menu2"
android:title="Manager Search Engine"
app:showAsAction="always"
android:icon="@android:drawable/btn_star"/>
<item android:id="@+id/menu3"
android:title="Settings"
app:showAsAction="always"

View File

@ -2,12 +2,11 @@ buildscript {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'io.fabric.tools:gradle:1.29.0'
classpath 'io.fabric.tools:gradle:1.31.0'
classpath 'com.google.gms:google-services:4.3.0'
}
}