mirror of https://github.com/LeOS-GSI/LeOS-Genesis
parent
10a9426b67
commit
58329d826b
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -8,11 +8,52 @@
|
||||||
"variantName": "processAarch64ReleaseResources",
|
"variantName": "processAarch64ReleaseResources",
|
||||||
"elements": [
|
"elements": [
|
||||||
{
|
{
|
||||||
"type": "SINGLE",
|
"type": "ONE_OF_MANY",
|
||||||
"filters": [],
|
"filters": [
|
||||||
"versionCode": 600,
|
{
|
||||||
"versionName": "600.0",
|
"filterType": "ABI",
|
||||||
"outputFile": "app-aarch64-release.apk"
|
"value": "x86_64"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"versionCode": 1001,
|
||||||
|
"versionName": "Build | Dark-Origin 1.1",
|
||||||
|
"outputFile": "app-aarch64-x86_64-release.apk"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "ONE_OF_MANY",
|
||||||
|
"filters": [
|
||||||
|
{
|
||||||
|
"filterType": "ABI",
|
||||||
|
"value": "x86"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"versionCode": 1001,
|
||||||
|
"versionName": "Build | Dark-Origin 1.1",
|
||||||
|
"outputFile": "app-aarch64-x86-release.apk"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "ONE_OF_MANY",
|
||||||
|
"filters": [
|
||||||
|
{
|
||||||
|
"filterType": "ABI",
|
||||||
|
"value": "arm64-v8a"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"versionCode": 1001,
|
||||||
|
"versionName": "Build | Dark-Origin 1.1",
|
||||||
|
"outputFile": "app-aarch64-arm64-v8a-release.apk"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "ONE_OF_MANY",
|
||||||
|
"filters": [
|
||||||
|
{
|
||||||
|
"filterType": "ABI",
|
||||||
|
"value": "armeabi-v7a"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"versionCode": 1001,
|
||||||
|
"versionName": "Build | Dark-Origin 1.1",
|
||||||
|
"outputFile": "app-aarch64-armeabi-v7a-release.apk"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -74,11 +74,22 @@ android {
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
minifyEnabled project.ext.minifyEnabled
|
minifyEnabled false
|
||||||
proguardFiles getDefaultProguardFile(project.ext.proguard_file), project.ext.proguard_rule
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
}
|
||||||
|
splits {
|
||||||
|
abi {
|
||||||
|
enable true
|
||||||
|
reset()
|
||||||
|
include 'arm64-v8a'
|
||||||
|
include 'x86'
|
||||||
|
include 'armeabi-v7a'
|
||||||
|
include 'x86_64'
|
||||||
|
universalApk false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
lintOptions {
|
lintOptions {
|
||||||
checkReleaseBuilds project.ext.checkReleaseBuilds
|
checkReleaseBuilds project.ext.checkReleaseBuilds
|
||||||
abortOnError project.ext.abortOnError
|
abortOnError project.ext.abortOnError
|
||||||
|
|
|
@ -14,7 +14,8 @@ import java.util.Collections;
|
||||||
import static com.darkweb.genesissearchengine.constants.enums.etype.GECKO_SCROLL_CHANGED;
|
import static com.darkweb.genesissearchengine.constants.enums.etype.GECKO_SCROLL_CHANGED;
|
||||||
|
|
||||||
public class NestedGeckoView extends GeckoView {
|
public class NestedGeckoView extends GeckoView {
|
||||||
private int mLastY;
|
private int mLastY = 0;
|
||||||
|
private int deltaY = 0;
|
||||||
private final int[] mScrollOffset = new int[2];
|
private final int[] mScrollOffset = new int[2];
|
||||||
private final int[] mScrollConsumed = new int[2];
|
private final int[] mScrollConsumed = new int[2];
|
||||||
private int mNestedOffsetY;
|
private int mNestedOffsetY;
|
||||||
|
@ -43,55 +44,63 @@ public class NestedGeckoView extends GeckoView {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onTouchEvent(MotionEvent ev) {
|
public boolean onTouchEvent(MotionEvent ev) {
|
||||||
boolean eventHandled = false;
|
MotionEvent event = MotionEvent.obtain(ev);
|
||||||
|
|
||||||
final MotionEvent event = MotionEvent.obtain(ev);
|
|
||||||
final int action = event.getActionMasked();
|
final int action = event.getActionMasked();
|
||||||
if (action == MotionEvent.ACTION_DOWN) {
|
int eventY = (int) event.getY();
|
||||||
mNestedOffsetY = 0;
|
|
||||||
}
|
|
||||||
final int eventY = (int) event.getY();
|
|
||||||
event.offsetLocation(0, mNestedOffsetY);
|
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case MotionEvent.ACTION_MOVE:
|
case MotionEvent.ACTION_MOVE:
|
||||||
final boolean allowScroll = status.sFullScreenBrowsing;
|
final boolean allowScroll = !shouldPinOnScreen() &&
|
||||||
|
mInputResult == PanZoomController.INPUT_RESULT_HANDLED;
|
||||||
|
|
||||||
|
if(!status.sSettingEnableZoom){
|
||||||
|
mInputResult = PanZoomController.INPUT_RESULT_UNHANDLED;
|
||||||
|
}
|
||||||
int deltaY = mLastY - eventY;
|
int deltaY = mLastY - eventY;
|
||||||
|
|
||||||
if (allowScroll && dispatchNestedPreScroll(0, deltaY, mScrollConsumed, mScrollOffset)) {
|
if (allowScroll && dispatchNestedPreScroll(0, deltaY, mScrollConsumed, mScrollOffset)) {
|
||||||
deltaY -= mScrollConsumed[1];
|
deltaY -= mScrollConsumed[1];
|
||||||
mLastY = eventY - mScrollOffset[1];
|
event.offsetLocation(0f, -mScrollOffset[1]);
|
||||||
event.offsetLocation(0, -mScrollOffset[1]);
|
|
||||||
mNestedOffsetY += mScrollOffset[1];
|
mNestedOffsetY += mScrollOffset[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
eventHandled = super.onTouchEvent(event);
|
mLastY = eventY - mScrollOffset[1];
|
||||||
mEvent.invokeObserver(Collections.singletonList(deltaY), GECKO_SCROLL_CHANGED);
|
|
||||||
|
|
||||||
if (allowScroll && dispatchNestedScroll(0, mScrollOffset[1], 0, deltaY, mScrollOffset)) {
|
if (allowScroll && dispatchNestedScroll(0, mScrollOffset[1], 0, deltaY, mScrollOffset)) {
|
||||||
event.offsetLocation(0, mScrollOffset[1]);
|
|
||||||
mNestedOffsetY += mScrollOffset[1];
|
|
||||||
mLastY -= mScrollOffset[1];
|
mLastY -= mScrollOffset[1];
|
||||||
|
event.offsetLocation(0f, mScrollOffset[1]);
|
||||||
|
mNestedOffsetY += mScrollOffset[1];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MotionEvent.ACTION_DOWN:
|
case MotionEvent.ACTION_DOWN:
|
||||||
eventHandled = super.onTouchEvent(event);
|
// A new gesture started. Reset handled status and ask GV if it can handle this.
|
||||||
|
mInputResult = PanZoomController.INPUT_RESULT_UNHANDLED;
|
||||||
|
|
||||||
|
updateInputResult(event);
|
||||||
|
|
||||||
|
mNestedOffsetY = 0;
|
||||||
mLastY = eventY;
|
mLastY = eventY;
|
||||||
|
|
||||||
startNestedScroll(ViewCompat.SCROLL_AXIS_VERTICAL);
|
// The event should be handled either by onTouchEvent,
|
||||||
break;
|
// either by onTouchEventForResult, never by both.
|
||||||
|
// Early return if we sent it to updateInputResult(..) which calls onTouchEventForResult.
|
||||||
|
event.recycle();
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// We don't care about other touch events
|
||||||
case MotionEvent.ACTION_UP:
|
case MotionEvent.ACTION_UP:
|
||||||
case MotionEvent.ACTION_CANCEL:
|
case MotionEvent.ACTION_CANCEL:
|
||||||
eventHandled = super.onTouchEvent(event);
|
|
||||||
stopNestedScroll();
|
stopNestedScroll();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
|
||||||
// We don't care about other touch events
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Execute event handler from parent class in all cases
|
||||||
|
final boolean eventHandled = callSuperOnTouchEvent(event);
|
||||||
|
|
||||||
|
// Recycle previously obtained event
|
||||||
|
event.recycle();
|
||||||
|
|
||||||
return eventHandled;
|
return eventHandled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,11 +109,15 @@ public class NestedGeckoView extends GeckoView {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateInputResult(MotionEvent event) {
|
private void updateInputResult(MotionEvent event) {
|
||||||
|
if(status.sSettingEnableZoom){
|
||||||
super.onTouchEventForResult(event).accept(inputResult -> {
|
super.onTouchEventForResult(event).accept(inputResult -> {
|
||||||
mInputResult = inputResult;
|
mInputResult = inputResult;
|
||||||
|
mInputResult = PanZoomController.INPUT_RESULT_UNHANDLED;
|
||||||
|
|
||||||
startNestedScroll(ViewCompat.SCROLL_AXIS_VERTICAL);
|
startNestedScroll(ViewCompat.SCROLL_AXIS_VERTICAL);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public int getInputResult() {
|
public int getInputResult() {
|
||||||
return mInputResult;
|
return mInputResult;
|
||||||
|
|
|
@ -6,7 +6,6 @@ import android.net.Uri;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import com.darkweb.genesissearchengine.appManager.activityContextManager;
|
import com.darkweb.genesissearchengine.appManager.activityContextManager;
|
||||||
import com.darkweb.genesissearchengine.appManager.kotlinHelperLibraries.BrowserIconManager;
|
import com.darkweb.genesissearchengine.appManager.kotlinHelperLibraries.BrowserIconManager;
|
||||||
import com.darkweb.genesissearchengine.constants.*;
|
import com.darkweb.genesissearchengine.constants.*;
|
||||||
|
@ -14,10 +13,8 @@ import com.darkweb.genesissearchengine.dataManager.dataController;
|
||||||
import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
||||||
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
import com.darkweb.genesissearchengine.helperManager.eventObserver;
|
||||||
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static com.darkweb.genesissearchengine.constants.constants.CONST_REPORT_URL;
|
import static com.darkweb.genesissearchengine.constants.constants.CONST_REPORT_URL;
|
||||||
import static com.darkweb.genesissearchengine.constants.enums.etype.on_handle_external_intent;
|
import static com.darkweb.genesissearchengine.constants.enums.etype.on_handle_external_intent;
|
||||||
import static org.mozilla.geckoview.GeckoSessionSettings.USER_AGENT_MODE_MOBILE;
|
import static org.mozilla.geckoview.GeckoSessionSettings.USER_AGENT_MODE_MOBILE;
|
||||||
|
@ -29,10 +26,8 @@ import static org.mozilla.geckoview.StorageController.ClearFlags.NETWORK_CACHE;
|
||||||
import static org.mozilla.geckoview.StorageController.ClearFlags.PERMISSIONS;
|
import static org.mozilla.geckoview.StorageController.ClearFlags.PERMISSIONS;
|
||||||
import static org.mozilla.geckoview.StorageController.ClearFlags.SITE_DATA;
|
import static org.mozilla.geckoview.StorageController.ClearFlags.SITE_DATA;
|
||||||
import static org.mozilla.geckoview.StorageController.ClearFlags.SITE_SETTINGS;
|
import static org.mozilla.geckoview.StorageController.ClearFlags.SITE_SETTINGS;
|
||||||
|
|
||||||
import org.mozilla.geckoview.ContentBlocking;
|
import org.mozilla.geckoview.ContentBlocking;
|
||||||
import org.mozilla.geckoview.GeckoRuntime;
|
import org.mozilla.geckoview.GeckoRuntime;
|
||||||
import org.mozilla.geckoview.GeckoSession;
|
|
||||||
import org.mozilla.geckoview.GeckoView;
|
import org.mozilla.geckoview.GeckoView;
|
||||||
import org.mozilla.geckoview.WebResponse;
|
import org.mozilla.geckoview.WebResponse;
|
||||||
|
|
||||||
|
@ -76,7 +71,9 @@ public class geckoClients
|
||||||
public void onValidateInitializeFromStartup(NestedGeckoView mNestedGeckoView, AppCompatActivity pcontext){
|
public void onValidateInitializeFromStartup(NestedGeckoView mNestedGeckoView, AppCompatActivity pcontext){
|
||||||
boolean mStatus = mSession.onValidateInitializeFromStartup();
|
boolean mStatus = mSession.onValidateInitializeFromStartup();
|
||||||
if(mStatus){
|
if(mStatus){
|
||||||
loadURL(mSession.getCurrentURL(), mNestedGeckoView, pcontext);
|
// loadURL(mSession.getCurrentURL(), mNestedGeckoView, pcontext);
|
||||||
|
mSession.onRestoreState();
|
||||||
|
mSession.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -334,8 +331,9 @@ public class geckoClients
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onReload(NestedGeckoView mNestedGeckoView, AppCompatActivity pcontext){
|
public void onReload(NestedGeckoView mNestedGeckoView, AppCompatActivity pcontext){
|
||||||
mSession.stop();
|
///mSession.stop();
|
||||||
loadURL(mSession.getCurrentURL(), mNestedGeckoView, pcontext);
|
mSession.reload();
|
||||||
|
//loadURL(mSession.getCurrentURL(), mNestedGeckoView, pcontext);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void manual_download(String url, AppCompatActivity context){
|
public void manual_download(String url, AppCompatActivity context){
|
||||||
|
|
|
@ -10,7 +10,6 @@ import android.content.pm.ActivityInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.content.pm.ResolveInfo;
|
import android.content.pm.ResolveInfo;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.BitmapFactory;
|
|
||||||
import android.graphics.Matrix;
|
import android.graphics.Matrix;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.graphics.RectF;
|
import android.graphics.RectF;
|
||||||
|
@ -23,17 +22,12 @@ import android.util.Base64;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.autofill.AutofillManager;
|
import android.view.autofill.AutofillManager;
|
||||||
import android.view.autofill.AutofillValue;
|
import android.view.autofill.AutofillValue;
|
||||||
import android.view.inputmethod.InputMethodManager;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import androidx.annotation.AnyThread;
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.annotation.UiThread;
|
import androidx.annotation.UiThread;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.core.app.NotificationCompat;
|
import androidx.core.app.NotificationCompat;
|
||||||
import androidx.core.content.FileProvider;
|
import androidx.core.content.FileProvider;
|
||||||
|
|
||||||
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.status;
|
import com.darkweb.genesissearchengine.constants.status;
|
||||||
|
@ -53,14 +47,11 @@ import org.mozilla.geckoview.Autofill;
|
||||||
import org.mozilla.geckoview.GeckoResult;
|
import org.mozilla.geckoview.GeckoResult;
|
||||||
import org.mozilla.geckoview.GeckoSession;
|
import org.mozilla.geckoview.GeckoSession;
|
||||||
import org.mozilla.geckoview.GeckoView;
|
import org.mozilla.geckoview.GeckoView;
|
||||||
import org.mozilla.geckoview.SessionFinder;
|
|
||||||
import org.mozilla.geckoview.SlowScriptResponse;
|
import org.mozilla.geckoview.SlowScriptResponse;
|
||||||
import org.mozilla.geckoview.WebRequestError;
|
import org.mozilla.geckoview.WebRequestError;
|
||||||
import org.mozilla.geckoview.WebResponse;
|
import org.mozilla.geckoview.WebResponse;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
|
@ -69,11 +60,7 @@ import java.util.Arrays;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import javax.crypto.spec.SecretKeySpec;
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
|
|
||||||
import mozilla.components.support.utils.DownloadUtils;
|
|
||||||
|
|
||||||
import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_HELP_URL_CACHE;
|
import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_HELP_URL_CACHE;
|
||||||
import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_HELP_URL_CACHE_DARK;
|
import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_HELP_URL_CACHE_DARK;
|
||||||
import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_URL_CACHED;
|
import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_URL_CACHED;
|
||||||
|
@ -114,7 +101,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
|
||||||
private boolean mIsProgressBarChanging = false;
|
private boolean mIsProgressBarChanging = false;
|
||||||
private Handler mFindHandler;
|
private Handler mFindHandler;
|
||||||
private boolean mClosed = false;
|
private boolean mClosed = false;
|
||||||
private SessionState mSessionState;
|
public SessionState mSessionState;
|
||||||
|
|
||||||
geckoSession(eventObserver.eventListener event,String mSessionID,AppCompatActivity mContext, GeckoView pGeckoView){
|
geckoSession(eventObserver.eventListener event,String mSessionID,AppCompatActivity mContext, GeckoView pGeckoView){
|
||||||
|
|
||||||
|
@ -373,6 +360,17 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
|
||||||
@UiThread
|
@UiThread
|
||||||
public void onSessionStateChange(@NonNull GeckoSession session, @NonNull SessionState sessionState) {
|
public void onSessionStateChange(@NonNull GeckoSession session, @NonNull SessionState sessionState) {
|
||||||
mSessionState = sessionState;
|
mSessionState = sessionState;
|
||||||
|
if(!status.sRestoreTabs){
|
||||||
|
mSessionState = null;
|
||||||
|
}
|
||||||
|
if(mSessionState!=null)
|
||||||
|
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme, mSessionState.toString()), enums.etype.M_UPDATE_SESSION_STATE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onRestoreState(){
|
||||||
|
if(mSessionState!=null){
|
||||||
|
restoreState(mSessionState);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Navigation Delegate*/
|
/*Navigation Delegate*/
|
||||||
|
@ -489,6 +487,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
|
||||||
|
|
||||||
|
|
||||||
public GeckoResult<String> onLoadError(@NonNull GeckoSession var1, @Nullable String var2, WebRequestError var3) {
|
public GeckoResult<String> onLoadError(@NonNull GeckoSession var1, @Nullable String var2, WebRequestError var3) {
|
||||||
|
if(status.sSettingIsAppStarted){
|
||||||
errorHandler handler = new errorHandler();
|
errorHandler handler = new errorHandler();
|
||||||
mProgress = 0;
|
mProgress = 0;
|
||||||
mPreviousErrorPage = true;
|
mPreviousErrorPage = true;
|
||||||
|
@ -496,6 +495,8 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
|
||||||
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, mTheme), enums.etype.ON_UPDATE_THEME);
|
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, mTheme), enums.etype.ON_UPDATE_THEME);
|
||||||
return GeckoResult.fromValue("data:text/html," + handler.createErrorPage(var3.category, var3.code,mContext.get(),var2));
|
return GeckoResult.fromValue("data:text/html," + handler.createErrorPage(var3.category, var3.code,mContext.get(),var2));
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/*Content Delegate*/
|
/*Content Delegate*/
|
||||||
@UiThread
|
@UiThread
|
||||||
|
@ -940,6 +941,8 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
|
||||||
|
|
||||||
void goBackSession(){
|
void goBackSession(){
|
||||||
|
|
||||||
|
goBack();
|
||||||
|
/*
|
||||||
if(mHistoryList!=null){
|
if(mHistoryList!=null){
|
||||||
stop();
|
stop();
|
||||||
int index = mHistoryList.getCurrentIndex()-1;
|
int index = mHistoryList.getCurrentIndex()-1;
|
||||||
|
@ -960,7 +963,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
|
||||||
mProgress = 5;
|
mProgress = 5;
|
||||||
event.invokeObserver(Arrays.asList(5, mSessionID, mCurrentURL), enums.etype.progress_update_forced);
|
event.invokeObserver(Arrays.asList(5, mSessionID, mCurrentURL), enums.etype.progress_update_forced);
|
||||||
event.invokeObserver(Arrays.asList(5, mSessionID, mCurrentURL), enums.etype.M_ADMOB_BANNER_RECHECK);
|
event.invokeObserver(Arrays.asList(5, mSessionID, mCurrentURL), enums.etype.M_ADMOB_BANNER_RECHECK);
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void goForwardSession(){
|
void goForwardSession(){
|
||||||
|
|
|
@ -132,6 +132,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
private AdView mBannerAds = null;
|
private AdView mBannerAds = null;
|
||||||
private ImageButton mGatewaySplash;
|
private ImageButton mGatewaySplash;
|
||||||
private ImageButton mPanicButton;
|
private ImageButton mPanicButton;
|
||||||
|
private ImageButton mPanicButtonLandscape;
|
||||||
private LinearLayout mTopBar;
|
private LinearLayout mTopBar;
|
||||||
private ImageView mBackSplash;
|
private ImageView mBackSplash;
|
||||||
private Button mConnectButton;
|
private Button mConnectButton;
|
||||||
|
@ -326,7 +327,8 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
mHomeViewController.onUpdateSearchBar(model.getSession().getCurrentURL(), false, false, false);
|
mHomeViewController.onUpdateSearchBar(model.getSession().getCurrentURL(), false, false, false);
|
||||||
}
|
}
|
||||||
onLoadTab(model.getSession(),false,true);
|
onLoadTab(model.getSession(),false,true);
|
||||||
onLoadURL(model.getSession().getCurrentURL());
|
//onLoadURL(model.getSession().getCurrentURL());
|
||||||
|
mGeckoClient.onReload(mGeckoView, this);
|
||||||
}else {
|
}else {
|
||||||
onNewIntent(getIntent());
|
onNewIntent(getIntent());
|
||||||
onOpenLinkNewTab(helperMethod.getDomainName(mHomeModel.getSearchEngine()));
|
onOpenLinkNewTab(helperMethod.getDomainName(mHomeModel.getSearchEngine()));
|
||||||
|
@ -440,6 +442,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
mCoordinatorLayout = findViewById(R.id.pCoordinatorLayout);
|
mCoordinatorLayout = findViewById(R.id.pCoordinatorLayout);
|
||||||
mImageDivider = findViewById(R.id.pImageDivider);
|
mImageDivider = findViewById(R.id.pImageDivider);
|
||||||
mPanicButton = findViewById(R.id.pPanicButton);
|
mPanicButton = findViewById(R.id.pPanicButton);
|
||||||
|
mPanicButtonLandscape = findViewById(R.id.pPanicButtonLandscape);
|
||||||
mGenesisLogo = findViewById(R.id.pGenesisLogo);
|
mGenesisLogo = findViewById(R.id.pGenesisLogo);
|
||||||
|
|
||||||
mGeckoView.setSaveEnabled(false);
|
mGeckoView.setSaveEnabled(false);
|
||||||
|
@ -447,7 +450,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
mGeckoView.setAutofillEnabled(true);
|
mGeckoView.setAutofillEnabled(true);
|
||||||
|
|
||||||
mGeckoClient = new geckoClients();
|
mGeckoClient = new geckoClients();
|
||||||
mHomeViewController.initialization(new homeViewCallback(),this,mNewTab, mWebViewContainer, mLoadingText, mProgressBar, mSearchbar, mSplashScreen, mLoadingIcon, mBannerAds, mGatewaySplash, mTopBar, mGeckoView, mBackSplash, mConnectButton, mFindBar, mFindText, mFindCount, mTopLayout, mVoiceInput, mMenu, mNestedScroll, mBlocker, mBlockerFullSceen, mSearchEngineBar, mCopyright, mHintListView, mAppBar, mOrbotLogManager, mInfoLandscape, mInfoPortrait, mProgressBarIndeterminate, mTabFragment, mTopBarContainer, mSearchLock, mPopupLoadNewTab, mTopBarHider, mNewTabBlocker, mCoordinatorLayout, mImageDivider, mPanicButton, mGenesisLogo);
|
mHomeViewController.initialization(new homeViewCallback(),this,mNewTab, mWebViewContainer, mLoadingText, mProgressBar, mSearchbar, mSplashScreen, mLoadingIcon, mBannerAds, mGatewaySplash, mTopBar, mGeckoView, mBackSplash, mConnectButton, mFindBar, mFindText, mFindCount, mTopLayout, mVoiceInput, mMenu, mNestedScroll, mBlocker, mBlockerFullSceen, mSearchEngineBar, mCopyright, mHintListView, mAppBar, mOrbotLogManager, mInfoLandscape, mInfoPortrait, mProgressBarIndeterminate, mTabFragment, mTopBarContainer, mSearchLock, mPopupLoadNewTab, mTopBarHider, mNewTabBlocker, mCoordinatorLayout, mImageDivider, mPanicButton, mGenesisLogo, mPanicButtonLandscape);
|
||||||
mGeckoView.onSetHomeEvent(new nestedGeckoViewCallback());
|
mGeckoView.onSetHomeEvent(new nestedGeckoViewCallback());
|
||||||
mGeckoClient.initialize(mGeckoView, new geckoViewCallback(), this,false);
|
mGeckoClient.initialize(mGeckoView, new geckoViewCallback(), this,false);
|
||||||
mGeckoClient.onValidateInitializeFromStartup(mGeckoView, homeController.this);
|
mGeckoClient.onValidateInitializeFromStartup(mGeckoView, homeController.this);
|
||||||
|
@ -2200,6 +2203,9 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
||||||
if(activityContextManager.getInstance().getTabController()!=null && mTabFragment.getVisibility()==View.VISIBLE)
|
if(activityContextManager.getInstance().getTabController()!=null && mTabFragment.getVisibility()==View.VISIBLE)
|
||||||
activityContextManager.getInstance().getTabController().onTabRowChanged((String) data.get(1));
|
activityContextManager.getInstance().getTabController().onTabRowChanged((String) data.get(1));
|
||||||
}
|
}
|
||||||
|
else if(e_type.equals(enums.etype.M_UPDATE_SESSION_STATE)){
|
||||||
|
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_UPDATE_SESSION_STATE, data);
|
||||||
|
}
|
||||||
else if(e_type.equals(enums.etype.FINDER_RESULT_CALLBACK)){
|
else if(e_type.equals(enums.etype.FINDER_RESULT_CALLBACK)){
|
||||||
mHomeViewController.onUpdateFindBarCount((int)data.get(0),(int)data.get(1));
|
mHomeViewController.onUpdateFindBarCount((int)data.get(0),(int)data.get(1));
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,6 +108,7 @@ class homeViewController
|
||||||
private CoordinatorLayout mCoordinatorLayout;
|
private CoordinatorLayout mCoordinatorLayout;
|
||||||
private ImageView mImageDivider;
|
private ImageView mImageDivider;
|
||||||
private ImageButton mPanicButton;
|
private ImageButton mPanicButton;
|
||||||
|
private ImageButton mPanicButtonLandscape;
|
||||||
private ImageView mGenesisLogo;
|
private ImageView mGenesisLogo;
|
||||||
|
|
||||||
/*Local Variables*/
|
/*Local Variables*/
|
||||||
|
@ -118,7 +119,7 @@ class homeViewController
|
||||||
private Handler mTabDialogHandler = null;
|
private Handler mTabDialogHandler = null;
|
||||||
private Runnable mTabDialogRunnable = null;
|
private Runnable mTabDialogRunnable = null;
|
||||||
|
|
||||||
void initialization(eventObserver.eventListener event, AppCompatActivity context, Button mNewTab, ConstraintLayout webviewContainer, TextView loadingText, AnimatedProgressBar progressBar, editTextManager searchbar, ConstraintLayout splashScreen, ImageView loading, AdView banner_ads, ImageButton gateway_splash, LinearLayout top_bar, GeckoView gecko_view, ImageView backsplash, Button connect_button, View pFindBar, EditText pFindText, TextView pFindCount, androidx.constraintlayout.widget.ConstraintLayout pTopLayout, ImageButton pVoiceInput, ImageButton pMenu, androidx.core.widget.NestedScrollView pNestedScroll, ImageView pBlocker, ImageView pBlockerFullSceen, View mSearchEngineBar, TextView pCopyright, RecyclerView pHistListView, com.google.android.material.appbar.AppBarLayout pAppBar, ImageButton pOrbotLogManager, ConstraintLayout pInfoLandscape, ConstraintLayout pInfoPortrait, ProgressBar pProgressBarIndeterminate, FragmentContainerView pTabFragment, LinearLayout pTopBarContainer, ImageView pSearchLock, View pPopupLoadNewTab, ImageView pTopBarHider, ImageView pNewTabBlocker, CoordinatorLayout mCoordinatorLayout, ImageView pImageDivider, ImageButton pPanicButton, ImageView pGenesisLogo){
|
void initialization(eventObserver.eventListener event, AppCompatActivity context, Button mNewTab, ConstraintLayout webviewContainer, TextView loadingText, AnimatedProgressBar progressBar, editTextManager searchbar, ConstraintLayout splashScreen, ImageView loading, AdView banner_ads, ImageButton gateway_splash, LinearLayout top_bar, GeckoView gecko_view, ImageView backsplash, Button connect_button, View pFindBar, EditText pFindText, TextView pFindCount, androidx.constraintlayout.widget.ConstraintLayout pTopLayout, ImageButton pVoiceInput, ImageButton pMenu, androidx.core.widget.NestedScrollView pNestedScroll, ImageView pBlocker, ImageView pBlockerFullSceen, View mSearchEngineBar, TextView pCopyright, RecyclerView pHistListView, com.google.android.material.appbar.AppBarLayout pAppBar, ImageButton pOrbotLogManager, ConstraintLayout pInfoLandscape, ConstraintLayout pInfoPortrait, ProgressBar pProgressBarIndeterminate, FragmentContainerView pTabFragment, LinearLayout pTopBarContainer, ImageView pSearchLock, View pPopupLoadNewTab, ImageView pTopBarHider, ImageView pNewTabBlocker, CoordinatorLayout mCoordinatorLayout, ImageView pImageDivider, ImageButton pPanicButton, ImageView pGenesisLogo,ImageButton pPanicButtonLandscape){
|
||||||
this.mContext = context;
|
this.mContext = context;
|
||||||
this.mProgressBar = progressBar;
|
this.mProgressBar = progressBar;
|
||||||
this.mSearchbar = searchbar;
|
this.mSearchbar = searchbar;
|
||||||
|
@ -159,6 +160,7 @@ class homeViewController
|
||||||
this.mImageDivider = pImageDivider;
|
this.mImageDivider = pImageDivider;
|
||||||
this.mPanicButton = pPanicButton;
|
this.mPanicButton = pPanicButton;
|
||||||
this.mGenesisLogo = pGenesisLogo;
|
this.mGenesisLogo = pGenesisLogo;
|
||||||
|
this.mPanicButtonLandscape = pPanicButtonLandscape;
|
||||||
|
|
||||||
initSplashScreen();
|
initSplashScreen();
|
||||||
createUpdateUiHandler();
|
createUpdateUiHandler();
|
||||||
|
@ -553,6 +555,7 @@ class homeViewController
|
||||||
mSplashScreen.setEnabled(false);
|
mSplashScreen.setEnabled(false);
|
||||||
mOrbotLogManager.setEnabled(false);
|
mOrbotLogManager.setEnabled(false);
|
||||||
mPanicButton.setEnabled(false);
|
mPanicButton.setEnabled(false);
|
||||||
|
mPanicButtonLandscape.setEnabled(false);
|
||||||
|
|
||||||
final Handler handler = new Handler();
|
final Handler handler = new Handler();
|
||||||
handler.postDelayed(() ->
|
handler.postDelayed(() ->
|
||||||
|
@ -566,6 +569,7 @@ class homeViewController
|
||||||
});
|
});
|
||||||
mGatewaySplash.animate().setDuration(350).alpha(0.4f);
|
mGatewaySplash.animate().setDuration(350).alpha(0.4f);
|
||||||
mPanicButton.animate().setDuration(250).alpha(0f);
|
mPanicButton.animate().setDuration(250).alpha(0f);
|
||||||
|
mPanicButtonLandscape.animate().setDuration(250).alpha(0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initSplashScreen(){
|
private void initSplashScreen(){
|
||||||
|
@ -661,6 +665,7 @@ class homeViewController
|
||||||
mGatewaySplash.setVisibility(View.GONE);
|
mGatewaySplash.setVisibility(View.GONE);
|
||||||
mConnectButton.setVisibility(View.GONE);
|
mConnectButton.setVisibility(View.GONE);
|
||||||
mPanicButton.setVisibility(View.GONE);
|
mPanicButton.setVisibility(View.GONE);
|
||||||
|
mPanicButtonLandscape.setVisibility(View.GONE);
|
||||||
|
|
||||||
mEvent.invokeObserver(null, enums.etype.M_CACHE_UPDATE_TAB);
|
mEvent.invokeObserver(null, enums.etype.M_CACHE_UPDATE_TAB);
|
||||||
mEvent.invokeObserver(null, enums.etype.M_SPLASH_DISABLE);
|
mEvent.invokeObserver(null, enums.etype.M_SPLASH_DISABLE);
|
||||||
|
|
|
@ -7,6 +7,8 @@ import com.darkweb.genesissearchengine.appManager.homeManager.geckoManager.gecko
|
||||||
import com.darkweb.genesissearchengine.constants.status;
|
import com.darkweb.genesissearchengine.constants.status;
|
||||||
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
||||||
|
|
||||||
|
import org.mozilla.geckoview.GeckoSession;
|
||||||
|
|
||||||
public class tabRowModel
|
public class tabRowModel
|
||||||
{
|
{
|
||||||
/*Private Variables*/
|
/*Private Variables*/
|
||||||
|
@ -39,13 +41,18 @@ public class tabRowModel
|
||||||
return mSession;
|
return mSession;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSession(geckoSession pSession, String pURL, String pTitle, String pTheme)
|
public void setSession(geckoSession pSession, String pURL, String pTitle, String pTheme, GeckoSession.SessionState pSessionState)
|
||||||
{
|
{
|
||||||
mSession = pSession;
|
mSession = pSession;
|
||||||
mSession.setTitle(pTitle);
|
mSession.setTitle(pTitle);
|
||||||
mSession.setURL(pURL);
|
mSession.setURL(pURL);
|
||||||
mSession.setTheme(pTheme);
|
mSession.setTheme(pTheme);
|
||||||
|
|
||||||
|
if(pSessionState != null){
|
||||||
|
mSession.mSessionState = pSessionState;
|
||||||
|
mSession.restoreState(pSessionState);
|
||||||
|
}
|
||||||
|
|
||||||
if(!status.sSettingIsAppStarted){
|
if(!status.sSettingIsAppStarted){
|
||||||
if(pTitle.equals("$TITLE") || pTitle.startsWith("http://loading") || pTitle.startsWith("loading") || pURL.equals("$TITLE") || pURL.startsWith("http://loading") || pURL.startsWith("loading")){
|
if(pTitle.equals("$TITLE") || pTitle.startsWith("http://loading") || pTitle.startsWith("loading") || pURL.equals("$TITLE") || pURL.startsWith("http://loading") || pURL.startsWith("loading")){
|
||||||
mSession.setTitle("about:blank");
|
mSession.setTitle("about:blank");
|
||||||
|
|
|
@ -4,7 +4,7 @@ public class enums
|
||||||
{
|
{
|
||||||
/*Settings Manager*/
|
/*Settings Manager*/
|
||||||
public enum etype{
|
public enum etype{
|
||||||
on_update_favicon,ON_UPDATE_TAB_TITLE, ON_OPEN_TAB_VIEW,ON_NEW_TAB_ANIMATION, ON_LOAD_REQUEST,GECKO_SCROLL_CHANGED,ON_UPDATE_SEARCH_BAR,M_ON_MAIL,SESSION_ID,M_UPDATE_PIXEL_BACKGROUND,M_CACHE_UPDATE_TAB,
|
on_update_favicon,ON_UPDATE_TAB_TITLE, ON_OPEN_TAB_VIEW,ON_NEW_TAB_ANIMATION, M_UPDATE_SESSION_STATE,ON_LOAD_REQUEST,GECKO_SCROLL_CHANGED,ON_UPDATE_SEARCH_BAR,M_ON_MAIL,SESSION_ID,M_UPDATE_PIXEL_BACKGROUND,M_CACHE_UPDATE_TAB,
|
||||||
on_verify_selected_url_menu,FINDER_RESULT_CALLBACK,M_ADMOB_BANNER_RECHECK,M_OPEN_SESSION,M_DOWNLOAD_FAILURE,
|
on_verify_selected_url_menu,FINDER_RESULT_CALLBACK,M_ADMOB_BANNER_RECHECK,M_OPEN_SESSION,M_DOWNLOAD_FAILURE,
|
||||||
welcome, reload,download_folder, M_UPDATE_THEME,M_ON_BANNER_UPDATE, M_LOAD_HOMEPAGE_GENESIS,M_INIT_TAB_COUNT_FORCED,M_SPLASH_DISABLE,M_NEW_LINK_IN_NEW_TAB,M_RESET_SUGGESTION,
|
welcome, reload,download_folder, M_UPDATE_THEME,M_ON_BANNER_UPDATE, M_LOAD_HOMEPAGE_GENESIS,M_INIT_TAB_COUNT_FORCED,M_SPLASH_DISABLE,M_NEW_LINK_IN_NEW_TAB,M_RESET_SUGGESTION,
|
||||||
url_triggered, url_triggered_new_tab,url_clear,fetch_favicon,url_clear_at,remove_from_database,is_empty,M_HOME_PAGE,M_PRELOAD_URL,ON_KEYBOARD_CLOSE,M_CLOSE_TAB,
|
url_triggered, url_triggered_new_tab,url_clear,fetch_favicon,url_clear_at,remove_from_database,is_empty,M_HOME_PAGE,M_PRELOAD_URL,ON_KEYBOARD_CLOSE,M_CLOSE_TAB,
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class dataEnums
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum eTabCommands{
|
public enum eTabCommands{
|
||||||
M_UPDATE_TAB, M_ADD_TAB, M_CLEAR_TAB,M_GET_SUGGESTIONS, CLOSE_TAB, GET_TAB, GET_CURRENT_TAB,GET_RECENT_TAB, GET_LAST_TAB, GET_TOTAL_TAB, MOVE_TAB_TO_TOP, M_UPDATE_PIXEL, M_HOME_PAGE
|
M_UPDATE_TAB, M_UPDATE_SESSION_STATE,M_ADD_TAB, M_CLEAR_TAB,M_GET_SUGGESTIONS, CLOSE_TAB, GET_TAB, GET_CURRENT_TAB,GET_RECENT_TAB, GET_LAST_TAB, GET_TOTAL_TAB, MOVE_TAB_TO_TOP, M_UPDATE_PIXEL, M_HOME_PAGE
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum eImageCommands{
|
public enum eImageCommands{
|
||||||
|
|
|
@ -10,6 +10,9 @@ import com.darkweb.genesissearchengine.appManager.historyManager.historyRowModel
|
||||||
import com.darkweb.genesissearchengine.constants.status;
|
import com.darkweb.genesissearchengine.constants.status;
|
||||||
import com.darkweb.genesissearchengine.constants.strings;
|
import com.darkweb.genesissearchengine.constants.strings;
|
||||||
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
||||||
|
|
||||||
|
import org.mozilla.gecko.util.StringUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -37,7 +40,7 @@ public class suggestionDataModel implements SpellCheckerSession.SpellCheckerSess
|
||||||
|
|
||||||
private ArrayList<historyRowModel> getDefaultSuggestionsOnStart(String pQuery, int mSize, ArrayList<String> mDuplicationHandler, boolean pDefaultHostChaned){
|
private ArrayList<historyRowModel> getDefaultSuggestionsOnStart(String pQuery, int mSize, ArrayList<String> mDuplicationHandler, boolean pDefaultHostChaned){
|
||||||
|
|
||||||
if(pQuery.equals(strings.GENERIC_EMPTY_STR)){
|
if(pQuery.equals(strings.GENERIC_EMPTY_STR) || pQuery.trim().isEmpty()) {
|
||||||
pQuery = "hidden web";
|
pQuery = "hidden web";
|
||||||
}
|
}
|
||||||
mCurrentList.clear();
|
mCurrentList.clear();
|
||||||
|
@ -64,6 +67,10 @@ public class suggestionDataModel implements SpellCheckerSession.SpellCheckerSess
|
||||||
|
|
||||||
private ArrayList<historyRowModel> getDefaultSuggestions(String pQuery, int mSize, ArrayList<String> mDuplicationHandler, boolean pDefaultHostChaned){
|
private ArrayList<historyRowModel> getDefaultSuggestions(String pQuery, int mSize, ArrayList<String> mDuplicationHandler, boolean pDefaultHostChaned){
|
||||||
|
|
||||||
|
if(pQuery.trim().isEmpty()) {
|
||||||
|
pQuery = "";
|
||||||
|
}
|
||||||
|
|
||||||
for(int count = 0; count<= mHintListLocalCache.size()-1 && mHintListLocalCache.size()<500; count++){
|
for(int count = 0; count<= mHintListLocalCache.size()-1 && mHintListLocalCache.size()<500; count++){
|
||||||
if(mHintListLocalCache.get(count).getHeader().toLowerCase().contains(pQuery)){
|
if(mHintListLocalCache.get(count).getHeader().toLowerCase().contains(pQuery)){
|
||||||
if(mHintListLocalCache.get(count).getHeader().toLowerCase().startsWith(pQuery)){
|
if(mHintListLocalCache.get(count).getHeader().toLowerCase().startsWith(pQuery)){
|
||||||
|
@ -107,6 +114,10 @@ public class suggestionDataModel implements SpellCheckerSession.SpellCheckerSess
|
||||||
|
|
||||||
private ArrayList<historyRowModel> getSuggestions(String pQuery, ArrayList<historyRowModel> pHistory, ArrayList<bookmarkRowModel> pBookmarks){
|
private ArrayList<historyRowModel> getSuggestions(String pQuery, ArrayList<historyRowModel> pHistory, ArrayList<bookmarkRowModel> pBookmarks){
|
||||||
|
|
||||||
|
if(pQuery.trim().isEmpty()) {
|
||||||
|
pQuery = "";
|
||||||
|
}
|
||||||
|
|
||||||
mCurrentList = new ArrayList<>();
|
mCurrentList = new ArrayList<>();
|
||||||
mCurrentList.clear();
|
mCurrentList.clear();
|
||||||
String mQueryOriginal = pQuery;
|
String mQueryOriginal = pQuery;
|
||||||
|
|
|
@ -11,17 +11,19 @@ import android.widget.ImageView;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import com.darkweb.genesissearchengine.appManager.activityContextManager;
|
import com.darkweb.genesissearchengine.appManager.activityContextManager;
|
||||||
import com.darkweb.genesissearchengine.databaseManager.databaseController;
|
import com.darkweb.genesissearchengine.databaseManager.databaseController;
|
||||||
import com.darkweb.genesissearchengine.appManager.homeManager.geckoManager.NestedGeckoView;
|
|
||||||
import com.darkweb.genesissearchengine.appManager.homeManager.geckoManager.geckoSession;
|
import com.darkweb.genesissearchengine.appManager.homeManager.geckoManager.geckoSession;
|
||||||
import com.darkweb.genesissearchengine.appManager.tabManager.tabRowModel;
|
import com.darkweb.genesissearchengine.appManager.tabManager.tabRowModel;
|
||||||
import com.darkweb.genesissearchengine.constants.enums;
|
import com.darkweb.genesissearchengine.constants.enums;
|
||||||
import com.darkweb.genesissearchengine.constants.status;
|
|
||||||
import com.darkweb.genesissearchengine.constants.strings;
|
import com.darkweb.genesissearchengine.constants.strings;
|
||||||
|
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
||||||
|
|
||||||
import org.mozilla.geckoview.GeckoResult;
|
import org.mozilla.geckoview.GeckoResult;
|
||||||
|
import org.mozilla.geckoview.GeckoSession;
|
||||||
import org.mozilla.geckoview.GeckoView;
|
import org.mozilla.geckoview.GeckoView;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.sql.PreparedStatement;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
|
@ -145,6 +147,23 @@ class tabDataModel
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void updateSession(String mSessionState, String mSessionID) {
|
||||||
|
for(int counter = 0; counter< mTabs.size(); counter++){
|
||||||
|
|
||||||
|
try{
|
||||||
|
if(mTabs.get(counter).getSession().getSessionID().equals(mSessionID))
|
||||||
|
{
|
||||||
|
|
||||||
|
databaseController.getInstance().execSQL("UPDATE tab SET session = '" + mSessionState + "' WHERE mid='"+mTabs.get(counter).getmId() + "'",null);
|
||||||
|
mTabs.add(0,mTabs.remove(counter));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}catch (Exception ex){
|
||||||
|
Log.i(ex.getMessage(), ex.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
boolean updateTab(String mSessionID, geckoSession pSession) {
|
boolean updateTab(String mSessionID, geckoSession pSession) {
|
||||||
|
|
||||||
for(int counter = 0; counter< mTabs.size(); counter++){
|
for(int counter = 0; counter< mTabs.size(); counter++){
|
||||||
|
@ -327,6 +346,9 @@ class tabDataModel
|
||||||
|
|
||||||
return mTabs;
|
return mTabs;
|
||||||
}
|
}
|
||||||
|
else if(pCommands == dataEnums.eTabCommands.M_UPDATE_SESSION_STATE){
|
||||||
|
updateSession((String) pData.get(5), (String) pData.get(1));
|
||||||
|
}
|
||||||
else if(pCommands == dataEnums.eTabCommands.M_UPDATE_TAB){
|
else if(pCommands == dataEnums.eTabCommands.M_UPDATE_TAB){
|
||||||
updateTab((String) pData.get(1), (geckoSession) pData.get(5));
|
updateTab((String) pData.get(1), (geckoSession) pData.get(5));
|
||||||
activityContextManager.getInstance().getHomeController().initTabCountForced();
|
activityContextManager.getInstance().getHomeController().initTabCountForced();
|
||||||
|
|
|
@ -9,9 +9,18 @@ import com.darkweb.genesissearchengine.appManager.historyManager.historyRowModel
|
||||||
import com.darkweb.genesissearchengine.appManager.homeManager.geckoManager.geckoSession;
|
import com.darkweb.genesissearchengine.appManager.homeManager.geckoManager.geckoSession;
|
||||||
import com.darkweb.genesissearchengine.appManager.tabManager.tabRowModel;
|
import com.darkweb.genesissearchengine.appManager.tabManager.tabRowModel;
|
||||||
import com.darkweb.genesissearchengine.constants.constants;
|
import com.darkweb.genesissearchengine.constants.constants;
|
||||||
|
import com.darkweb.genesissearchengine.constants.status;
|
||||||
|
import com.darkweb.genesissearchengine.dataManager.dataController;
|
||||||
|
import com.darkweb.genesissearchengine.dataManager.dataEnums;
|
||||||
|
import com.darkweb.genesissearchengine.helperManager.helperMethod;
|
||||||
|
|
||||||
import net.sqlcipher.database.SQLiteDatabaseHook;
|
import net.sqlcipher.database.SQLiteDatabaseHook;
|
||||||
import net.sqlcipher.database.SQLiteDatabase;
|
import net.sqlcipher.database.SQLiteDatabase;
|
||||||
|
|
||||||
|
import org.mozilla.geckoview.GeckoSession;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
|
@ -58,7 +67,7 @@ public class databaseController
|
||||||
|
|
||||||
mDatabaseInstance.execSQL("CREATE TABLE IF NOT EXISTS " + "history" + " (id INT(4) PRIMARY KEY,date DATETIME,url VARCHAR,title VARCHAR);");
|
mDatabaseInstance.execSQL("CREATE TABLE IF NOT EXISTS " + "history" + " (id INT(4) PRIMARY KEY,date DATETIME,url VARCHAR,title VARCHAR);");
|
||||||
mDatabaseInstance.execSQL("CREATE TABLE IF NOT EXISTS " + "bookmark" + " (id INT(4) PRIMARY KEY,title VARCHAR,url VARCHAR);");
|
mDatabaseInstance.execSQL("CREATE TABLE IF NOT EXISTS " + "bookmark" + " (id INT(4) PRIMARY KEY,title VARCHAR,url VARCHAR);");
|
||||||
mDatabaseInstance.execSQL("CREATE TABLE IF NOT EXISTS " + "tab" + " (mid INT(4) PRIMARY KEY,date,title VARCHAR,url VARCHAR,mThumbnail BLOB, theme VARCHAR);");
|
mDatabaseInstance.execSQL("CREATE TABLE IF NOT EXISTS " + "tab" + " (mid INT(4) PRIMARY KEY,date,title VARCHAR,url VARCHAR,mThumbnail BLOB, theme VARCHAR, session VARCHAR);");
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
@ -155,7 +164,15 @@ public class databaseController
|
||||||
do {
|
do {
|
||||||
geckoSession mSession = activityContextManager.getInstance().getHomeController().onNewTabInit();
|
geckoSession mSession = activityContextManager.getInstance().getHomeController().onNewTabInit();
|
||||||
tabRowModel model = new tabRowModel(c.getString(0), c.getString(1),c.getBlob(4));
|
tabRowModel model = new tabRowModel(c.getString(0), c.getString(1),c.getBlob(4));
|
||||||
model.setSession(mSession, c.getString(3),c.getString(2), c.getString(5));
|
GeckoSession.SessionState session = null;
|
||||||
|
try {
|
||||||
|
if(status.sRestoreTabs){
|
||||||
|
session = GeckoSession.SessionState.fromString(c.getString(6));
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
model.setSession(mSession, c.getString(3),c.getString(2), c.getString(5), session);
|
||||||
model.getSession().setSessionID(model.getmId());
|
model.getSession().setSessionID(model.getmId());
|
||||||
mTempListModel.add(model);
|
mTempListModel.add(model);
|
||||||
} while(c.moveToNext());
|
} while(c.moveToNext());
|
||||||
|
|
|
@ -60,8 +60,12 @@ import com.example.myapplication.R;
|
||||||
|
|
||||||
import org.xmlpull.v1.XmlPullParserException;
|
import org.xmlpull.v1.XmlPullParserException;
|
||||||
|
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.ObjectInputStream;
|
||||||
|
import java.io.ObjectOutputStream;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
@ -101,6 +105,23 @@ public class helperMethod
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static byte[] convertToBytes(Object object) throws IOException {
|
||||||
|
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||||
|
ObjectOutputStream oos = new ObjectOutputStream(bos);
|
||||||
|
oos.writeObject(object);
|
||||||
|
oos.flush();
|
||||||
|
oos.close();
|
||||||
|
bos.close();
|
||||||
|
byte[] data = bos.toByteArray();
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Object deserialize(byte[] data) throws IOException, ClassNotFoundException {
|
||||||
|
ByteArrayInputStream in = new ByteArrayInputStream(data);
|
||||||
|
ObjectInputStream is = new ObjectInputStream(in);
|
||||||
|
return is.readObject();
|
||||||
|
}
|
||||||
|
|
||||||
public static String caesarCipherEncrypt(String pMessage, Key pSecretKey) {
|
public static String caesarCipherEncrypt(String pMessage, Key pSecretKey) {
|
||||||
try{
|
try{
|
||||||
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
|
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
android:layout_height="52dp">
|
android:layout_height="52dp">
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:layout_width="45dp"
|
android:layout_width="45dp"
|
||||||
android:layout_height="45dp"
|
android:layout_height="50dp"
|
||||||
android:onClick="onClose"
|
android:onClick="onClose"
|
||||||
android:layout_marginTop="3dp"
|
android:layout_marginTop="3dp"
|
||||||
android:layout_marginStart="3dp"
|
android:layout_marginStart="3dp"
|
||||||
|
|
|
@ -537,6 +537,22 @@
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/pPanicButtonLandscape"
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:alpha="0.95"
|
||||||
|
android:background="@xml/hox_rounded_corner_splash_right"
|
||||||
|
android:contentDescription="@string/GENERAL_TODO"
|
||||||
|
android:onClick="panicExit"
|
||||||
|
android:padding="7dp"
|
||||||
|
android:scaleType="fitCenter"
|
||||||
|
android:src="@drawable/reset"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/pGenesisLogoBottom"
|
android:id="@+id/pGenesisLogoBottom"
|
||||||
android:layout_width="90dp"
|
android:layout_width="90dp"
|
||||||
|
|
|
@ -89,7 +89,7 @@
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="6"
|
android:layout_weight="6"
|
||||||
android:layout_marginStart="15dp"
|
android:layout_marginStart="5dp"
|
||||||
android:clickable="false"
|
android:clickable="false"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
|
|
@ -79,6 +79,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_marginTop="15dp"
|
android:layout_marginTop="15dp"
|
||||||
android:layout_marginBottom="15dp"
|
android:layout_marginBottom="15dp"
|
||||||
|
android:layout_marginStart="5dp"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -117,6 +118,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@xml/gx_ripple_gray"
|
android:background="@xml/gx_ripple_gray"
|
||||||
android:paddingBottom="10dp"
|
android:paddingBottom="10dp"
|
||||||
|
android:layout_marginStart="5dp"
|
||||||
android:paddingTop="10dp"
|
android:paddingTop="10dp"
|
||||||
android:onClick="onSaveLocalNotificationSettings"
|
android:onClick="onSaveLocalNotificationSettings"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
|
@ -178,18 +180,18 @@
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
android:layout_marginStart="5dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@xml/gx_ripple_gray"
|
android:background="@xml/gx_ripple_gray"
|
||||||
android:paddingBottom="10dp"
|
android:paddingBottom="10dp"
|
||||||
android:paddingTop="10dp"
|
android:paddingTop="10dp"
|
||||||
android:onClick="onOpenNotificationSettings"
|
android:onClick="onOpenNotificationSettings"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal">
|
||||||
android:weightSum="7">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="6"
|
android:layout_weight="1"
|
||||||
android:clickable="false"
|
android:clickable="false"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
@ -228,9 +230,8 @@
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:layout_width="0dp"
|
android:layout_width="55dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
|
||||||
android:clickable="false"
|
android:clickable="false"
|
||||||
android:focusable="false"
|
android:focusable="false"
|
||||||
android:background="@android:color/transparent"
|
android:background="@android:color/transparent"
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
/* arm versions */
|
/* arm versions */
|
||||||
project.ext.arm_vname = 'Build | Dark-Origin'
|
project.ext.arm_vname = 'Build | Dark-Origin 1.0'
|
||||||
project.ext.arm_vcode = 1000
|
project.ext.arm_vcode = 1000
|
||||||
|
|
||||||
/* aarch versions */
|
/* aarch versions */
|
||||||
project.ext.aarch_vname = 'Build | Dark-Origin'
|
project.ext.aarch_vname = 'Build | Dark-Origin 1.1'
|
||||||
project.ext.aarch_vcode = 1001
|
project.ext.aarch_vcode = 1001
|
||||||
|
|
||||||
/* x86 versions */
|
/* x86 versions */
|
||||||
project.ext.x86_vname = 'Build | Dark-Origin'
|
project.ext.x86_vname = 'Build | Dark-Origin 1.2'
|
||||||
project.ext.x86_vcode = 1002
|
project.ext.x86_vcode = 1002
|
||||||
|
|
||||||
/* x64 versions */
|
/* x64 versions */
|
||||||
project.ext.x64_vname = 'Build | Dark-Origin'
|
project.ext.x64_vname = 'Build | Dark-Origin 1.3'
|
||||||
project.ext.x64_vcode = 1003
|
project.ext.x64_vcode = 1003
|
||||||
|
|
||||||
/* dimension */
|
/* dimension */
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
apply plugin: 'com.android.library'
|
apply plugin: 'com.android.library'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 31
|
compileSdkVersion 30
|
||||||
buildToolsVersion '30.0.3'
|
buildToolsVersion '30.0.3'
|
||||||
ndkVersion '21.4.7075529'
|
ndkVersion '21.4.7075529'
|
||||||
|
|
||||||
|
@ -56,5 +56,5 @@ dependencies {
|
||||||
implementation 'com.jaredrummler:android-shell:1.0.0'
|
implementation 'com.jaredrummler:android-shell:1.0.0'
|
||||||
implementation 'com.offbynull.portmapper:portmapper:2.0.5'
|
implementation 'com.offbynull.portmapper:portmapper:2.0.5'
|
||||||
implementation 'info.guardianproject:jtorctl:0.4'
|
implementation 'info.guardianproject:jtorctl:0.4'
|
||||||
implementation 'com.github.tladesignz:IPtProxy:0.5.2'
|
implementation 'com.github.tladesignz:IPtProxy:0.5.0'
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,4 @@
|
||||||
package="org.torproject.android.proxy">
|
package="org.torproject.android.proxy">
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|
|
@ -308,6 +308,7 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
|
||||||
|
|
||||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||||
self = this;
|
self = this;
|
||||||
|
|
||||||
showToolbarNotification("", NOTIFY_ID, R.drawable.ic_stat_starting_tor_logo);
|
showToolbarNotification("", NOTIFY_ID, R.drawable.ic_stat_starting_tor_logo);
|
||||||
|
|
||||||
if (intent != null)
|
if (intent != null)
|
||||||
|
@ -1737,7 +1738,8 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
|
||||||
if (action.equals(ACTION_START) || action.equals(ACTION_START_ON_BOOT)) {
|
if (action.equals(ACTION_START) || action.equals(ACTION_START_ON_BOOT)) {
|
||||||
|
|
||||||
if (useIPtObfsMeekProxy())
|
if (useIPtObfsMeekProxy())
|
||||||
IPtProxy.startObfs4Proxy("DEBUG", false, false);
|
IPtProxy.stopObfs4Proxy();
|
||||||
|
IPtProxy.startObfs4Proxy("DEBUG", true, true);
|
||||||
|
|
||||||
if (useIPtSnowflakeProxy())
|
if (useIPtSnowflakeProxy())
|
||||||
startSnowflakeClient();
|
startSnowflakeClient();
|
||||||
|
|
Loading…
Reference in New Issue