Bug Fixes

Bug Fixes
master
msmannan00 2021-04-28 13:48:03 +05:00
parent 10a9426b67
commit 58329d826b
26 changed files with 264 additions and 92 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -8,11 +8,52 @@
"variantName": "processAarch64ReleaseResources",
"elements": [
{
"type": "SINGLE",
"filters": [],
"versionCode": 600,
"versionName": "600.0",
"outputFile": "app-aarch64-release.apk"
"type": "ONE_OF_MANY",
"filters": [
{
"filterType": "ABI",
"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"
}
]
}

View File

@ -74,11 +74,22 @@ android {
buildTypes {
release {
minifyEnabled project.ext.minifyEnabled
proguardFiles getDefaultProguardFile(project.ext.proguard_file), project.ext.proguard_rule
minifyEnabled false
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 {
checkReleaseBuilds project.ext.checkReleaseBuilds
abortOnError project.ext.abortOnError

View File

@ -14,7 +14,8 @@ import java.util.Collections;
import static com.darkweb.genesissearchengine.constants.enums.etype.GECKO_SCROLL_CHANGED;
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[] mScrollConsumed = new int[2];
private int mNestedOffsetY;
@ -43,55 +44,63 @@ public class NestedGeckoView extends GeckoView {
@Override
public boolean onTouchEvent(MotionEvent ev) {
boolean eventHandled = false;
final MotionEvent event = MotionEvent.obtain(ev);
MotionEvent event = MotionEvent.obtain(ev);
final int action = event.getActionMasked();
if (action == MotionEvent.ACTION_DOWN) {
mNestedOffsetY = 0;
}
final int eventY = (int) event.getY();
event.offsetLocation(0, mNestedOffsetY);
int eventY = (int) event.getY();
switch (action) {
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;
if (allowScroll && dispatchNestedPreScroll(0, deltaY, mScrollConsumed, mScrollOffset)) {
deltaY -= mScrollConsumed[1];
mLastY = eventY - mScrollOffset[1];
event.offsetLocation(0, -mScrollOffset[1]);
event.offsetLocation(0f, -mScrollOffset[1]);
mNestedOffsetY += mScrollOffset[1];
}
eventHandled = super.onTouchEvent(event);
mEvent.invokeObserver(Collections.singletonList(deltaY), GECKO_SCROLL_CHANGED);
mLastY = eventY - mScrollOffset[1];
if (allowScroll && dispatchNestedScroll(0, mScrollOffset[1], 0, deltaY, mScrollOffset)) {
event.offsetLocation(0, mScrollOffset[1]);
mNestedOffsetY += mScrollOffset[1];
mLastY -= mScrollOffset[1];
event.offsetLocation(0f, mScrollOffset[1]);
mNestedOffsetY += mScrollOffset[1];
}
break;
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;
startNestedScroll(ViewCompat.SCROLL_AXIS_VERTICAL);
break;
// The event should be handled either by onTouchEvent,
// 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_CANCEL:
eventHandled = super.onTouchEvent(event);
stopNestedScroll();
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;
}
@ -100,10 +109,14 @@ public class NestedGeckoView extends GeckoView {
}
private void updateInputResult(MotionEvent event) {
super.onTouchEventForResult(event).accept(inputResult -> {
mInputResult = inputResult;
startNestedScroll(ViewCompat.SCROLL_AXIS_VERTICAL);
});
if(status.sSettingEnableZoom){
super.onTouchEventForResult(event).accept(inputResult -> {
mInputResult = inputResult;
mInputResult = PanZoomController.INPUT_RESULT_UNHANDLED;
startNestedScroll(ViewCompat.SCROLL_AXIS_VERTICAL);
});
}
}
public int getInputResult() {

View File

@ -6,7 +6,6 @@ import android.net.Uri;
import android.util.Log;
import android.widget.ImageView;
import androidx.appcompat.app.AppCompatActivity;
import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.appManager.kotlinHelperLibraries.BrowserIconManager;
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.helperManager.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import java.io.File;
import java.util.List;
import static com.darkweb.genesissearchengine.constants.constants.CONST_REPORT_URL;
import static com.darkweb.genesissearchengine.constants.enums.etype.on_handle_external_intent;
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.SITE_DATA;
import static org.mozilla.geckoview.StorageController.ClearFlags.SITE_SETTINGS;
import org.mozilla.geckoview.ContentBlocking;
import org.mozilla.geckoview.GeckoRuntime;
import org.mozilla.geckoview.GeckoSession;
import org.mozilla.geckoview.GeckoView;
import org.mozilla.geckoview.WebResponse;
@ -76,7 +71,9 @@ public class geckoClients
public void onValidateInitializeFromStartup(NestedGeckoView mNestedGeckoView, AppCompatActivity pcontext){
boolean mStatus = mSession.onValidateInitializeFromStartup();
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){
mSession.stop();
loadURL(mSession.getCurrentURL(), mNestedGeckoView, pcontext);
///mSession.stop();
mSession.reload();
//loadURL(mSession.getCurrentURL(), mNestedGeckoView, pcontext);
}
public void manual_download(String url, AppCompatActivity context){

View File

@ -10,7 +10,6 @@ import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.graphics.Rect;
import android.graphics.RectF;
@ -23,17 +22,12 @@ import android.util.Base64;
import android.util.Log;
import android.view.autofill.AutofillManager;
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.Nullable;
import androidx.annotation.UiThread;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.NotificationCompat;
import androidx.core.content.FileProvider;
import com.darkweb.genesissearchengine.constants.constants;
import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.constants.status;
@ -53,14 +47,11 @@ import org.mozilla.geckoview.Autofill;
import org.mozilla.geckoview.GeckoResult;
import org.mozilla.geckoview.GeckoSession;
import org.mozilla.geckoview.GeckoView;
import org.mozilla.geckoview.SessionFinder;
import org.mozilla.geckoview.SlowScriptResponse;
import org.mozilla.geckoview.WebRequestError;
import org.mozilla.geckoview.WebResponse;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.ref.WeakReference;
import java.net.URLEncoder;
@ -69,11 +60,7 @@ import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Objects;
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_DARK;
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 Handler mFindHandler;
private boolean mClosed = false;
private SessionState mSessionState;
public SessionState mSessionState;
geckoSession(eventObserver.eventListener event,String mSessionID,AppCompatActivity mContext, GeckoView pGeckoView){
@ -373,6 +360,17 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
@UiThread
public void onSessionStateChange(@NonNull GeckoSession session, @NonNull SessionState 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*/
@ -489,12 +487,15 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
public GeckoResult<String> onLoadError(@NonNull GeckoSession var1, @Nullable String var2, WebRequestError var3) {
errorHandler handler = new errorHandler();
mProgress = 0;
mPreviousErrorPage = true;
event.invokeObserver(Arrays.asList(var2,mSessionID), enums.etype.on_load_error);
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));
if(status.sSettingIsAppStarted){
errorHandler handler = new errorHandler();
mProgress = 0;
mPreviousErrorPage = true;
event.invokeObserver(Arrays.asList(var2,mSessionID), enums.etype.on_load_error);
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 null;
}
/*Content Delegate*/
@ -940,6 +941,8 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
void goBackSession(){
goBack();
/*
if(mHistoryList!=null){
stop();
int index = mHistoryList.getCurrentIndex()-1;
@ -960,7 +963,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
mProgress = 5;
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);
}
}*/
}
void goForwardSession(){

View File

@ -132,6 +132,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
private AdView mBannerAds = null;
private ImageButton mGatewaySplash;
private ImageButton mPanicButton;
private ImageButton mPanicButtonLandscape;
private LinearLayout mTopBar;
private ImageView mBackSplash;
private Button mConnectButton;
@ -326,7 +327,8 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mHomeViewController.onUpdateSearchBar(model.getSession().getCurrentURL(), false, false, false);
}
onLoadTab(model.getSession(),false,true);
onLoadURL(model.getSession().getCurrentURL());
//onLoadURL(model.getSession().getCurrentURL());
mGeckoClient.onReload(mGeckoView, this);
}else {
onNewIntent(getIntent());
onOpenLinkNewTab(helperMethod.getDomainName(mHomeModel.getSearchEngine()));
@ -440,6 +442,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mCoordinatorLayout = findViewById(R.id.pCoordinatorLayout);
mImageDivider = findViewById(R.id.pImageDivider);
mPanicButton = findViewById(R.id.pPanicButton);
mPanicButtonLandscape = findViewById(R.id.pPanicButtonLandscape);
mGenesisLogo = findViewById(R.id.pGenesisLogo);
mGeckoView.setSaveEnabled(false);
@ -447,7 +450,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mGeckoView.setAutofillEnabled(true);
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());
mGeckoClient.initialize(mGeckoView, new geckoViewCallback(), this,false);
mGeckoClient.onValidateInitializeFromStartup(mGeckoView, homeController.this);
@ -2198,7 +2201,10 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
else if(e_type.equals(enums.etype.ON_UPDATE_TAB_TITLE)){
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)){
mHomeViewController.onUpdateFindBarCount((int)data.get(0),(int)data.get(1));

View File

@ -108,6 +108,7 @@ class homeViewController
private CoordinatorLayout mCoordinatorLayout;
private ImageView mImageDivider;
private ImageButton mPanicButton;
private ImageButton mPanicButtonLandscape;
private ImageView mGenesisLogo;
/*Local Variables*/
@ -118,7 +119,7 @@ class homeViewController
private Handler mTabDialogHandler = 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.mProgressBar = progressBar;
this.mSearchbar = searchbar;
@ -159,6 +160,7 @@ class homeViewController
this.mImageDivider = pImageDivider;
this.mPanicButton = pPanicButton;
this.mGenesisLogo = pGenesisLogo;
this.mPanicButtonLandscape = pPanicButtonLandscape;
initSplashScreen();
createUpdateUiHandler();
@ -553,6 +555,7 @@ class homeViewController
mSplashScreen.setEnabled(false);
mOrbotLogManager.setEnabled(false);
mPanicButton.setEnabled(false);
mPanicButtonLandscape.setEnabled(false);
final Handler handler = new Handler();
handler.postDelayed(() ->
@ -566,6 +569,7 @@ class homeViewController
});
mGatewaySplash.animate().setDuration(350).alpha(0.4f);
mPanicButton.animate().setDuration(250).alpha(0f);
mPanicButtonLandscape.animate().setDuration(250).alpha(0f);
}
private void initSplashScreen(){
@ -661,6 +665,7 @@ class homeViewController
mGatewaySplash.setVisibility(View.GONE);
mConnectButton.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_SPLASH_DISABLE);

View File

@ -7,6 +7,8 @@ import com.darkweb.genesissearchengine.appManager.homeManager.geckoManager.gecko
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import org.mozilla.geckoview.GeckoSession;
public class tabRowModel
{
/*Private Variables*/
@ -39,13 +41,18 @@ public class tabRowModel
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.setTitle(pTitle);
mSession.setURL(pURL);
mSession.setTheme(pTheme);
if(pSessionState != null){
mSession.mSessionState = pSessionState;
mSession.restoreState(pSessionState);
}
if(!status.sSettingIsAppStarted){
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");

View File

@ -4,7 +4,7 @@ public class enums
{
/*Settings Manager*/
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,
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,

View File

@ -28,7 +28,7 @@ public class dataEnums
}
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{

View File

@ -10,6 +10,9 @@ import com.darkweb.genesissearchengine.appManager.historyManager.historyRowModel
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.constants.strings;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import org.mozilla.gecko.util.StringUtils;
import java.util.ArrayList;
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){
if(pQuery.equals(strings.GENERIC_EMPTY_STR)){
if(pQuery.equals(strings.GENERIC_EMPTY_STR) || pQuery.trim().isEmpty()) {
pQuery = "hidden web";
}
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){
if(pQuery.trim().isEmpty()) {
pQuery = "";
}
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().startsWith(pQuery)){
@ -107,6 +114,10 @@ public class suggestionDataModel implements SpellCheckerSession.SpellCheckerSess
private ArrayList<historyRowModel> getSuggestions(String pQuery, ArrayList<historyRowModel> pHistory, ArrayList<bookmarkRowModel> pBookmarks){
if(pQuery.trim().isEmpty()) {
pQuery = "";
}
mCurrentList = new ArrayList<>();
mCurrentList.clear();
String mQueryOriginal = pQuery;

View File

@ -11,17 +11,19 @@ import android.widget.ImageView;
import androidx.annotation.NonNull;
import com.darkweb.genesissearchengine.appManager.activityContextManager;
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.tabManager.tabRowModel;
import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.constants.strings;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import org.mozilla.geckoview.GeckoResult;
import org.mozilla.geckoview.GeckoSession;
import org.mozilla.geckoview.GeckoView;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.sql.PreparedStatement;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
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) {
for(int counter = 0; counter< mTabs.size(); counter++){
@ -327,6 +346,9 @@ class tabDataModel
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){
updateTab((String) pData.get(1), (geckoSession) pData.get(5));
activityContextManager.getInstance().getHomeController().initTabCountForced();

View File

@ -9,9 +9,18 @@ import com.darkweb.genesissearchengine.appManager.historyManager.historyRowModel
import com.darkweb.genesissearchengine.appManager.homeManager.geckoManager.geckoSession;
import com.darkweb.genesissearchengine.appManager.tabManager.tabRowModel;
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.SQLiteDatabase;
import org.mozilla.geckoview.GeckoSession;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
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 " + "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)
@ -155,7 +164,15 @@ public class databaseController
do {
geckoSession mSession = activityContextManager.getInstance().getHomeController().onNewTabInit();
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());
mTempListModel.add(model);
} while(c.moveToNext());

View File

@ -60,8 +60,12 @@ import com.example.myapplication.R;
import org.xmlpull.v1.XmlPullParserException;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.lang.reflect.Field;
import java.net.MalformedURLException;
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) {
try{
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");

View File

@ -31,7 +31,7 @@
android:layout_height="52dp">
<ImageButton
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_height="50dp"
android:onClick="onClose"
android:layout_marginTop="3dp"
android:layout_marginStart="3dp"

View File

@ -537,6 +537,22 @@
app:layout_constraintStart_toStartOf="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
android:id="@+id/pGenesisLogoBottom"
android:layout_width="90dp"

View File

@ -89,7 +89,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="6"
android:layout_marginStart="15dp"
android:layout_marginStart="5dp"
android:clickable="false"
android:orientation="vertical">

View File

@ -79,6 +79,7 @@
android:layout_width="match_parent"
android:layout_marginTop="15dp"
android:layout_marginBottom="15dp"
android:layout_marginStart="5dp"
android:orientation="vertical"
android:layout_height="wrap_content">
<TextView
@ -117,6 +118,7 @@
android:layout_height="wrap_content"
android:background="@xml/gx_ripple_gray"
android:paddingBottom="10dp"
android:layout_marginStart="5dp"
android:paddingTop="10dp"
android:onClick="onSaveLocalNotificationSettings"
android:orientation="horizontal"
@ -178,18 +180,18 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_marginStart="5dp"
android:layout_height="wrap_content"
android:background="@xml/gx_ripple_gray"
android:paddingBottom="10dp"
android:paddingTop="10dp"
android:onClick="onOpenNotificationSettings"
android:orientation="horizontal"
android:weightSum="7">
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="6"
android:layout_weight="1"
android:clickable="false"
android:orientation="vertical">
@ -228,9 +230,8 @@
</LinearLayout>
<ImageButton
android:layout_width="0dp"
android:layout_width="55dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:clickable="false"
android:focusable="false"
android:background="@android:color/transparent"

View File

@ -1,17 +1,17 @@
/* arm versions */
project.ext.arm_vname = 'Build | Dark-Origin'
project.ext.arm_vname = 'Build | Dark-Origin 1.0'
project.ext.arm_vcode = 1000
/* aarch versions */
project.ext.aarch_vname = 'Build | Dark-Origin'
project.ext.aarch_vname = 'Build | Dark-Origin 1.1'
project.ext.aarch_vcode = 1001
/* x86 versions */
project.ext.x86_vname = 'Build | Dark-Origin'
project.ext.x86_vname = 'Build | Dark-Origin 1.2'
project.ext.x86_vcode = 1002
/* x64 versions */
project.ext.x64_vname = 'Build | Dark-Origin'
project.ext.x64_vname = 'Build | Dark-Origin 1.3'
project.ext.x64_vcode = 1003
/* dimension */

View File

@ -1,7 +1,7 @@
apply plugin: 'com.android.library'
android {
compileSdkVersion 31
compileSdkVersion 30
buildToolsVersion '30.0.3'
ndkVersion '21.4.7075529'
@ -56,5 +56,5 @@ dependencies {
implementation 'com.jaredrummler:android-shell:1.0.0'
implementation 'com.offbynull.portmapper:portmapper:2.0.5'
implementation 'info.guardianproject:jtorctl:0.4'
implementation 'com.github.tladesignz:IPtProxy:0.5.2'
implementation 'com.github.tladesignz:IPtProxy:0.5.0'
}

View File

@ -2,6 +2,4 @@
package="org.torproject.android.proxy">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>

View File

@ -308,6 +308,7 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
public int onStartCommand(Intent intent, int flags, int startId) {
self = this;
showToolbarNotification("", NOTIFY_ID, R.drawable.ic_stat_starting_tor_logo);
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 (useIPtObfsMeekProxy())
IPtProxy.startObfs4Proxy("DEBUG", false, false);
IPtProxy.stopObfs4Proxy();
IPtProxy.startObfs4Proxy("DEBUG", true, true);
if (useIPtSnowflakeProxy())
startSnowflakeClient();