bug fixes

master
msmannan00 2019-04-28 21:54:22 +05:00
parent 42685474a0
commit c65cd47610
18 changed files with 313 additions and 55 deletions

View File

@ -9,11 +9,11 @@ ext {
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.myapplication"
applicationId "com.darkweb.genesissearchengine"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
versionCode 61
versionName "61.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapplication">
xmlns:tools="http://schemas.android.com/tools" package="com.example.myapplication">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
@ -13,11 +13,11 @@
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:networkSecurityConfig="@xml/network_security_config"
android:usesCleartextTraffic="true">
android:usesCleartextTraffic="true" tools:ignore="GoogleAppIndexingWarning">
<uses-library
android:name="org.apache.http.legacy"
android:required="false" />
<activity android:name=".application_controller"
<activity android:name="com.darkweb.genesissearchengine.application_controller"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN"/>

View File

@ -1,4 +1,4 @@
package com.example.myapplication;
package com.darkweb.genesissearchengine;
import android.app.Activity;
import android.content.Context;

View File

@ -1,4 +1,4 @@
package com.example.myapplication;
package com.darkweb.genesissearchengine;
import android.content.Context;
import com.google.android.gms.ads.AdListener;

View File

@ -1,5 +1,6 @@
package com.example.myapplication;
package com.darkweb.genesissearchengine;
import android.app.Application;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
@ -22,6 +23,7 @@ import java.net.MalformedURLException;
import java.net.URL;
import java.util.Stack;
import com.example.myapplication.R;
import info.guardianproject.netcipher.proxy.OrbotHelper;
import org.mozilla.gecko.PrefsHelper;
import org.mozilla.geckoview.GeckoRuntime;
@ -47,7 +49,7 @@ public class application_controller extends AppCompatActivity
private LinearLayout topbar;
private GeckoSession session1;
private GeckoRuntime runtime1;
private String version_code = "1.0";
private String version_code = "3.0";
private boolean wasBackPressed = false;
private boolean isLoadedUrlSet = false;
private boolean isOnnionUrlHalted = false;
@ -147,12 +149,26 @@ public class application_controller extends AppCompatActivity
webView1.bringToFront();
progressBar.animate().setDuration(150).alpha(0f);
new Thread()
{
public void run()
{
try
{
session1 = new GeckoSession();
runtime1 = GeckoRuntime.create(this);
runtime1 = GeckoRuntime.create(application_controller.this);
session1.open(runtime1);
webLoader.setSession(session1);
session1.setProgressDelegate(new progressDelegate());
webLoader.setVisibility(View.INVISIBLE);
sleep(2000);
}
catch (InterruptedException e)
{
e.printStackTrace();
}
}
}.start();
}
/*Initialization*/
@ -202,16 +218,15 @@ public class application_controller extends AppCompatActivity
return true;
}
searchbar.setText(url.replaceAll("boogle.store","genesis.onion"));
KeyboardUtils.hideKeyboard(application_controller.this);
if(!url.toString().contains("boogle"))
{
boolean init_status=orbot_manager.getInstance().reinitOrbot(application_controller.this);
if(init_status)
{
searchbar.setText(url.replaceAll("boogle.store","genesis.onion"));
KeyboardUtils.hideKeyboard(application_controller.this);
admanager.getInstance().showAd();
boolean init_status=orbot_manager.getInstance().reinitOrbot(application_controller.this);
if(!init_status)
{
progressBar.setAlpha(0);
progressBar.setVisibility(View.VISIBLE);
progressBar.animate().setDuration(150).setDuration(300).alpha(1f);
@ -231,11 +246,17 @@ public class application_controller extends AppCompatActivity
}
else
{
searchbar.setText(url.replaceAll("boogle.store","genesis.onion"));
KeyboardUtils.hideKeyboard(application_controller.this);
if(traceUrlList.size()==0 || !status.currentURL.equals(traceUrlList.peek()))
{
traceUrlList.add(status.currentURL);
status.currentURL = url;
}
if(url.contains("?"))
{
url = url+"&savesearch=on";
}
loadURLAnimate(url);
return true;
}
@ -319,6 +340,13 @@ class progressDelegate implements GeckoSession.ProgressDelegate
@Override
public void onPageStart(GeckoSession session, String url)
{
if(!orbot_manager.getInstance().reinitOrbot(application_controller.this))
{
session1.stop();
session1.close();
return;
}
if(isOnnionUrlHalted)
{
return;
@ -450,7 +478,6 @@ class progressDelegate implements GeckoSession.ProgressDelegate
public void onBackPressed()
{
session1.stop();
orbot_manager.getInstance().reinitOrbot(this);
if(traceUrlList.size()>0)
{
searchbar.setText(traceUrlList.peek().toString().replaceAll("boogle.store","genesis.onion"));

View File

@ -1,4 +1,4 @@
package com.example.myapplication;
package com.darkweb.genesissearchengine;
public class constants
{

View File

@ -1,4 +1,4 @@
package com.example.myapplication;
package com.darkweb.genesissearchengine;
public class datamodel
{

View File

@ -1,4 +1,4 @@
package com.example.myapplication;
package com.darkweb.genesissearchengine;
import android.content.Context;
import android.net.ConnectivityManager;

View File

@ -1,9 +1,10 @@
package com.example.myapplication;
package com.darkweb.genesissearchengine;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.view.View;
import com.example.myapplication.R;
import com.yarolegovich.lovelydialog.LovelyInfoDialog;
import com.yarolegovich.lovelydialog.LovelyStandardDialog;

View File

@ -1,4 +1,4 @@
package com.example.myapplication;
package com.darkweb.genesissearchengine;
import android.content.BroadcastReceiver;
import android.content.Context;
@ -6,6 +6,7 @@ import android.content.Intent;
import android.net.Uri;
import android.text.TextUtils;
import android.view.View;
import com.example.myapplication.R;
import com.yarolegovich.lovelydialog.LovelyStandardDialog;
import info.guardianproject.netcipher.proxy.OrbotHelper;
@ -67,15 +68,15 @@ public class orbot_manager {
})
.setNegativeButton(android.R.string.no, null)
.show();
return true;
return false;
}
if(!isOrbotRunning)
{
OrbotHelper.get(application_context).init();
message_manager.getInstance().startingOrbotInfo(application_context);
return true;
}
return false;
}
return true;
}
}

View File

@ -1,4 +1,4 @@
package com.example.myapplication;
package com.darkweb.genesissearchengine;
import android.content.Context;
import android.content.SharedPreferences;

View File

@ -1,4 +1,4 @@
package com.example.myapplication;
package com.darkweb.genesissearchengine;
public class status
{

View File

@ -1,4 +1,4 @@
package com.example.myapplication;
package com.darkweb.genesissearchengine;
import android.annotation.SuppressLint;
import android.content.Context;

View File

@ -0,0 +1,217 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.darkweb.genesissearchengine.application_controller">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<WebView
android:id="@+id/pageLoader1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="55dp"
tools:layout_editor_absoluteY="0dp" tools:layout_editor_absoluteX="0dp">
</WebView>
<WebView
android:id="@+id/pageLoader2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="55dp"
tools:layout_editor_absoluteY="0dp" tools:layout_editor_absoluteX="0dp">
</WebView>
<org.mozilla.geckoview.GeckoView
android:id="@+id/webLoader"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0"
android:layout_marginTop="55dp"
tools:layout_editor_absoluteY="8dp" tools:layout_editor_absoluteX="8dp">
</org.mozilla.geckoview.GeckoView>
</FrameLayout>
<android.support.constraint.ConstraintLayout
android:id="@+id/requestFailure"
android:layout_height="match_parent"
app:layout_constraintTop_toTopOf="parent"
android:background="#ffffff"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_width="match_parent"
>
<ImageButton
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#f8f8f8"
android:id="@+id/errorBack" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" android:contentDescription="@string/todo"/>
<TextView
android:layout_width="match_parent"
android:textAlignment="viewStart"
android:textStyle="bold"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:text="@string/errorTiyle"
android:textColor="#4d4d4d"
android:ems="10"
android:id="@+id/editText"
app:layout_constraintTop_toTopOf="parent" android:layout_marginTop="74dp"
app:layout_constraintEnd_toEndOf="parent" tools:ignore="TextViewEdits"/>
<Button
android:text="Reload"
android:onClick="onReloadButtonPressed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/reloadButton"
android:background="@drawable/shape"
android:textColor="#000000"
app:layout_constraintBottom_toBottomOf="parent"
android:radius="1dp"
android:bottomRightRadius="10dp"
android:bottomLeftRadius="10dp"
android:topLeftRadius="10dp"
android:topRightRadius="10dp"
android:layout_marginBottom="36dp" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintHorizontal_bias="0.498" app:layout_constraintEnd_toEndOf="parent"/>
<TextView
android:text="These might be the problems you are facing\n\n\u2022 Webpage or Website might be down\n\u2022 Your Internet connection might be poor\n\u2022 You might be using a proxy\n\u2022 Website might be blocked by firewall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView"
android:textColor="#4d4d4d"
app:layout_constraintTop_toTopOf="parent" android:layout_marginTop="120dp"
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_height="0dp" app:srcCompat="@drawable/interneticon"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView"
app:layout_constraintBottom_toTopOf="@+id/reloadButton" android:layout_marginBottom="35dp"
android:layout_marginTop="35dp"/>
</android.support.constraint.ConstraintLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="55dp"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="55dp"
android:id="@+id/topbar"
android:orientation="horizontal"
android:elevation="10dp"
android:background="@drawable/border"
android:gravity="left" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent">
<ImageButton
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginLeft="5dp"
android:layout_marginTop="10.5dp"
android:id="@+id/home"
android:bottomRightRadius="13dp"
android:bottomLeftRadius="13dp"
android:topLeftRadius="13dp"
android:topRightRadius="13dp"
android:scaleType="fitCenter"
android:src="@drawable/homeicon"
android:onClick="onHomeButtonPressed"
android:background="@drawable/pressedcolor"
/>
<EditText
android:layout_width="0dp"
android:layout_height="match_parent"
android:textSize="16sp"
android:textColor="#333333"
android:selectAllOnFocus="true"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:textColorHighlight="#b3d1ff"
android:background="@drawable/searchbar"
android:textCursorDrawable="@drawable/cursorcolor"
android:hint="@string/SearchHint"
android:text="@string/homeUrl"
android:ems="10"
android:layout_marginTop="8dp"
android:inputType="textNoSuggestions"
android:layout_marginBottom="8dp"
android:layout_marginEnd="10dp"
android:layout_marginStart="5dp"
android:maxLines="1"
android:id="@+id/search" android:layout_weight="1" android:importantForAutofill="no"/>
</LinearLayout>
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ProgressBar
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="108dp"
android:indeterminateTint="#0047b3"
android:id="@+id/progressBar"
android:indeterminateOnly="true"
android:progress="50" app:layout_constraintTop_toTopOf="parent"
/>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent" android:id="@+id/splashScreen"
android:background="@drawable/backgradient"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0" app:layout_constraintVertical_bias="1.0">
<ImageView
android:layout_width="113dp"
android:layout_height="77dp" app:srcCompat="@drawable/logolarge"
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" app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginBottom="80dp"/>
<ProgressBar
style="?android:attr/progressBarStyle"
android:layout_width="95dp"
android:layout_height="95dp"
android:indeterminateTint="#455265"
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:layout_marginBottom="80dp"/>
<ImageView
android:layout_width="100dp"
android:layout_height="70dp" app:srcCompat="@drawable/logolarge"
android:id="@+id/imageView_loading" 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:layout_marginBottom="80dp"/>
<TextView
android:text="@string/projectName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffffff"
android:textStyle="bold"
android:id="@+id/textView3"
app:layout_constraintBottom_toBottomOf="parent" android:layout_marginBottom="16dp"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="35dp"
android:layout_marginEnd="231dp" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"/>
<TextView
android:text="@string/loadingText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffffff"
android:textStyle="bold"
android:id="@+id/notification" 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:layout_marginTop="50dp" android:layout_marginStart="76dp" android:layout_marginEnd="76dp"/>
</android.support.constraint.ConstraintLayout>
</FrameLayout>
</android.support.constraint.ConstraintLayout>

View File

@ -5,7 +5,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".application_controller">
tools:context="com.darkweb.genesissearchengine.application_controller">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
@ -48,21 +48,21 @@
android:background="#f8f8f8"
android:id="@+id/errorBack" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
app:layout_constraintEnd_toEndOf="parent" android:contentDescription="@string/todo"/>
<TextView
android:layout_width="match_parent"
android:textAlignment="viewStart"
android:textStyle="bold"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:text=" Opps! Some Thing Went Wrong"
android:text="@string/errorTiyle"
android:textColor="#4d4d4d"
android:ems="10"
android:id="@+id/editText"
app:layout_constraintTop_toTopOf="parent" android:layout_marginTop="74dp"
app:layout_constraintEnd_toEndOf="parent"/>
app:layout_constraintEnd_toEndOf="parent" tools:ignore="TextViewEdits"/>
<Button
android:text="Reload"
android:text="@string/reload"
android:onClick="onReloadButtonPressed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -78,7 +78,7 @@
android:layout_marginBottom="36dp" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintHorizontal_bias="0.498" app:layout_constraintEnd_toEndOf="parent"/>
<TextView
android:text="These might be the problems you are facing\n\n\u2022 Webpage or Website might be down\n\u2022 Your Internet connection might be poor\n\u2022 You might be using a proxy\n\u2022 Website might be blocked by firewall"
android:text="@string/internetErrorMessage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView"
@ -93,7 +93,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView"
app:layout_constraintBottom_toTopOf="@+id/reloadButton" android:layout_marginBottom="35dp"
android:layout_marginTop="35dp"/>
android:layout_marginTop="35dp" android:contentDescription="@string/todo"/>
</android.support.constraint.ConstraintLayout>
<FrameLayout
android:layout_width="match_parent"
@ -108,11 +108,12 @@
android:elevation="10dp"
android:background="@drawable/border"
android:gravity="left" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent">
app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent"
tools:ignore="RtlHardcoded,UselessParent">
<ImageButton
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginLeft="5dp"
android:layout_marginStart="5dp"
android:layout_marginTop="10.5dp"
android:id="@+id/home"
android:bottomRightRadius="13dp"
@ -123,11 +124,11 @@
android:src="@drawable/homeicon"
android:onClick="onHomeButtonPressed"
android:background="@drawable/pressedcolor"
/>
android:contentDescription="@string/todo"/>
<EditText
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="match_parent"
android:textSize="16dp"
android:textSize="16sp"
android:textColor="#333333"
android:selectAllOnFocus="true"
android:paddingLeft="10dp"
@ -135,16 +136,17 @@
android:textColorHighlight="#b3d1ff"
android:background="@drawable/searchbar"
android:textCursorDrawable="@drawable/cursorcolor"
android:hint="Search or type web address"
android:text="https://genesis.onion"
android:hint="@string/SearchHint"
android:text="@string/homeUrl"
android:ems="10"
android:layout_marginTop="8dp"
android:inputType="textNoSuggestions"
android:layout_marginBottom="8dp"
android:layout_marginRight="10dp"
android:layout_marginLeft="5dp"
android:layout_marginEnd="10dp"
android:layout_marginStart="5dp"
android:maxLines="1"
android:id="@+id/search" android:layout_weight="1"/>
android:id="@+id/search" android:layout_weight="1" android:importantForAutofill="no"
tools:targetApi="o"/>
</LinearLayout>
</FrameLayout>
@ -173,7 +175,7 @@
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" app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginBottom="80dp"/>
android:layout_marginBottom="80dp" android:contentDescription="@string/todo"/>
<ProgressBar
style="?android:attr/progressBarStyle"
android:layout_width="95dp"
@ -189,9 +191,9 @@
android:id="@+id/imageView_loading" 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:layout_marginBottom="80dp"/>
android:layout_marginBottom="80dp" android:contentDescription="@string/todo"/>
<TextView
android:text="Genesis Search Engine"
android:text="@string/projectName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffffff"
@ -202,7 +204,7 @@
android:layout_marginEnd="231dp" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"/>
<TextView
android:text="Loading Please Wait"
android:text="@string/loadingText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffffff"

View File

@ -1,3 +1,13 @@
<resources>
<string name="app_name">Genesis</string>
<string name="SearchHint">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>
<string name="projectName">Genesis Search Engine</string>
<string name="loadingText">Loading Please Wait</string>
<string name="reload">Reload</string>
<string name="internetErrorMessage">These might be the problems you are facing \n\n• Webpage or Website might be down \n•
Your Internet connection might be poor \n• You might be using a proxy \n• Website might be blocked by firewall
</string>
</resources>

BIN
genesis.jks Normal file

Binary file not shown.

Binary file not shown.