mirror of https://github.com/LeOS-GSI/LeOS-Genesis
parent
cb731a8034
commit
99a04ecfb1
|
@ -11,6 +11,8 @@ import com.darkweb.genesissearchengine.appManager.orbotLogManager.orbotLogContro
|
|||
import com.darkweb.genesissearchengine.appManager.settingManager.generalManager.settingGeneralController;
|
||||
import com.darkweb.genesissearchengine.appManager.settingManager.settingHomePage.settingHomeController;
|
||||
import com.darkweb.genesissearchengine.appManager.tabManager.tabController;
|
||||
import com.darkweb.genesissearchengine.helperManager.theme;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
@ -168,6 +170,16 @@ public class activityContextManager
|
|||
}catch (Exception ignored){}
|
||||
}
|
||||
|
||||
public void onResetTheme(){
|
||||
for(int mCounter=0;mCounter<mStackList.size();mCounter++){
|
||||
try{
|
||||
if(!mStackList.get(mCounter).get().isFinishing()){
|
||||
theme.getInstance().onConfigurationChanged(mStackList.get(mCounter).get());
|
||||
}
|
||||
}catch (Exception ignored){}
|
||||
}
|
||||
}
|
||||
|
||||
public void onClearStack(){
|
||||
for(int mCounter=0;mCounter<mStackList.size();mCounter++){
|
||||
try{
|
||||
|
|
|
@ -88,6 +88,7 @@ public class bookmarkController extends AppCompatActivity
|
|||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
super.onConfigurationChanged(newConfig);
|
||||
activityContextManager.getInstance().onResetTheme();
|
||||
|
||||
theme.getInstance().onConfigurationChanged(this);
|
||||
}
|
||||
|
|
|
@ -62,14 +62,17 @@ public class bridgeController extends AppCompatActivity {
|
|||
@Override
|
||||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
super.onConfigurationChanged(newConfig);
|
||||
|
||||
theme.getInstance().onConfigurationChanged(this);
|
||||
activityContextManager.getInstance().onResetTheme();
|
||||
|
||||
super.onConfigurationChanged(newConfig);
|
||||
}
|
||||
|
||||
public void initializeAppModel()
|
||||
{
|
||||
activityContextManager.getInstance().onStack(this);
|
||||
if(!status.mThemeApplying){
|
||||
activityContextManager.getInstance().onStack(this);
|
||||
}
|
||||
mBridgeViewController = new bridgeViewController();
|
||||
}
|
||||
|
||||
|
@ -168,6 +171,7 @@ public class bridgeController extends AppCompatActivity {
|
|||
{
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||
activityContextManager.getInstance().setCurrentActivity(this);
|
||||
|
||||
super.onResume();
|
||||
}
|
||||
|
||||
|
|
|
@ -64,6 +64,9 @@ public class helpController extends AppCompatActivity {
|
|||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
theme.getInstance().onConfigurationChanged(this);
|
||||
activityContextManager.getInstance().onResetTheme();
|
||||
|
||||
super.onConfigurationChanged(newConfig);
|
||||
}
|
||||
|
||||
private void initializeAppModel()
|
||||
|
@ -119,7 +122,9 @@ public class helpController extends AppCompatActivity {
|
|||
|
||||
mSearchInput.setEventHandler(new edittextManagerCallback());
|
||||
|
||||
postToServerRunnable = () -> mHelpAdapter.onTrigger(helpEnums.eHelpAdapter.M_INIT_FILTER, Collections.singletonList(mSearchInput.getText().toString()));
|
||||
if(mHelpAdapter!=null){
|
||||
postToServerRunnable = () -> mHelpAdapter.onTrigger(helpEnums.eHelpAdapter.M_INIT_FILTER, Collections.singletonList(mSearchInput.getText().toString()));
|
||||
}
|
||||
|
||||
mSearchInput.addTextChangedListener(new TextWatcher() {
|
||||
|
||||
|
|
|
@ -88,6 +88,7 @@ public class historyController extends AppCompatActivity
|
|||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
super.onConfigurationChanged(newConfig);
|
||||
activityContextManager.getInstance().onResetTheme();
|
||||
|
||||
theme.getInstance().onConfigurationChanged(this);
|
||||
}
|
||||
|
|
|
@ -384,24 +384,28 @@ public class geckoClients
|
|||
@Override
|
||||
public Object invokeObserver(List<Object> data, Object e_type)
|
||||
{
|
||||
if(e_type.equals(enums.etype.SESSION_ID)){
|
||||
return mSession.getSessionID();
|
||||
}
|
||||
else if (mSessionID!=null && mSessionID.equals(data.get(1)) || e_type.equals(enums.etype.FINDER_RESULT_CALLBACK) || e_type.equals(enums.etype.ON_UPDATE_TAB_TITLE) || e_type.equals(enums.etype.on_update_favicon) ||e_type.equals(enums.etype.on_update_history) || e_type.equals(enums.etype.on_request_completed) || e_type.equals(enums.etype.on_update_suggestion) || e_type.equals(enums.etype.on_update_suggestion_url))
|
||||
{
|
||||
if (e_type.equals(on_handle_external_intent))
|
||||
if(mSession!=null && mSession.isClosed()){
|
||||
return null;
|
||||
}else if(mSession!=null) {
|
||||
if(e_type.equals(enums.etype.SESSION_ID)){
|
||||
return mSession.getSessionID();
|
||||
}
|
||||
else if (mSessionID!=null && mSessionID.equals(data.get(1)) || e_type.equals(enums.etype.FINDER_RESULT_CALLBACK) || e_type.equals(enums.etype.ON_UPDATE_TAB_TITLE) || e_type.equals(enums.etype.on_update_favicon) ||e_type.equals(enums.etype.on_update_history) || e_type.equals(enums.etype.on_request_completed) || e_type.equals(enums.etype.on_update_suggestion) || e_type.equals(enums.etype.on_update_suggestion_url))
|
||||
{
|
||||
try {
|
||||
WebResponse responseInfo = (WebResponse)data.get(0);
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.setDataAndTypeAndNormalize(Uri.parse(responseInfo.uri), responseInfo.headers.get("Content-Type"));
|
||||
activityContextManager.getInstance().getHomeController().startActivity(intent);
|
||||
}catch (Exception ex){
|
||||
Log.i("ex","ex");
|
||||
if (e_type.equals(on_handle_external_intent))
|
||||
{
|
||||
try {
|
||||
WebResponse responseInfo = (WebResponse)data.get(0);
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.setDataAndTypeAndNormalize(Uri.parse(responseInfo.uri), responseInfo.headers.get("Content-Type"));
|
||||
activityContextManager.getInstance().getHomeController().startActivity(intent);
|
||||
}catch (Exception ex){
|
||||
Log.i("ex","ex");
|
||||
}
|
||||
} else
|
||||
{
|
||||
return event.invokeObserver(data, e_type);
|
||||
}
|
||||
} else
|
||||
{
|
||||
return event.invokeObserver(data, e_type);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -113,6 +113,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
|
|||
private boolean isFirstPaintExecuted = false;
|
||||
private boolean mIsProgressBarChanging = false;
|
||||
private Handler mFindHandler;
|
||||
private boolean mClosed = false;
|
||||
|
||||
geckoSession(eventObserver.eventListener event,String mSessionID,AppCompatActivity mContext, GeckoView pGeckoView){
|
||||
|
||||
|
@ -562,7 +563,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
|
|||
|
||||
@UiThread
|
||||
public void onCloseRequest(@NonNull GeckoSession var1) {
|
||||
if(!canGoBack()){
|
||||
if(!canGoBack() && !mClosed){
|
||||
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle), enums.etype.back_list_empty);
|
||||
}
|
||||
}
|
||||
|
@ -570,33 +571,37 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
|
|||
int mCrashCount = 0;
|
||||
@UiThread
|
||||
public void onCrash(@NonNull GeckoSession session) {
|
||||
String mSessionID = (String) event.invokeObserver(null, enums.etype.SESSION_ID);
|
||||
if(mSessionID.equals(getSessionID())){
|
||||
if(mCrashCount<=5){
|
||||
final Handler handler = new Handler();
|
||||
handler.postDelayed(() -> {
|
||||
if(!session.isOpen()){
|
||||
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme, this), enums.etype.M_OPEN_SESSION);
|
||||
}
|
||||
}, mCrashCount*500);
|
||||
if(!mClosed){
|
||||
String mSessionID = (String) event.invokeObserver(null, enums.etype.SESSION_ID);
|
||||
if(mSessionID.equals(getSessionID())){
|
||||
if(mCrashCount<=5){
|
||||
final Handler handler = new Handler();
|
||||
handler.postDelayed(() -> {
|
||||
if(!session.isOpen()){
|
||||
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme, this), enums.etype.M_OPEN_SESSION);
|
||||
}
|
||||
}, mCrashCount*500);
|
||||
}
|
||||
mCrashCount+=1;
|
||||
}
|
||||
mCrashCount+=1;
|
||||
}
|
||||
}
|
||||
|
||||
@UiThread
|
||||
public void onKill(@NonNull GeckoSession session) {
|
||||
String mSessionID = (String) event.invokeObserver(null, enums.etype.SESSION_ID);
|
||||
if(mSessionID.equals(getSessionID())){
|
||||
if(mCrashCount<=5){
|
||||
final Handler handler = new Handler();
|
||||
handler.postDelayed(() -> {
|
||||
if(!session.isOpen()){
|
||||
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme, this), enums.etype.M_OPEN_SESSION);
|
||||
}
|
||||
}, mCrashCount*500);
|
||||
if(!mClosed){
|
||||
String mSessionID = (String) event.invokeObserver(null, enums.etype.SESSION_ID);
|
||||
if(mSessionID.equals(getSessionID())){
|
||||
if(mCrashCount<=5){
|
||||
final Handler handler = new Handler();
|
||||
handler.postDelayed(() -> {
|
||||
if(!session.isOpen()){
|
||||
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme, this), enums.etype.M_OPEN_SESSION);
|
||||
}
|
||||
}, mCrashCount*500);
|
||||
}
|
||||
mCrashCount+=1;
|
||||
}
|
||||
mCrashCount+=1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -700,6 +705,10 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
|
|||
private boolean createAndSaveFileFromBase64Url(String url) {
|
||||
|
||||
try{
|
||||
if(!url.startsWith("data") && !url.startsWith("blob")){
|
||||
return false;
|
||||
}
|
||||
|
||||
File path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
|
||||
|
||||
String filetype;
|
||||
|
@ -855,7 +864,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
|
|||
return mCanGoBack;
|
||||
}
|
||||
|
||||
boolean wasPreviousErrorPage(){
|
||||
public boolean wasPreviousErrorPage(){
|
||||
return mPreviousErrorPage;
|
||||
}
|
||||
|
||||
|
@ -883,6 +892,16 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
|
|||
event.invokeObserver(Arrays.asList(null,mSessionID), enums.etype.on_close_sesson);
|
||||
}
|
||||
|
||||
public void closeSessionInstant(){
|
||||
mSessionID = "-1";
|
||||
mClosed = true;
|
||||
close();
|
||||
}
|
||||
|
||||
public boolean isClosed(){
|
||||
return mClosed;
|
||||
}
|
||||
|
||||
GeckoResult<FinderResult> mFinder = null;
|
||||
public void findInPage(String pQuery, int pDirection){
|
||||
mFinder = null;
|
||||
|
|
|
@ -76,6 +76,8 @@ import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
|
|||
import com.darkweb.genesissearchengine.widget.progressBar.AnimatedProgressBar;
|
||||
import com.example.myapplication.R;
|
||||
import com.google.android.gms.ads.AdView;
|
||||
|
||||
import org.mozilla.geckoview.ContentBlocking;
|
||||
import org.mozilla.geckoview.GeckoResult;
|
||||
import org.mozilla.geckoview.GeckoSession;
|
||||
import org.torproject.android.service.OrbotService;
|
||||
|
@ -104,6 +106,7 @@ import static com.darkweb.genesissearchengine.constants.enums.etype.open_new_tab
|
|||
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManager.*;
|
||||
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManagerCallbacks.M_RATE_APPLICATION;
|
||||
import static java.lang.Character.isLetter;
|
||||
import static org.mozilla.geckoview.ContentBlocking.CookieBehavior.ACCEPT_FIRST_PARTY;
|
||||
|
||||
public class homeController extends AppCompatActivity implements ComponentCallbacks2
|
||||
{
|
||||
|
@ -127,6 +130,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
private TextView mLoadingText;
|
||||
private AdView mBannerAds = null;
|
||||
private ImageButton mGatewaySplash;
|
||||
private ImageButton mPanicButton;
|
||||
private LinearLayout mTopBar;
|
||||
private ImageView mBackSplash;
|
||||
private Button mConnectButton;
|
||||
|
@ -433,13 +437,14 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
mNewTabBlocker = findViewById(R.id.pNewTabBlocker);
|
||||
mCoordinatorLayout = findViewById(R.id.pCoordinatorLayout);
|
||||
mImageDivider = findViewById(R.id.pImageDivider);
|
||||
mPanicButton = findViewById(R.id.pPanicButton);
|
||||
|
||||
mGeckoView.setSaveEnabled(false);
|
||||
mGeckoView.setSaveFromParentEnabled(false);
|
||||
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);
|
||||
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);
|
||||
mGeckoView.onSetHomeEvent(new nestedGeckoViewCallback());
|
||||
mGeckoClient.initialize(mGeckoView, new geckoViewCallback(), this,false);
|
||||
mGeckoClient.onValidateInitializeFromStartup(mGeckoView, homeController.this);
|
||||
|
@ -1211,10 +1216,12 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
if(activityContextManager.getInstance().getTabController().isSelectionOpened()){
|
||||
activityContextManager.getInstance().getTabController().onClearSelection(null);
|
||||
}else {
|
||||
boolean mStatus = activityContextManager.getInstance().getTabController().onBackPressed();
|
||||
onResumeDump();
|
||||
mHomeViewController.onHideTabContainer();
|
||||
activityContextManager.getInstance().getTabController().onPostExit();
|
||||
activityContextManager.getInstance().getTabController().onBackPressed();
|
||||
if(!mStatus){
|
||||
mHomeViewController.onHideTabContainer();
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -1368,7 +1375,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
pluginController.getInstance().onNotificationInvoke(null, pluginEnums.eNotificationManager.M_CLEAR_NOTIFICATION );
|
||||
|
||||
if(!status.mThemeApplying){
|
||||
activityContextManager.getInstance().onClearStack();
|
||||
//activityContextManager.getInstance().onClearStack();
|
||||
}
|
||||
initWidget();
|
||||
initTabCountForced();
|
||||
|
@ -1380,6 +1387,12 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
pluginController.getInstance().onMessageManagerInvoke(null, M_RESET);
|
||||
}
|
||||
|
||||
if(status.sSettingIsAppStarted && !status.mThemeApplying){
|
||||
if(mGeckoClient.getSession().wasPreviousErrorPage()){
|
||||
mGeckoClient.onReload(mGeckoView, this);
|
||||
}
|
||||
}
|
||||
|
||||
status.mThemeApplying = false;
|
||||
|
||||
super.onResume();
|
||||
|
@ -1747,6 +1760,60 @@ public class homeController extends AppCompatActivity implements ComponentCallba
|
|||
helperMethod.openActivity(orbotLogController.class, constants.CONST_LIST_HISTORY, homeController.this,true);
|
||||
}
|
||||
|
||||
public void panicExit(View view) {
|
||||
pluginController.getInstance().onMessageManagerInvoke(null, M_RESET);
|
||||
pluginController.getInstance().onMessageManagerInvoke(Collections.singletonList(homeController.this), M_PANIC_RESET);
|
||||
}
|
||||
|
||||
public void panicExitInvoked() {
|
||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_SEARCH_HISTORY,true));
|
||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_SEARCH_SUGGESTION,true));
|
||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_JAVA_SCRIPT,true));
|
||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_HISTORY_CLEAR,true));
|
||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_GATEWAY,true));
|
||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_GATEWAY_MANUAL,false));
|
||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.VPN_ENABLED,false));
|
||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.BRIDGE_ENABLES,false));
|
||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_FONT_ADJUSTABLE,true));
|
||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_ZOOM,true));
|
||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_VOICE_INPUT,true));
|
||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_INT, Arrays.asList(keys.SETTING_TRACKING_PROTECTION, ContentBlocking.AntiTracking.DEFAULT));
|
||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_DONOT_TRACK,true));
|
||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_INT, Arrays.asList(keys.SETTING_COOKIE_ADJUSTABLE,ACCEPT_FIRST_PARTY));
|
||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_FLOAT, Arrays.asList(keys.SETTING_FONT_SIZE,100));
|
||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_STRING, Arrays.asList(keys.SETTING_LANGUAGE, strings.SETTING_DEFAULT_LANGUAGE));
|
||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_STRING, Arrays.asList(keys.SETTING_LANGUAGE_REGION,strings.SETTING_DEFAULT_LANGUAGE_REGION));
|
||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_STRING, Arrays.asList(keys.SETTING_SEARCH_ENGINE,constants.CONST_BACKEND_GENESIS_URL));
|
||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_STRING, Arrays.asList(keys.BRIDGE_CUSTOM_BRIDGE_1,strings.BRIDGE_CUSTOM_BRIDGE_OBFS4));
|
||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_INT, Arrays.asList(keys.SETTING_NOTIFICATION_STATUS,1));
|
||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_RESTORE_TAB,false));
|
||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_CHARACTER_ENCODING,false));
|
||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_INT, Arrays.asList(keys.SETTING_SHOW_IMAGES,0));
|
||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_SHOW_FONTS,true));
|
||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_TOOLBAR_THEME,true));
|
||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_FULL_SCREEN_BROWSIING,true));
|
||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_INT, Arrays.asList(keys.SETTING_THEME, enums.Theme.THEME_DEFAULT));
|
||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_LIST_VIEW,true));
|
||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_SHOW_TAB_GRID,true));
|
||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_OPEN_URL_IN_NEW_TAB,true));
|
||||
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_STRING, Arrays.asList(keys.BRIDGE_CUSTOM_TYPE,strings.BRIDGE_CUSTOM_BRIDGE_OBFS4));
|
||||
|
||||
status.sSettingIsAppStarted = false;
|
||||
finishAndRemoveTask();
|
||||
|
||||
new Thread(){
|
||||
public void run(){
|
||||
try {
|
||||
sleep(1000);
|
||||
android.os.Process.killProcess(android.os.Process.myPid());
|
||||
System.exit(1);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
public class nestedGeckoViewCallback implements eventObserver.eventListener{
|
||||
|
||||
@Override
|
||||
|
|
|
@ -106,6 +106,7 @@ class homeViewController
|
|||
private ImageView mNewTabBlocker;
|
||||
private CoordinatorLayout mCoordinatorLayout;
|
||||
private ImageView mImageDivider;
|
||||
private ImageButton mPanicButton;
|
||||
|
||||
/*Local Variables*/
|
||||
private Callable<String> mLogs = null;
|
||||
|
@ -115,7 +116,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){
|
||||
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){
|
||||
this.mContext = context;
|
||||
this.mProgressBar = progressBar;
|
||||
this.mSearchbar = searchbar;
|
||||
|
@ -154,6 +155,7 @@ class homeViewController
|
|||
this.mNewTabBlocker = pNewTabBlocker;
|
||||
this.mCoordinatorLayout = mCoordinatorLayout;
|
||||
this.mImageDivider = pImageDivider;
|
||||
this.mPanicButton = pPanicButton;
|
||||
|
||||
initSplashScreen();
|
||||
createUpdateUiHandler();
|
||||
|
@ -520,6 +522,7 @@ class homeViewController
|
|||
mConnectButton.setEnabled(false);
|
||||
mSplashScreen.setEnabled(false);
|
||||
mOrbotLogManager.setEnabled(false);
|
||||
mPanicButton.setEnabled(false);
|
||||
|
||||
final Handler handler = new Handler();
|
||||
handler.postDelayed(() ->
|
||||
|
@ -532,6 +535,7 @@ class homeViewController
|
|||
initSplashLoading();
|
||||
});
|
||||
mGatewaySplash.animate().setDuration(350).alpha(0.4f);
|
||||
mPanicButton.animate().setDuration(250).alpha(0f);
|
||||
}
|
||||
|
||||
private void initSplashScreen(){
|
||||
|
@ -626,6 +630,8 @@ class homeViewController
|
|||
mBlocker.setVisibility(View.GONE);
|
||||
mGatewaySplash.setVisibility(View.GONE);
|
||||
mConnectButton.setVisibility(View.GONE);
|
||||
mPanicButton.setVisibility(View.GONE);
|
||||
|
||||
mEvent.invokeObserver(null, enums.etype.M_CACHE_UPDATE_TAB);
|
||||
mEvent.invokeObserver(null, enums.etype.M_SPLASH_DISABLE);
|
||||
}));
|
||||
|
|
|
@ -67,6 +67,7 @@ public class languageController extends AppCompatActivity {
|
|||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
super.onConfigurationChanged(newConfig);
|
||||
activityContextManager.getInstance().onResetTheme();
|
||||
|
||||
theme.getInstance().onConfigurationChanged(this);
|
||||
}
|
||||
|
|
|
@ -67,9 +67,10 @@ public class orbotLogController extends AppCompatActivity {
|
|||
@Override
|
||||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
super.onConfigurationChanged(newConfig);
|
||||
|
||||
theme.getInstance().onConfigurationChanged(this);
|
||||
activityContextManager.getInstance().onResetTheme();
|
||||
|
||||
super.onConfigurationChanged(newConfig);
|
||||
}
|
||||
|
||||
public void viewsInitializations() {
|
||||
|
|
|
@ -53,6 +53,10 @@ public class orbotController extends AppCompatActivity {
|
|||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.orbot_settings_view);
|
||||
|
||||
if(!status.mThemeApplying){
|
||||
activityContextManager.getInstance().onStack(this);
|
||||
}
|
||||
|
||||
viewsInitializations();
|
||||
onInitListener();
|
||||
}
|
||||
|
@ -60,9 +64,10 @@ public class orbotController extends AppCompatActivity {
|
|||
@Override
|
||||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
super.onConfigurationChanged(newConfig);
|
||||
|
||||
theme.getInstance().onConfigurationChanged(this);
|
||||
activityContextManager.getInstance().onResetTheme();
|
||||
|
||||
super.onConfigurationChanged(newConfig);
|
||||
}
|
||||
|
||||
public void viewsInitializations() {
|
||||
|
@ -137,9 +142,6 @@ public class orbotController extends AppCompatActivity {
|
|||
{
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
|
||||
activityContextManager.getInstance().setCurrentActivity(this);
|
||||
mOrbotViewController.onTrigger(orbotEnums.eOrbotViewCommands.M_INIT_POST_UI,null);
|
||||
|
||||
activityContextManager.getInstance().onStack(this);
|
||||
super.onResume();
|
||||
}
|
||||
|
||||
|
|
|
@ -50,6 +50,7 @@ public class proxyStatusController extends AppCompatActivity {
|
|||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
super.onConfigurationChanged(newConfig);
|
||||
activityContextManager.getInstance().onResetTheme();
|
||||
|
||||
theme.getInstance().onConfigurationChanged(this);
|
||||
}
|
||||
|
|
|
@ -60,6 +60,7 @@ public class settingAccessibilityController extends AppCompatActivity {
|
|||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
super.onConfigurationChanged(newConfig);
|
||||
activityContextManager.getInstance().onResetTheme();
|
||||
|
||||
theme.getInstance().onConfigurationChanged(this);
|
||||
}
|
||||
|
|
|
@ -56,6 +56,7 @@ public class settingAdvanceController extends AppCompatActivity {
|
|||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
super.onConfigurationChanged(newConfig);
|
||||
activityContextManager.getInstance().onResetTheme();
|
||||
|
||||
theme.getInstance().onConfigurationChanged(this);
|
||||
}
|
||||
|
|
|
@ -57,6 +57,7 @@ public class settingClearController extends AppCompatActivity {
|
|||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
super.onConfigurationChanged(newConfig);
|
||||
activityContextManager.getInstance().onResetTheme();
|
||||
|
||||
theme.getInstance().onConfigurationChanged(this);
|
||||
}
|
||||
|
|
|
@ -63,6 +63,10 @@ public class settingGeneralController extends AppCompatActivity {
|
|||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
super.onConfigurationChanged(newConfig);
|
||||
|
||||
if(!mIsThemeChanging){
|
||||
//activityContextManager.getInstance().onResetTheme();
|
||||
}
|
||||
|
||||
theme.getInstance().onConfigurationChanged(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@ public class settingLogController extends AppCompatActivity {
|
|||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
super.onConfigurationChanged(newConfig);
|
||||
activityContextManager.getInstance().onResetTheme();
|
||||
|
||||
theme.getInstance().onConfigurationChanged(this);
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@ public class settingNotificationController extends AppCompatActivity {
|
|||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
super.onConfigurationChanged(newConfig);
|
||||
activityContextManager.getInstance().onResetTheme();
|
||||
|
||||
theme.getInstance().onConfigurationChanged(this);
|
||||
}
|
||||
|
|
|
@ -53,6 +53,7 @@ public class settingPrivacyController extends AppCompatActivity {
|
|||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
super.onConfigurationChanged(newConfig);
|
||||
activityContextManager.getInstance().onResetTheme();
|
||||
|
||||
theme.getInstance().onConfigurationChanged(this);
|
||||
}
|
||||
|
|
|
@ -48,6 +48,7 @@ public class settingSearchController extends AppCompatActivity {
|
|||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
super.onConfigurationChanged(newConfig);
|
||||
activityContextManager.getInstance().onResetTheme();
|
||||
|
||||
theme.getInstance().onConfigurationChanged(this);
|
||||
}
|
||||
|
|
|
@ -69,6 +69,7 @@ public class settingHomeController extends AppCompatActivity
|
|||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
super.onConfigurationChanged(newConfig);
|
||||
activityContextManager.getInstance().onResetTheme();
|
||||
|
||||
theme.getInstance().onConfigurationChanged(this);
|
||||
}
|
||||
|
|
|
@ -51,6 +51,7 @@ public class settingTrackingController extends AppCompatActivity {
|
|||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
|
||||
super.onConfigurationChanged(newConfig);
|
||||
activityContextManager.getInstance().onResetTheme();
|
||||
|
||||
theme.getInstance().onConfigurationChanged(this);
|
||||
}
|
||||
|
|
|
@ -317,7 +317,8 @@ public class tabController extends Fragment
|
|||
|
||||
public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {
|
||||
int position = viewHolder.getAdapterPosition();
|
||||
onExitAndClearBackup();
|
||||
onClearTabBackup();
|
||||
mListModel.onTrigger(tabEnums.eModelCallback.M_CLEAR_BACKUP_RETAIN_DATABASE,null);
|
||||
boolean mStatus = onInitRemoveView(position, true, true);
|
||||
if(mStatus){
|
||||
mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.NOTIFY_SWIPE, Collections.singletonList(position));
|
||||
|
@ -378,7 +379,7 @@ public class tabController extends Fragment
|
|||
new Handler().postDelayed(() -> {
|
||||
onSwipeBounce(0);
|
||||
}, 400);
|
||||
return false;
|
||||
return true;
|
||||
}else{
|
||||
onShowUndoDialog();
|
||||
mTabAdapter.notifyItemRangeChanged(pIndex, mTabAdapter.getItemCount() - pIndex);
|
||||
|
@ -446,8 +447,8 @@ public class tabController extends Fragment
|
|||
public void onClearTabBackup(){
|
||||
ArrayList<tabRowModel> mBackupIndex = (ArrayList<tabRowModel>)mListModel.onTrigger(tabEnums.eModelCallback.M_GET_BACKUP,null);
|
||||
for(int mCounter=0;mCounter<mBackupIndex.size();mCounter++){
|
||||
mBackupIndex.get(mCounter).getSession().closeSessionInstant();
|
||||
dataController.getInstance().invokeTab(dataEnums.eTabCommands.CLOSE_TAB, Arrays.asList(mBackupIndex.get(mCounter).getSession(), mBackupIndex.get(mCounter).getmId()));
|
||||
mBackupIndex.get(mCounter).getSession().closeSession();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -551,9 +552,6 @@ public class tabController extends Fragment
|
|||
mRecycleView.animate().setDuration(250).alpha(0).withEndAction(() -> {
|
||||
mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.REMOVE_ALL, null);
|
||||
onClearSelection(null);
|
||||
|
||||
onClearTabBackup();
|
||||
mListModel.onTrigger(tabEnums.eModelCallback.M_CLEAR_BACKUP_RETAIN_DATABASE,null);
|
||||
});
|
||||
}
|
||||
else if(pView.getId() == R.id.pOpenSetting){
|
||||
|
@ -586,7 +584,7 @@ public class tabController extends Fragment
|
|||
}
|
||||
|
||||
|
||||
public void onBackPressed() {
|
||||
public boolean onBackPressed() {
|
||||
if(mTabAdapter!=null){
|
||||
boolean mStatus = (boolean) mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.M_SELECTION_MENU_SHOWING, null);
|
||||
onClearTabBackup();
|
||||
|
@ -594,8 +592,10 @@ public class tabController extends Fragment
|
|||
if(!mStatus){
|
||||
mHomeController.onDisableTabViewController();
|
||||
onClose();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*Event Observer*/
|
||||
|
|
|
@ -100,6 +100,7 @@ class tabDataModel
|
|||
void closeTab(geckoSession mSession,Object pID) {
|
||||
mSession.stop();
|
||||
mSession.close();
|
||||
|
||||
if(pID == null){
|
||||
String mID = strings.GENERIC_EMPTY_STR;
|
||||
for(int counter = 0; counter< mTabs.size(); counter++){
|
||||
|
|
|
@ -14,14 +14,6 @@ import java.util.List;
|
|||
public class ProxySelector {
|
||||
|
||||
public static URLConnection openConnectionWithProxy(final URI uri) throws IOException {
|
||||
final java.net.ProxySelector ps = java.net.ProxySelector.getDefault();
|
||||
Proxy proxy = Proxy.NO_PROXY;
|
||||
if (ps != null) {
|
||||
final List<Proxy> proxies = ps.select(uri);
|
||||
if (proxies != null && !proxies.isEmpty()) {
|
||||
proxy = proxies.get(0);
|
||||
}
|
||||
}
|
||||
|
||||
return uri.toURL().openConnection(ProxySettings.getProxy());
|
||||
}
|
||||
|
|
|
@ -7,11 +7,11 @@ import ch.boye.httpclientandroidlib.HttpHost;
|
|||
|
||||
public class ProxySettings {
|
||||
private static final String TOR_PROXY_ADDRESS = "127.0.0.1";
|
||||
private static final int TOR_PROXY_PORT = 9050;
|
||||
private static final int TOR_PROXY_PORT = 1080;
|
||||
|
||||
public static Proxy getProxy() {
|
||||
// TODO make configurable
|
||||
return new Proxy(Proxy.Type.SOCKS, new InetSocketAddress(TOR_PROXY_ADDRESS, TOR_PROXY_PORT));
|
||||
return new Proxy(Proxy.Type.HTTP, new InetSocketAddress(TOR_PROXY_ADDRESS, TOR_PROXY_PORT));
|
||||
}
|
||||
|
||||
public static HttpHost getProxyHost() {
|
||||
|
|
|
@ -22,10 +22,10 @@ public class theme {
|
|||
|
||||
public void onConfigurationChanged(AppCompatActivity pContext){
|
||||
boolean sDefaultNightMode = (pContext.getApplicationContext().getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES;
|
||||
if(status.sDefaultNightMode != sDefaultNightMode){
|
||||
// if(status.sDefaultNightMode != sDefaultNightMode){
|
||||
setupThemeLocal(pContext, sDefaultNightMode);
|
||||
pContext.recreate();
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
public void setupThemeLocal(Context context, boolean sDefaultNightMode) {
|
||||
|
|
|
@ -222,6 +222,16 @@ class messageManager
|
|||
mDialog.setOnDismissListener(dialog -> onClearReference());
|
||||
}
|
||||
|
||||
private void onPanic(){
|
||||
initializeDialog(R.layout.popup_panic, Gravity.BOTTOM);
|
||||
mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss());
|
||||
mDialog.setOnDismissListener(dialog -> onClearReference());
|
||||
mDialog.findViewById(R.id.pNext).setOnClickListener(v -> {
|
||||
mDialog.dismiss();
|
||||
mEvent.invokeObserver(null, M_PANIC_RESET);
|
||||
});
|
||||
}
|
||||
|
||||
private void dataClearedSuccessfully()
|
||||
{
|
||||
initializeDialog(R.layout.popup_data_cleared, Gravity.BOTTOM);
|
||||
|
@ -632,6 +642,11 @@ class messageManager
|
|||
notSupportMessage();
|
||||
break;
|
||||
|
||||
case M_PANIC_RESET:
|
||||
/*VERIFIED*/
|
||||
onPanic();
|
||||
break;
|
||||
|
||||
case M_DATA_CLEARED:
|
||||
/*VERIFIED*/
|
||||
dataClearedSuccessfully();
|
||||
|
|
|
@ -169,6 +169,10 @@ class orbotManager
|
|||
{
|
||||
String logs = orbotLocalConstants.mTorLogsStatus;
|
||||
|
||||
if(orbotLocalConstants.mTorLogsStatus.equals("No internet connection")){
|
||||
return "Warning | " + orbotLocalConstants.mTorLogsStatus;
|
||||
}
|
||||
|
||||
if(!logs.contains("Bootstrapped") && !mLogsStarted){
|
||||
logs = "Initializing Bootstrap";
|
||||
mLogsStarted = true;
|
||||
|
|
|
@ -198,6 +198,9 @@ public class pluginController
|
|||
{
|
||||
((homeController)mHomeController.get()).onLoadURL(pData.get(0).toString());
|
||||
}
|
||||
else if(pEventType.equals(M_PANIC_RESET)){
|
||||
activityContextManager.getInstance().getHomeController().panicExitInvoked();
|
||||
}
|
||||
else if(pEventType.equals(M_DOWNLOAD_SINGLE)){
|
||||
activityContextManager.getInstance().getHomeController().onManualDownloadFileName((String)pData.get(2),(String)pData.get(0));
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ public class pluginEnums
|
|||
|
||||
/*Message Manager*/
|
||||
public enum eMessageManager{
|
||||
M_RESET, M_DATA_CLEARED, M_SECURE_CONNECTION, M_POPUP_BLOCKED, M_MAX_TAB_REACHED,M_DOWNLOAD_SINGLE, M_UPDATE_BRIDGES, M_NEW_IDENTITY, M_NOT_SUPPORTED, M_BRIDGE_MAIL, M_LONG_PRESS_WITH_LINK, M_LONG_PRESS_URL, M_LONG_PRESS_DOWNLOAD, M_START_ORBOT, M_DOWNLOAD_FILE, M_RATE_APP, M_REPORT_URL, M_CLEAR_BOOKMARK, M_CLEAR_HISTORY, M_BOOKMARK, M_RATE_SUCCESS, M_RATE_FAILURE, M_LANGUAGE_SUPPORT_FAILURE, M_WELCOME
|
||||
M_RESET, M_DATA_CLEARED, M_SECURE_CONNECTION, M_POPUP_BLOCKED, M_PANIC, M_MAX_TAB_REACHED,M_DOWNLOAD_SINGLE, M_UPDATE_BRIDGES, M_NEW_IDENTITY, M_NOT_SUPPORTED, M_BRIDGE_MAIL, M_LONG_PRESS_WITH_LINK, M_LONG_PRESS_URL, M_LONG_PRESS_DOWNLOAD, M_START_ORBOT, M_DOWNLOAD_FILE, M_RATE_APP, M_REPORT_URL, M_CLEAR_BOOKMARK, M_CLEAR_HISTORY, M_BOOKMARK, M_PANIC_RESET, M_RATE_SUCCESS, M_RATE_FAILURE, M_LANGUAGE_SUPPORT_FAILURE, M_WELCOME
|
||||
}
|
||||
public enum eMessageManagerCallbacks{
|
||||
M_CANCEL_WELCOME, M_APP_RATED, M_DOWNLOAD_FILE_MANUAL, M_OPEN_LINK_CURRENT_TAB, M_COPY_LINK, M_REQUEST_BRIDGES, M_SET_BRIDGES, M_OPEN_LINK_NEW_TAB, M_CLEAR_TAB, M_RATE_APPLICATION, M_OPEN_PRIVACY
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/holo_gray">
|
||||
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#ffc107" />
|
||||
<corners
|
||||
android:bottomLeftRadius = "5.5dp"
|
||||
android:bottomRightRadius = "0dp"
|
||||
android:topLeftRadius = "5.5dp"
|
||||
android:topRightRadius = "0dp"
|
||||
/>
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item android:id="@android:id/mask" android:right="5dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/holo_gray" />
|
||||
<corners
|
||||
android:bottomLeftRadius = "5.5dp"
|
||||
android:bottomRightRadius = "0dp"
|
||||
android:topLeftRadius = "5.5dp"
|
||||
android:topRightRadius = "0dp"
|
||||
/>
|
||||
<solid android:color="#ffffff" />
|
||||
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item android:id="@android:id/background" android:right="5dp">
|
||||
<shape android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="90"
|
||||
android:endColor="@color/c_splash_buttons"
|
||||
android:startColor="@color/c_splash_buttons"
|
||||
android:type="linear" />
|
||||
<corners
|
||||
android:bottomLeftRadius = "5.5dp"
|
||||
android:bottomRightRadius = "0dp"
|
||||
android:topLeftRadius = "5.5dp"
|
||||
android:topRightRadius = "0dp"
|
||||
/>
|
||||
<solid android:color="#ffffff" />
|
||||
|
||||
</shape>
|
||||
|
||||
</item>
|
||||
|
||||
</ripple>
|
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
|
@ -0,0 +1,109 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/pMainLayout"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@xml/hox_rounded_corner"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/pHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:paddingEnd="15dp"
|
||||
android:paddingStart="15dp"
|
||||
android:text="@string/ALERT_PANIC"
|
||||
android:textAlignment="textStart"
|
||||
android:textColor="@color/c_text_setting_heading_v2"
|
||||
android:textSize="17sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/pDescription"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:paddingEnd="15dp"
|
||||
android:paddingStart="15dp"
|
||||
android:text="@string/ALERT_PANIC_INFO"
|
||||
android:textAlignment="textStart"
|
||||
android:textColor="@color/c_alert_text"
|
||||
android:textSize="13sp"
|
||||
android:alpha="0.6"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/pHeader"
|
||||
tools:ignore="SmallSp" />
|
||||
|
||||
<View
|
||||
android:id="@+id/pDivider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="25dp"
|
||||
android:background="@color/c_view_divier_background"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/pDescription" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/pNavigationContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/pDivider">
|
||||
|
||||
<Button
|
||||
android:id="@+id/pDismiss"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@xml/ax_ripple_default_round_left"
|
||||
android:padding="0dp"
|
||||
android:text="@string/ALERT_PANIC_BT_2"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@color/c_button_text_v2"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<View
|
||||
android:id="@+id/pDividerHorizontal"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/c_view_divier_background"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/pRating" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/pNext"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@xml/ax_ripple_default_round_right"
|
||||
android:padding="0dp"
|
||||
android:text="@string/ALERT_PANIC_BT_1"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@color/c_button_warning"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -362,6 +362,7 @@
|
|||
android:textCursorDrawable="@xml/gx_search_cursor_state"
|
||||
android:id="@+id/pCustomPort"
|
||||
android:layout_width="0dp"
|
||||
android:textColor="@color/c_text_v1"
|
||||
android:layout_weight="11"
|
||||
android:clickable="false"
|
||||
android:onClick="onOpenCustomBridgeUpdater"
|
||||
|
@ -374,6 +375,7 @@
|
|||
android:layout_marginStart="15dp"
|
||||
android:ems="10"
|
||||
android:maxLines="1"
|
||||
android:textColorHint="@color/c_button_text"
|
||||
android:hint="@string/BRIDGE_PORT_HINT"
|
||||
android:textSize="14.5sp"
|
||||
android:text=""
|
||||
|
|
|
@ -428,6 +428,22 @@
|
|||
app:layout_constraintTop_toBottomOf="@+id/pGenesisLogo"
|
||||
app:srcCompat="@drawable/sheild_logo_bordered" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/pPanicButton"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:alpha="1"
|
||||
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" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/pInfo2"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
<color name="c_ripple_v1">#0c0b0e</color>
|
||||
<color name="c_ripple_v2">#18171c</color>
|
||||
<color name="c_ripple_v3">#24222a</color>
|
||||
<color name="c_button_text">#1c1b21</color>
|
||||
<color name="c_button_text">#b3b3b3</color>
|
||||
<color name="c_button_background">#3c3946</color>
|
||||
<color name="c_alert_background">#3c3946</color>
|
||||
<color name="c_view_divier_background_v1">#24222a</color>
|
||||
|
|
|
@ -241,6 +241,12 @@
|
|||
<string name="ALERT_ORBOT_INIT" translatable="true">Initializing Orbot</string>
|
||||
<string name="ALERT_NOT_SUPPORTED" translatable="true">Action not supported</string>
|
||||
<string name="ALERT_NOT_SUPPORTED_INFO" translatable="true">No application found to handle the following command</string>
|
||||
|
||||
<string name="ALERT_PANIC" translatable="true">Troubleshoot | Genesis</string>
|
||||
<string name="ALERT_PANIC_INFO" translatable="true">Reset application in case if its not working. We will try to reconfigure it so it might work again. \n\n⚠️ Warning! it will clear Genesis app data</string>
|
||||
<string name="ALERT_PANIC_BT_1" translatable="true">Reset</string>
|
||||
<string name="ALERT_PANIC_BT_2" translatable="true">Dismiss</string>
|
||||
|
||||
<string name="ALERT_WELCOME_MESSAGE" translatable="true">Welcome | Hidden Web Gateway</string>
|
||||
<string name="ALERT_WELCOME_MESSAGE_INFO" translatable="true">This application provide you a platform to search and open hidden web urls. Here are few suggestions\n</string>
|
||||
<string name="ALERT_WELCOME_MESSAGE_BT_1" translatable="true">Deep Web Online Market</string>
|
||||
|
|
|
@ -12,8 +12,8 @@ android {
|
|||
}
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 30
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 31
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
|
|
Loading…
Reference in New Issue