bug fixes

master
msmannan00 2019-06-11 11:41:03 +05:00
parent 2e8b8ac629
commit 3a7f1f3896
11 changed files with 167 additions and 73 deletions

View File

@ -44,27 +44,26 @@ android {
productFlavors {
/*arm {
versionCode 152
versionName "152"
versionCode 156
versionName "156"
dimension "abi"
buildConfigField "String", "VARIANT", "\"arm\""
}*/
}
aarch64 {
versionCode 153
versionName "153"
versionCode 157
versionName "157"
dimension "abi"
buildConfigField "String", "VARIANT", "\"aarch64\""
}
/*
}*/
x86 {
versionCode 154
versionName "154"
versionCode 158
versionName "158"
dimension "abi"
buildConfigField "String", "VARIANT", "\"i686\""
}
/*x86_64 {
versionCode 155
versionName "155"
}/*
x86_64 {
versionCode 159
versionName "159"
dimension "abi"
buildConfigField "String", "VARIANT", "\"x86_64\""
}*/
@ -109,10 +108,10 @@ dependencies {
implementation 'com.google.android.gms:play-services-ads:17.1.1'
implementation "cz.msebera.android:httpclient:4.4.1.2"
//x86Implementation "org.mozilla.geckoview:geckoview-x86:67.0.20190521210220"
x86Implementation "org.mozilla.geckoview:geckoview-x86:67.0.20190521210220"
//x86_64Implementation "org.mozilla.geckoview:geckoview-x86_64:67.0.20190521210220"
//armImplementation "org.mozilla.geckoview:geckoview-armeabi-v7a:67.0.20190521210220"
aarch64Implementation "org.mozilla.geckoview:geckoview-arm64-v8a:67.0.20190521210220"
//aarch64Implementation "org.mozilla.geckoview:geckoview-arm64-v8a:67.0.20190521210220"
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.9'
implementation 'com.crowdfire.cfalertdialog:cfalertdialog:1.1.0'

View File

@ -27,7 +27,7 @@
</activity>
<meta-data
android:name="io.fabric.ApiKey"
android:value="be76c64dae2519d4ab8daaed88298da14c7c294f"
android:value="be76c64dae2519d4ab8daaed88298da14c7candroid:largeScreens294f"
/>
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"

View File

@ -13,11 +13,13 @@ import android.os.Build;
import android.os.Handler;
import android.support.constraint.ConstraintLayout;
import android.os.Bundle;
import android.support.constraint.ConstraintSet;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AppCompatActivity;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.style.ForegroundColorSpan;
import android.util.DisplayMetrics;
import android.util.Log;
import android.util.Patterns;
import android.view.*;
@ -53,7 +55,7 @@ public class application_controller extends AppCompatActivity
private GeckoView webLoader;
private ProgressBar progressBar;
private ConstraintLayout requestFailure;
private FrameLayout splashScreen;
private ConstraintLayout splashScreen;
private FloatingActionButton floatingButton;
private Button reloadButton;
private ImageButton homeButton;
@ -81,10 +83,10 @@ public class application_controller extends AppCompatActivity
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.application_view);
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"))
{
//initializeCrashlytics();
initializeCrashlytics();
initializeBackgroundColor();
setContentView(R.layout.application_view);
orbot_manager.getInstance().initializeTorClient(this, webView1, webView2);
@ -102,6 +104,7 @@ public class application_controller extends AppCompatActivity
setContentView(R.layout.invalid_setup);
message_manager.getInstance().abiError(this,Build.SUPPORTED_ABIS[0]);
}
}
public void setOrientation()
@ -112,27 +115,56 @@ public class application_controller extends AppCompatActivity
public void initSplashScreen()
{
ImageView view = findViewById(R.id.imageView_loading_back);
RotateAnimation rotate = new RotateAnimation(0, 360,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
0.5f);
RotateAnimation rotate = new RotateAnimation(0, 360,Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,0.5f);
rotate.setDuration(2000);
rotate.setRepeatCount(Animation.INFINITE);
view.setAnimation(rotate);
Display display = getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
float width_x = size.x;
float height_y = size.y;
ImageView splashlogo = findViewById(R.id.backsplash);
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) splashlogo.getLayoutParams();
//int height = Resources.getSystem().getDisplayMetrics().heightPixels+getStatusBarHeight(this);
//splashlogo.getLayoutParams().height = splashlogo.getLayoutParams().height-300;
int height = screenHeight();
splashlogo.getLayoutParams().height = height;
params.topMargin = getStatusBarHeight(this)/2;
splashlogo.setLayoutParams(params);
ImageView loading = findViewById(R.id.imageView_loading_back);
double heightloader = Resources.getSystem().getDisplayMetrics().heightPixels*0.78;
ViewGroup.MarginLayoutParams params_loading = (ViewGroup.MarginLayoutParams) loading.getLayoutParams();
params_loading.topMargin = (int)(heightloader);
loading.setLayoutParams(params_loading);
}
public int screenHeight()
{
if(!hasSoftKeys(this.getWindowManager()))
{
return (int)(Resources.getSystem().getDisplayMetrics().heightPixels)-(getNavigationBarHeight(this));
}
else
{
return (int)(Resources.getSystem().getDisplayMetrics().heightPixels);
}
}
public boolean hasSoftKeys(WindowManager windowManager)
{
Display d = windowManager.getDefaultDisplay();
DisplayMetrics realDisplayMetrics = new DisplayMetrics();
d.getRealMetrics(realDisplayMetrics);
int realHeight = realDisplayMetrics.heightPixels;
int realWidth = realDisplayMetrics.widthPixels;
DisplayMetrics displayMetrics = new DisplayMetrics();
d.getMetrics(displayMetrics);
int displayHeight = displayMetrics.heightPixels;
int displayWidth = displayMetrics.widthPixels;
return (realWidth - displayWidth) > 0 || (realHeight - displayHeight) > 0;
}
public int getStatusBarHeight(Context c) {
@ -144,6 +176,16 @@ public class application_controller extends AppCompatActivity
return result;
}
public int getNavigationBarHeight(Context c) {
Resources resources = c.getResources();
int resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android");
if (resourceId > 0) {
return resources.getDimensionPixelSize(resourceId);
}
return 0;
}
public void initializeBackgroundColor()
{
if (android.os.Build.VERSION.SDK_INT > Build.VERSION_CODES.M){
@ -219,9 +261,7 @@ public class application_controller extends AppCompatActivity
{
webRequestHandler.getInstance().initialization(webView1,webView2,progressBar,searchbar, splashScreen,this, requestFailure,this);
webView1.bringToFront();
Log.i("PROBLEM25","");
progressBar.animate().setDuration(150).alpha(0f);
//floatingButton.setAlpha(0);
session1 = new GeckoSession();
runtime1 = GeckoRuntime.getDefault(application_controller.this);
@ -237,7 +277,6 @@ public class application_controller extends AppCompatActivity
Drawable img = getResources().getDrawable( R.drawable.lock );
searchbar.measure(0, 0);
img.setBounds( 0, (int)(searchbar.getMeasuredHeight()*0.00), (int)(searchbar.getMeasuredHeight()*1.10), (int)(searchbar.getMeasuredHeight()*0.69) );
//img.setBounds( 0, 0, 50, 31 );
searchbar.setCompoundDrawables( img, null, null, null );
}
@ -393,7 +432,7 @@ public class application_controller extends AppCompatActivity
super.onPageFinished(view, url);
handler = new Handler();
int delay = 200;
int delay = 150;
if(startPage>2)
{
delay = 0;
@ -423,13 +462,12 @@ public class application_controller extends AppCompatActivity
progressBar.animate().setDuration(150).alpha(0f).withEndAction((() -> progressBar.setVisibility(View.INVISIBLE)));;
}
splashScreen.animate().alpha(0.0f).setStartDelay(150).setDuration(200).setListener(null).withEndAction((() -> splashScreen.setVisibility(View.GONE)));
if(!status.hasApplicationLoaded)
{
status.hasApplicationLoaded = true;
handler = new Handler();
splashScreen.animate().alpha(0.0f).setStartDelay(100).setDuration(300).setListener(null).withEndAction((() -> splashScreen.setVisibility(View.GONE)));
Handler popuphandler = new Handler();
popuphandler.postDelayed(new Runnable() {
@ -447,7 +485,7 @@ public class application_controller extends AppCompatActivity
}
}
}
}, 2000);
}, 1000);
}
@ -917,7 +955,7 @@ class progressDelegate implements GeckoSession.ProgressDelegate
}
else
{
String editedURL = "https://boogle.store/search?q="+v.getText().toString().replaceAll(" ","+")+"&p_num=1&s_type=all";
String editedURL = "https://boogle.store/search?q="+v.getText().toString().replaceAll(" ","+")+"&p_num=1&s_type=all&savesearch=on";
status.currentURL = editedURL;
searchbar.setText(editedURL.replace("boogle.store","genesis.onion"));
searchbar.clearFocus();
@ -927,7 +965,7 @@ class progressDelegate implements GeckoSession.ProgressDelegate
}
catch (IOException e)
{
String editedURL = "https://boogle.store/search?q="+v.getText().toString().replaceAll(" ","+")+"&p_num=1&s_type=all";
String editedURL = "https://boogle.store/search?q="+v.getText().toString().replaceAll(" ","+")+"&p_num=1&s_type=all&savesearch=on";
status.currentURL = editedURL;
searchbar.clearFocus();
searchbar.setText(editedURL.replace("boogle.store","genesis.onion"));

View File

@ -2,6 +2,6 @@ package com.darkweb.genesissearchengine;
public class buildconstants
{
//public static String build_type = "playstore";
public static String build_type = "local";
public static String build_type = "playstore";
//public static String build_type = "local";
}

View File

@ -188,10 +188,10 @@ public class message_manager {
{
CFAlertDialog.Builder builder = new CFAlertDialog.Builder(application_context)
.setDialogStyle(CFAlertDialog.CFAlertStyle.BOTTOM_SHEET)
.setTitle("Initializing Dark Web")
.setTitle("Initializing")
.setBackgroundColor(Color.argb(230,33,45,69))
.setTextColor(Color.argb(255,255,255,255))
.setMessage("Please wait! While we connect you to hidden web. This might take few seconds\n")
.setMessage("Please wait! While we connect you to hidden web. This might take few minutes\n")
.addButton("Dismiss", -1, -1, CFAlertDialog.CFAlertActionStyle.POSITIVE, CFAlertDialog.CFAlertActionAlignment.END, (dialog, which) -> {
dialog.dismiss();
});

View File

@ -41,10 +41,11 @@ public class webRequestHandler
private WebView[] view = new WebView[2];
private ProgressBar progressBar;
private EditText searchbar;
private FrameLayout requestFailure;
private ConstraintLayout requestFailure;
public boolean reloadError=false;
public boolean isReloadedUrl = false;
public boolean isHomeCacheUpdated = false;
private int viewIndex = 1;
private int currentViewIndex = 0;
private String html = "";
@ -69,7 +70,7 @@ public class webRequestHandler
{
}
public void initialization(WebView view1, WebView view2, ProgressBar progressBar, EditText searchbar, FrameLayout requestFailure, Context applicationContext,ConstraintLayout splash,application_controller controller)
public void initialization(WebView view1, WebView view2, ProgressBar progressBar, EditText searchbar, ConstraintLayout splash, Context applicationContext,ConstraintLayout requestFailure,application_controller controller)
{
this.applictionContext = applicationContext;
this.controller = controller;
@ -184,6 +185,7 @@ public class webRequestHandler
Message message = new Message();
message.what = MESSAGE_UPDATE_TEXT_CHILD_THREAD;
updateUIHandler.sendMessage(message);
updateHomePageCache();
return;
}
}
@ -220,7 +222,7 @@ public class webRequestHandler
html = str.toString();
if(url.equals("https://boogle.store"))
{
html = html.replace("/privacy","https://boogle.store/privacy").replace("/about","https://boogle.store/about").replace("/reportus","https://boogle.store/reportus").replace("/search?q=random&p_num=1&s_type=image","https://boogle.store/search?q=random&p_num=1&s_type=image");
html = html.replace("/privacy","https://boogle.store/privacy").replace("/about","https://boogle.store/about").replace("/reportus","https://boogle.store/reportus").replace("\"search\"","https://boogle.store/search").replace("/create","https://boogle.store/create");
Log.i("SHITS","fizza3 " + html);
helperMethod.setInternalHTML(html,applictionContext);
}
@ -368,7 +370,52 @@ public class webRequestHandler
}
/*****--------------------ASYNC TASK--------------------******/
public void updateHomePageCache()
{
if(!isHomeCacheUpdated)
{
isHomeCacheUpdated = true;
String url = "https://boogle.store";
try
{
HttpClient client=new DefaultHttpClient();;
try {
SSLConnectionSocketFactory scsf = new SSLConnectionSocketFactory(
SSLContexts.custom().loadTrustMaterial(null, new TrustSelfSignedStrategy()).build(),
NoopHostnameVerifier.INSTANCE);
client = HttpClients.custom().setSSLSocketFactory(scsf).build();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (KeyManagementException e) {
e.printStackTrace();
} catch (KeyStoreException e) {
e.printStackTrace();
}
request = new HttpGet(url);
baseURL = url;
HttpResponse response = client.execute(request);
InputStream in = response.getEntity().getContent();
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
StringBuilder str = new StringBuilder();
String line = null;
while((line = reader.readLine()) != null)
{
str.append(line);
}
in.close();
html = str.toString();
helperMethod.setInternalHTML(html,applictionContext);
}
catch (Exception ex)
{
}
}
}
}

View File

@ -2,4 +2,9 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@color/splashblue"/>
<item>
<bitmap
android:gravity="center"
android:src="@mipmap/splashlogoclip"/>
</item>
</layer-list>

View File

@ -2,4 +2,9 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@color/splashblue"/>
<item>
<bitmap
android:gravity="center"
android:src="@mipmap/splashlogoclip"/>
</item>
</layer-list>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -87,7 +87,7 @@
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="10dp"
android:layout_marginEnd="10dp" app:layout_constraintEnd_toEndOf="parent"/>
<ImageView
android:layout_width="205dp"
android:layout_width="110dp"
android:layout_height="0dp" app:srcCompat="@drawable/interneticon"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
@ -157,32 +157,32 @@
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="108dp"
android:indeterminateTint="#0047b3"
android:indeterminateTint="#dd4b39"
android:id="@+id/progressBar"
android:indeterminateTintMode="src_in"
android:indeterminateOnly="true"
android:progress="50" app:layout_constraintTop_toTopOf="parent"
/>
<FrameLayout
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:id="@+id/splashScreen"
android:background="@color/splashblue"
android:id="@+id/splashScreen"
android:layout_height="match_parent">
<ImageView
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:id="@+id/backsplash"
android:background="@mipmap/splashlogo"/>
android:background="@drawable/backsplash" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintHorizontal_bias="0.5" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<ImageView
android:layout_width="35dp"
android:layout_height="35dp" app:srcCompat="@drawable/loading"
android:layout_centerInParent="true"
android:layout_gravity="bottom|center_horizontal"
android:layout_marginBottom="200px"
android:id="@+id/imageView_loading_back"/>
</FrameLayout>
android:layout_height="35dp"
app:srcCompat="@drawable/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.support.constraint.ConstraintLayout>
</FrameLayout>
<android.support.design.widget.FloatingActionButton
android:layout_width="wrap_content"

View File

@ -87,7 +87,7 @@
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="10dp"
android:layout_marginEnd="10dp" app:layout_constraintEnd_toEndOf="parent"/>
<ImageView
android:layout_width="205dp"
android:layout_width="150dp"
android:layout_height="0dp" app:srcCompat="@drawable/interneticon"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
@ -157,32 +157,32 @@
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="108dp"
android:indeterminateTint="#0047b3"
android:indeterminateTint="#dd4b39"
android:id="@+id/progressBar"
android:indeterminateTintMode="src_in"
android:indeterminateOnly="true"
android:progress="50" app:layout_constraintTop_toTopOf="parent"
/>
<FrameLayout
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:id="@+id/splashScreen"
android:background="@color/splashblue"
android:id="@+id/splashScreen"
android:layout_height="match_parent">
<ImageView
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:id="@+id/backsplash"
android:background="@mipmap/splashlogo"/>
android:background="@drawable/backsplash" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintHorizontal_bias="0.5" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<ImageView
android:layout_width="35dp"
android:layout_height="35dp" app:srcCompat="@drawable/loading"
android:layout_centerInParent="true"
android:layout_gravity="bottom|center_horizontal"
android:layout_marginBottom="200px"
android:id="@+id/imageView_loading_back"/>
</FrameLayout>
android:layout_height="35dp"
app:srcCompat="@drawable/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.support.constraint.ConstraintLayout>
</FrameLayout>
<android.support.design.widget.FloatingActionButton
android:layout_width="wrap_content"