Bug Fixes

Bug Fixes
master
Abdul Mannan Saeed 2023-02-15 02:09:35 +05:00
parent 3641c1a49a
commit 5817c45cbb
30 changed files with 227 additions and 178 deletions

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<targetSelectedWithDropDown>
<Target>
<type value="QUICK_BOOT_TARGET" />
<deviceKey>
<Key>
<type value="VIRTUAL_DEVICE_PATH" />
<value value="C:\Users\msman\.android\avd\Nexus_6P_API_33.avd" />
</Key>
</deviceKey>
</Target>
</targetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2023-02-07T21:45:12.561778Z" />
</component>
</project>

View File

@ -1,3 +1,3 @@
#Sun Feb 12 18:54:23 PKT 2023
#Wed Feb 15 00:42:23 PKT 2023
\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
json=321093871
json=337604914

View File

@ -1,5 +1,5 @@
#
#Sun Feb 12 19:27:01 PKT 2023
#Wed Feb 15 01:32:40 PKT 2023
\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
sdk_analysis_plugin_version=4.8.5
set_multidex=true

View File

@ -30,12 +30,12 @@
padding-top: 3px
}
.privacy__welcome-mail{
font-size: 15px;/
text-align:center;
font-size: 15px;
text-align:center !important;
margin: 25px auto auto;
font-weight: bold;
padding: 13px 13px 13px 33px;
width: 200px;
padding: 13px 13px 13px 13px;
max-width: 200px;
border-radius: 5px;
border: 2px solid white;
cursor: pointer;

View File

@ -21,6 +21,7 @@ import com.hiddenservices.onionservices.dataManager.models.bookmarkRowModel;
import com.hiddenservices.onionservices.eventObserver;
import com.hiddenservices.onionservices.helperManager.helperMethod;
import com.hiddenservices.onionservices.R;
import com.hiddenservices.onionservices.pluginManager.pluginController;
import java.util.ArrayList;
import java.util.Arrays;
@ -29,6 +30,8 @@ import java.util.Date;
import java.util.List;
import static android.content.Context.LAYOUT_INFLATER_SERVICE;
import static com.hiddenservices.onionservices.pluginManager.pluginEnums.eMessageManager.M_COPY;
import static com.hiddenservices.onionservices.pluginManager.pluginEnums.eMessageManager.M_RESET;
@SuppressLint("NotifyDataSetChanged")
public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listViewHolder> {
@ -327,7 +330,7 @@ public class bookmarkAdapter extends RecyclerView.Adapter<bookmarkAdapter.listVi
if (v.getId() == R.id.pMenuCopy) {
helperMethod.copyURL(pUrl, mListHolderContext);
mPopupWindow.dismiss();
helperMethod.showToastMessage("copied to clipboard", mContext);
pluginController.getInstance().onMessageManagerInvoke(Collections.singletonList(mContext), M_COPY);
} else if (v.getId() == R.id.pMenuShare) {
helperMethod.shareApp((AppCompatActivity) mListHolderContext, pUrl, pTitle);
mPopupWindow.dismiss();

View File

@ -22,6 +22,7 @@ import com.hiddenservices.onionservices.dataManager.models.historyRowModel;
import com.hiddenservices.onionservices.eventObserver;
import com.hiddenservices.onionservices.helperManager.helperMethod;
import com.hiddenservices.onionservices.R;
import com.hiddenservices.onionservices.pluginManager.pluginController;
import java.util.ArrayList;
import java.util.Arrays;
@ -32,6 +33,8 @@ import java.util.List;
import static android.content.Context.LAYOUT_INFLATER_SERVICE;
import static com.hiddenservices.onionservices.pluginManager.pluginEnums.eMessageManager.M_COPY;
import static com.hiddenservices.onionservices.pluginManager.pluginEnums.eMessageManager.M_RESET;
@SuppressLint("NotifyDataSetChanged")
public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listViewHolder> {
@ -401,7 +404,7 @@ public class historyAdapter extends RecyclerView.Adapter<historyAdapter.listView
if (v.getId() == R.id.pMenuCopy) {
helperMethod.copyURL(pUrl, mListHolderContext);
mPopupWindow.dismiss();
helperMethod.showToastMessage("copied to clipboard", mContext);
pluginController.getInstance().onMessageManagerInvoke(Collections.singletonList(mContext), M_COPY);
} else if (v.getId() == R.id.pMenuShare) {
helperMethod.shareApp((AppCompatActivity) mListHolderContext, pUrl, pTitle);
mPopupWindow.dismiss();

View File

@ -1,9 +1,10 @@
package com.hiddenservices.onionservices.appManager.homeManager.geckoManager.dataModel;
public class geckoDataModel {
public boolean mFullScreenStatus = false;
public int mCurrentURL_ID = -1;
public boolean mFullScreenStatus = false;
public String mTheme = null;
public String mCurrentURL = "about:blank";
public String mSessionID;
public String mCurrentTitle = "loading";

View File

@ -73,21 +73,21 @@ public class contentDelegate implements GeckoSession.ContentDelegate {
}
if (var4.type != 0 && var4.srcUri != null) {
if (var4.linkUri != null) {
mEvent.invokeObserver(Arrays.asList(var4.linkUri, mGeckoDataModel.mSessionID, var4.srcUri, title, var4.altText, mGeckoSession, mContext.get()), M_LONG_PRESS_WITH_LINK);
mEvent.invokeObserver(Arrays.asList(var4.linkUri, mGeckoDataModel.mSessionID, var4.srcUri, title, mGeckoDataModel.mTheme, var4.altText, mGeckoSession, mContext.get()), M_LONG_PRESS_WITH_LINK);
} else {
try {
String mTitle = var4.title;
if (mTitle == null || mTitle.length() <= 0) {
mTitle = helperMethod.getDomainName(mGeckoDataModel.mCurrentURL) + "\n" + var4.srcUri;
}
mEvent.invokeObserver(Arrays.asList(var4.srcUri, mGeckoDataModel.mSessionID, mTitle, mGeckoSession, mContext.get()), homeEnums.eGeckoCallback.ON_LONG_PRESS);
mEvent.invokeObserver(Arrays.asList(var4.srcUri, mGeckoDataModel.mSessionID, mTitle, mGeckoDataModel.mTheme, mGeckoSession, mContext.get()), homeEnums.eGeckoCallback.ON_LONG_PRESS);
} catch (Exception ex) {
ex.printStackTrace();
Log.i("", "");
}
}
} else if (var4.linkUri != null) {
mEvent.invokeObserver(Arrays.asList(var4.linkUri, mGeckoDataModel.mSessionID, title, mGeckoSession, mContext.get()), M_LONG_PRESS_URL);
mEvent.invokeObserver(Arrays.asList(var4.linkUri, mGeckoDataModel.mSessionID, title, mGeckoDataModel.mTheme, mGeckoSession, mContext.get()), M_LONG_PRESS_URL);
}
}
@ -109,29 +109,28 @@ public class contentDelegate implements GeckoSession.ContentDelegate {
@UiThread
public void onFirstContentfulPaint(@NonNull GeckoSession var1) {
if (!mGeckoDataModel.mCurrentURL.equals("about:blank")) {
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID), homeEnums.eGeckoCallback.ON_LOAD_REQUEST);
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mTheme), homeEnums.eGeckoCallback.ON_UPDATE_THEME);
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID, mGeckoDataModel.mTheme), homeEnums.eGeckoCallback.ON_LOAD_REQUEST);
}
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle), homeEnums.eGeckoCallback.ON_EXPAND_TOP_BAR);
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL,mGeckoDataModel.mSessionID,null, mGeckoDataModel.mCurrentURL_ID, null), homeEnums.eGeckoCallback.M_INDEX_WEBSITE);
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mTheme), homeEnums.eGeckoCallback.ON_EXPAND_TOP_BAR);
}
@UiThread
public void onWebAppManifest(@NonNull GeckoSession var1, @NonNull JSONObject var2) {
try {
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL,mGeckoDataModel.mSessionID,mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID, var2.getString("theme_color")), homeEnums.eGeckoCallback.M_INDEX_WEBSITE);
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL,mGeckoDataModel.mSessionID,null, mGeckoDataModel.mCurrentURL_ID, var2.getString("theme_color")), homeEnums.eGeckoCallback.M_INDEX_WEBSITE);
mGeckoDataModel.mTheme = var2.getString("theme_color");
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mTheme), homeEnums.eGeckoCallback.ON_UPDATE_THEME);
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL,mGeckoDataModel.mSessionID,mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID, mGeckoDataModel.mTheme), homeEnums.eGeckoCallback.M_INDEX_WEBSITE);
} catch (Exception ex) {
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle), homeEnums.eGeckoCallback.ON_UPDATE_THEME);
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL,mGeckoDataModel.mSessionID,null, mGeckoDataModel.mCurrentURL_ID, null), homeEnums.eGeckoCallback.M_INDEX_WEBSITE);
ex.printStackTrace();
}
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID), homeEnums.eGeckoCallback.ON_UPDATE_TAB_TITLE);
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID, mGeckoDataModel.mTheme), homeEnums.eGeckoCallback.ON_UPDATE_TAB_TITLE);
}
@UiThread
public void onCrash(@NonNull GeckoSession session) {
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID, mGeckoSession), homeEnums.eGeckoCallback.ON_DESTROY_MEDIA);
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID, mGeckoDataModel.mTheme, mGeckoSession), homeEnums.eGeckoCallback.ON_DESTROY_MEDIA);
if (!mClosed && status.sSettingIsAppStarted) {
if (mEvent == null) {
@ -147,7 +146,7 @@ public class contentDelegate implements GeckoSession.ContentDelegate {
final Handler handler = new Handler();
handler.postDelayed(() -> {
try {
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID, this), homeEnums.eGeckoCallback.M_OPEN_SESSION);
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID, mGeckoDataModel.mTheme, this), homeEnums.eGeckoCallback.M_OPEN_SESSION);
} catch (Exception ignored) {
}
}, mCrashCount * 500L);
@ -159,7 +158,7 @@ public class contentDelegate implements GeckoSession.ContentDelegate {
@UiThread
public void onKill(@NonNull GeckoSession session) {
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID, mGeckoSession), homeEnums.eGeckoCallback.ON_DESTROY_MEDIA);
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID, mGeckoDataModel.mTheme, mGeckoSession), homeEnums.eGeckoCallback.ON_DESTROY_MEDIA);
if (!mClosed && status.sSettingIsAppStarted) {
if (mEvent == null) {
@ -178,7 +177,7 @@ public class contentDelegate implements GeckoSession.ContentDelegate {
handler.postDelayed(() -> {
if (status.sSettingIsAppStarted && !session.isOpen()) {
try {
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID, this), homeEnums.eGeckoCallback.M_OPEN_SESSION);
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID, mGeckoDataModel.mTheme, this), homeEnums.eGeckoCallback.M_OPEN_SESSION);
} catch (Exception ignored) {
}
}
@ -192,7 +191,7 @@ public class contentDelegate implements GeckoSession.ContentDelegate {
@UiThread
public void onCloseRequest(@NonNull final GeckoSession session) {
mClosed = true;
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID, this), homeEnums.eGeckoCallback.ON_DESTROY_MEDIA);
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID, mGeckoDataModel.mTheme, this), homeEnums.eGeckoCallback.ON_DESTROY_MEDIA);
mGeckoDataModel.mSessionID = "-1";
}

View File

@ -36,6 +36,9 @@ public class historyDelegate implements GeckoSession.HistoryDelegate {
@UiThread
public void onHistoryStateChange(@NonNull GeckoSession var1, @NonNull GeckoSession.HistoryDelegate.HistoryList var2) {
if(mHistory==null || mHistory.size()!=var2.size()){
mGeckoDataModel.mTheme = null;
}
mHistory = var2;
if(mHistory !=null){
setURL(mHistory.get(mHistory.getCurrentIndex()).getUri());
@ -43,7 +46,6 @@ public class historyDelegate implements GeckoSession.HistoryDelegate {
if(mCurrentIndex != var2.getCurrentIndex()){
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mHistory.get(mHistory.getCurrentIndex()).getTitle(), mGeckoDataModel.mCurrentURL_ID, mGeckoDataModel.mTheme, mGeckoSession), homeEnums.eGeckoCallback.ON_UPDATE_SEARCH_BAR);
}
Object mID = mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mHistory.get(mHistory.getCurrentIndex()).getTitle(), -1, mGeckoDataModel.mTheme, mGeckoSession, false), homeEnums.eGeckoCallback.ON_UPDATE_HISTORY);
if (mID != null) {
mGeckoDataModel.mCurrentURL_ID = (int) mID;

View File

@ -21,6 +21,7 @@ public class mediaSessionDelegate implements MediaSession.Delegate{
private mediaDelegate mMediaDelegate;
private WeakReference<AppCompatActivity> mContext;
private geckoDataModel mGeckoDataModel;
private boolean mIsRunning = false;
private Bitmap mMediaImage;
private String mMediaTitle = GENERIC_EMPTY_STR;
@ -38,6 +39,7 @@ public class mediaSessionDelegate implements MediaSession.Delegate{
@Override
public void onActivated(@NonNull GeckoSession session, @NonNull MediaSession mediaSession) {
MediaSession.Delegate.super.onActivated(session, mediaSession);
mIsRunning = true;
mMediaSession = mediaSession;
}
@ -49,7 +51,6 @@ public class mediaSessionDelegate implements MediaSession.Delegate{
@Override
public void onMetadata(@NonNull GeckoSession session, @NonNull MediaSession mediaSession, @NonNull MediaSession.Metadata meta) {
try {
mMediaTitle = meta.title;
mMediaImage = meta.artwork.getBitmap(250).poll(2500);
@ -103,8 +104,10 @@ public class mediaSessionDelegate implements MediaSession.Delegate{
mMediaSession.play();
}
else if(pCommands.equals(enums.MediaController.PAUSE)){
mMediaDelegate.showNotification(this.mContext.get(), mMediaTitle, helperMethod.getHost(mGeckoDataModel.mCurrentURL), mMediaImage, false);
mMediaSession.pause();
if(mIsRunning){
mMediaDelegate.showNotification(this.mContext.get(), mMediaTitle, helperMethod.getHost(mGeckoDataModel.mCurrentURL), mMediaImage, false);
}
}
else if(pCommands.equals(enums.MediaController.STOP)){
mMediaSession.stop();
@ -112,6 +115,7 @@ public class mediaSessionDelegate implements MediaSession.Delegate{
else if(pCommands.equals(enums.MediaController.DESTROY)){
mMediaSession.stop();
mMediaDelegate.onHideDefaultNotification();
mIsRunning = false;
}
else if(pCommands.equals(enums.MediaController.SKIP_BACKWARD)){
mMediaSession.previousTrack();

View File

@ -112,7 +112,7 @@ public class navigationDelegate implements GeckoSession.NavigationDelegate {
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, false), homeEnums.eGeckoCallback.M_LOAD_HOMEPAGE_GENESIS);
return GeckoResult.fromValue(AllowOrDeny.DENY);
} else if (var1.target == 2) {
mEvent.invokeObserver(Arrays.asList(m_url, mGeckoDataModel.mSessionID), homeEnums.eGeckoCallback.open_new_tab);
mEvent.invokeObserver(Arrays.asList(m_url, mGeckoDataModel.mSessionID), homeEnums.eGeckoCallback.OPEN_NEW_TAB);
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mTheme), homeEnums.eGeckoCallback.ON_EXPAND_TOP_BAR);
return GeckoResult.fromValue(AllowOrDeny.DENY);
} else if (!m_url.equals("about:blank")) {
@ -154,6 +154,7 @@ public class navigationDelegate implements GeckoSession.NavigationDelegate {
if (status.sSettingIsAppStarted && orbotLocalConstants.mIsTorInitialized) {
errorHandler handler = new errorHandler();
mEvent.invokeObserver(Arrays.asList(var2, mGeckoDataModel.mSessionID), homeEnums.eGeckoCallback.ON_LOAD_ERROR);
mGeckoDataModel.mTheme = null;
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mTheme), homeEnums.eGeckoCallback.ON_UPDATE_THEME);
InputStream mResourceURL = null;

View File

@ -2,7 +2,6 @@ package com.hiddenservices.onionservices.appManager.homeManager.geckoManager.del
import static com.hiddenservices.onionservices.pluginManager.pluginEnums.eMessageManagerCallbacks.M_RATE_APPLICATION;
import android.os.Handler;
import androidx.annotation.NonNull;
import androidx.annotation.UiThread;
import androidx.appcompat.app.AppCompatActivity;
@ -69,7 +68,8 @@ public class progressDelegate implements GeckoSession.ProgressDelegate {
@Override
public void onPageStart(@NonNull GeckoSession var1, @NonNull String var2) {
mEvent.invokeObserver(Arrays.asList(5, mGeckoDataModel.mSessionID), homeEnums.eGeckoCallback.PROGRESS_UPDATE_FORCED);
mEvent.invokeObserver(Arrays.asList(var2, mGeckoDataModel.mSessionID, var2, mGeckoDataModel.mCurrentURL_ID, mGeckoDataModel.mTheme, null), homeEnums.eGeckoCallback.ON_UPDATE_SEARCH_BAR);
if (mIsLoaded) {
if (!mGeckoDataModel.mCurrentURL.equals("about:config") && !var2.equals("about:blank") && helperMethod.getHost(var2).endsWith(".onion")) {
var2 = var2.replace("www.", "");
@ -85,7 +85,6 @@ public class progressDelegate implements GeckoSession.ProgressDelegate {
if (!mGeckoDataModel.mCurrentURL.equals("about:config") && !mGeckoDataModel.mCurrentURL.equals("about:blank") && !mGeckoDataModel.mCurrentTitle.equals("loading")) {
mProgress = 5;
mContext.get().runOnUiThread(() -> mEvent.invokeObserver(Arrays.asList(5, mGeckoDataModel.mSessionID), homeEnums.eGeckoCallback.PROGRESS_UPDATE));
mGeckoDataModel.mThemeChanged = false;
if(!var2.equals("about:blank")){
mEvent.invokeObserver(Arrays.asList(var2, mGeckoDataModel.mSessionID), homeEnums.eGeckoCallback.SEARCH_UPDATE);
}
@ -98,18 +97,6 @@ public class progressDelegate implements GeckoSession.ProgressDelegate {
if (var2) {
if (mProgress >= 100) {
mEvent.invokeObserver(Arrays.asList(null, mGeckoDataModel.mSessionID), homeEnums.eGeckoCallback.ON_PAGE_LOADED);
if (!mGeckoDataModel.mThemeChanged) {
new Handler().postDelayed(() ->
{
if (!mGeckoDataModel.mThemeChanged) {
mGeckoDataModel.mTheme = null;
if (mEvent != null) {
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mTheme), homeEnums.eGeckoCallback.ON_UPDATE_THEME);
}
}
}, 500);
}
}
}
}

View File

@ -59,7 +59,10 @@ public class geckoClients {
if (pGeckoView.getSession() != null) {
pGeckoView.releaseSession();
}
mSession = initSettings(pGeckoView, pEvent, pContext);
this.mEvent = pEvent;
mSessionID = helperMethod.createRandomID();
mSession = initSettings(pGeckoView, pEvent, pContext, mSessionID);
initRuntimeSettings(pContext);
mSession.open(mRuntime);
pGeckoView.setSession(mSession);
@ -67,7 +70,8 @@ public class geckoClients {
}
public geckoSession initializeSessionInBackground(GeckoView pGeckoView, eventObserver.eventListener pEvent, AppCompatActivity pContext, String pURL) {
geckoSession mSessionHidden = initSettings(pGeckoView, pEvent, pContext);
geckoSession mSessionHidden = initSettings(pGeckoView, pEvent, pContext, helperMethod.createRandomID());
mSessionHidden.open(mRuntime);
mSessionHidden.loadUri(pURL);
pluginController.getInstance().onMessageManagerInvoke(Collections.singletonList(pContext), M_LOAD_NEW_TAB);
@ -75,16 +79,13 @@ public class geckoClients {
return mSessionHidden;
}
private geckoSession initSettings(GeckoView pGeckoView, eventObserver.eventListener pEvent, AppCompatActivity pContext){
this.mEvent = pEvent;
mSessionID = helperMethod.createRandomID();
mSession = new geckoSession(new geckoViewClientCallback(), mSessionID, pContext, pGeckoView);
mSession.getSettings().setUseTrackingProtection(status.sStatusDoNotTrack);
mSession.getSettings().setFullAccessibilityTree(true);
mSession.getSettings().setUserAgentMode(USER_AGENT_MODE_MOBILE);
mSession.getSettings().setAllowJavascript(status.sSettingJavaStatus);
return mSession;
private geckoSession initSettings(GeckoView pGeckoView, eventObserver.eventListener pEvent, AppCompatActivity pContext, String pSessionID){
geckoSession mSessionIbitializer = new geckoSession(new geckoViewClientCallback(), pSessionID, pContext, pGeckoView);
mSessionIbitializer.getSettings().setUseTrackingProtection(status.sStatusDoNotTrack);
mSessionIbitializer.getSettings().setFullAccessibilityTree(true);
mSessionIbitializer.getSettings().setUserAgentMode(USER_AGENT_MODE_MOBILE);
mSessionIbitializer.getSettings().setAllowJavascript(status.sSettingJavaStatus);
return mSessionIbitializer;
}
public void initializeIcon(Context pcontext) {
@ -132,7 +133,6 @@ public class geckoClients {
mSettings.configFilePath(helperMethod.getAssetsCacheFile(context, "geckoview-config.yaml"));
}
mSettings.build();
onClearAll();
mRuntime = GeckoRuntime.create(context, mSettings.build());
mRuntime.getSettings().setAboutConfigEnabled(true);
@ -149,6 +149,7 @@ public class geckoClients {
}
dataController.getInstance().initializeListData();
onClearAll();
}
initializeIcon(context);
}
@ -327,7 +328,6 @@ public class geckoClients {
mRuntime.getStorageController().clearData(SITE_DATA);
}
}
public void onClearSession() {
if (mRuntime != null) {
mRuntime.getStorageController().clearData(AUTH_SESSIONS);
@ -385,7 +385,9 @@ public class geckoClients {
}
public void onExitFullScreen() {
//mSession.exitScreen();
if(mSession!=null){
mSession.exitScreen();
}
}
public void onForwardPressed() {

View File

@ -123,7 +123,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.Progress
public void onClose() {
stop();
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID, this), homeEnums.eGeckoCallback.ON_DESTROY_MEDIA);
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID, mGeckoDataModel.mTheme, this), homeEnums.eGeckoCallback.ON_DESTROY_MEDIA);
}
public boolean onRestoreState() {
@ -178,17 +178,16 @@ public class geckoSession extends GeckoSession implements GeckoSession.Progress
}
public void goBackSession() {
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID, this), homeEnums.eGeckoCallback.ON_DESTROY_MEDIA);
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID, mGeckoDataModel.mTheme, this), homeEnums.eGeckoCallback.ON_DESTROY_MEDIA);
goBack();
}
public void goForwardSession() {
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID, this), homeEnums.eGeckoCallback.ON_DESTROY_MEDIA);
mEvent.invokeObserver(Arrays.asList(mGeckoDataModel.mCurrentURL, mGeckoDataModel.mSessionID, mGeckoDataModel.mCurrentTitle, mGeckoDataModel.mCurrentURL_ID, mGeckoDataModel.mTheme, this), homeEnums.eGeckoCallback.ON_DESTROY_MEDIA);
goForward();
}
/*Properties Getter Setter*/
public void setTheme(String pTheme) {
mGeckoDataModel.mTheme = pTheme;
}

View File

@ -265,6 +265,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
public void initTor() {
mHandler = new Handler();
try {
if(!status.mThemeApplying) {
Intent intent = new Intent(this, OrbotService.class);
@ -288,7 +289,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}, 500);
}else {
onHideDefaultNotification();
int notificationStatus = status.sBridgeNotificationManual;
int notificationStatus = status.sNotificaionStatus;
if (notificationStatus == 0) {
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_DISABLE_NOTIFICATION);
activityContextManager.getInstance().getHomeController().onShowDefaultNotification();
@ -769,7 +770,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
public void onLoadTabHidden(boolean isSessionClosed, boolean pExpandAppBar, boolean pForced, boolean pGeneratePixel) {
mHomeViewController.onNewTabAnimation(null, M_NEW_LINK_ANIMATION, 5000);
mHomeViewController.onNewTabAnimation(null, M_NEW_LINK_ANIMATION, 1000);
onLoadTab(mSessionNewTab, isSessionClosed, pExpandAppBar, pForced, pGeneratePixel);
}
@ -925,7 +926,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
NotificationManager manager = null;
public void showDefaultNotification(Context context, String title) {
if(!status.mThemeApplying && status.sTorBrowsing && status.sBridgeNotificationManual != 0 || !orbotLocalConstants.mAppStarted){
if(!status.mThemeApplying && status.sTorBrowsing && status.sNotificaionStatus != 0 || !orbotLocalConstants.mAppStarted || status.sNotificaionStatus == 0){
return;
}
@ -1458,18 +1459,20 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
public void onHomeButton(View view) {
if(mGeckoClient.getSession()!=null){
mGeckoClient.getSession().setTheme(null);
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getTheme(), true);
if(!status.sRestoreTabs){
int mCount = (int) dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_TOTAL_TAB, null);
}
if (status.sSettingDefaultSearchEngine.equals(constants.CONST_BACKEND_GENESIS_URL)) {
mHomeViewController.onNewTabAnimation(Collections.singletonList(helperMethod.getDomainName(mHomeModel.getSearchEngine())), homeEnums.eHomeViewCallback.M_HOME_BUTTON_PRESSED, 5000);
mHomeViewController.onNewTabAnimation(Collections.singletonList(helperMethod.getDomainName(mHomeModel.getSearchEngine())), homeEnums.eHomeViewCallback.M_HOME_BUTTON_PRESSED, 1000);
} else {
onLoadURL(helperMethod.getHost(status.sSettingDefaultSearchEngine));
}
mHomeViewController.onUpdateSearchBar(status.sSettingDefaultSearchEngine, false, false, false);
}
}
/*TAB CONTROLLER EVENTS*/
public void onMenuTrigger(View pView) {
@ -1525,15 +1528,16 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
public void postNewLinkTabAnimation(String url, boolean isRemovable) {
mHomeViewController.onNewTabAnimation(Collections.singletonList(helperMethod.getDomainName(mHomeModel.getSearchEngine())), null, 1000);
mGeckoView.releaseSession();
mHomeViewController.onProgressBarUpdate(5, true);
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_UPDATE_PIXEL, Arrays.asList(mGeckoClient.getSession().getSessionID(), mRenderedBitmap, null, mGeckoView, false));
mGeckoClient.initializeSession(mGeckoView, new geckoViewCallback(), this);
mGeckoClient.onSaveCurrentTab(true);
dataController.getInstance().invokeTab(dataEnums.eTabCommands.MOVE_TAB_TO_TOP, Collections.singletonList(mGeckoClient.getSession()));
initTabCountForced();
initializeGeckoView(true, true);
mHomeViewController.progressBarReset();
mHomeViewController.onUpdateSearchBar(url, false, true, false);
mGeckoClient.loadURL(url, mGeckoView, homeController.this);
mGeckoView.releaseSession();
mGeckoView.setSession(mGeckoClient.getSession());
if (isRemovable) {
mGeckoClient.setRemovableFromBackPressed(true);
}
@ -1564,8 +1568,9 @@ public class homeController extends AppCompatActivity implements ComponentCallba
initTabCount(homeEnums.eHomeViewCallback.M_NEW_LINK_IN_NEW_TAB, Collections.singletonList(url));
} else {
mHomeViewController.initTab((int) dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_TOTAL_TAB, null), false, null, null);
mHomeViewController.onNewTabAnimation(Collections.singletonList(url), homeEnums.eHomeViewCallback.M_NEW_LINK_IN_NEW_TAB_LOAD, 5000);
mHomeViewController.onNewTabAnimation(Collections.singletonList(url), homeEnums.eHomeViewCallback.M_NEW_LINK_IN_NEW_TAB_LOAD, 1000);
}
mGeckoView.destroyDrawingCache();
}
geckoSession mSessionNewTab = null;
@ -1578,6 +1583,8 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mHomeViewController.progressBarReset();
initTabCountForced();
mSessionNewTab.loadUri(url);
mAppBar.setTag(R.id.expandableBar, true);
}
@ -1608,14 +1615,10 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getTheme(), false);
}
mHomeViewController.onNewTabAnimation(Arrays.asList(isKeyboardOpenedTemp, isKeyboardOpened), homeEnums.eHomeViewCallback.M_INITIALIZE_TAB_SINGLE, 5000);
mHomeViewController.onNewTabAnimation(Arrays.asList(isKeyboardOpenedTemp, isKeyboardOpened), homeEnums.eHomeViewCallback.M_INITIALIZE_TAB_SINGLE, 1000);
}, 100);
}
public void onUpdateScreenPixel() {
}
public void onNewTabBackground(boolean isKeyboardOpenedTemp, boolean isKeyboardOpened) {
if (status.sSettingDefaultSearchEngine.startsWith("http://167.86.99.31") || !status.sOpenURLInNewTab || mGeckoClient.getSession().getCurrentURL().equals("about:blank") || mGeckoClient.getSession().getCurrentURL().contains("167.86.99.31") || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED_DARK) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)) {
mHomeViewController.updateBannerAdvertStatus(false, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
@ -1633,7 +1636,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getTheme(), true);
}
mHomeViewController.onNewTabAnimation(Arrays.asList(isKeyboardOpenedTemp, isKeyboardOpened), homeEnums.eHomeViewCallback.M_INITIALIZE_TAB_SINGLE, 5000);
mHomeViewController.onNewTabAnimation(Arrays.asList(isKeyboardOpenedTemp, isKeyboardOpened), homeEnums.eHomeViewCallback.M_INITIALIZE_TAB_SINGLE, 1000);
}
public String completeURL(String pURL) {
@ -1649,12 +1652,13 @@ public class homeController extends AppCompatActivity implements ComponentCallba
if (status.sSettingDefaultSearchEngine.startsWith("http://167.86.99.31") || !status.sOpenURLInNewTab || mGeckoClient.getSession().getCurrentURL().equals("about:blank") || mGeckoClient.getSession().getCurrentURL().contains("167.86.99.31") || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED_DARK) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)) {
mHomeViewController.updateBannerAdvertStatus(false, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
}
mHomeViewController.onNewTabAnimation(Collections.singletonList(url), homeEnums.eHomeViewCallback.M_INITIALIZE_TAB_LINK, 5000);
mHomeViewController.onNewTabAnimation(Collections.singletonList(url), homeEnums.eHomeViewCallback.M_INITIALIZE_TAB_LINK, 1000);
}, 100);
}
public void onOpenLinkNewTabLoaded(String url) {
mNewTab.setPressed(true);
mHomeViewController.onNewTabAnimation(Collections.singletonList(helperMethod.getDomainName(mHomeModel.getSearchEngine())), null, 1000);
final Handler handler = new Handler();
handler.postDelayed(() -> {
onGetThumbnail(null, false);
@ -1724,7 +1728,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
boolean mBookmarked = (boolean) dataController.getInstance().invokeBookmark(dataEnums.eBookmarkCommands.M_BOOKMARK_AVAILABLE, Collections.singletonList(url));
mHomeViewController.onOpenMenu(view, mGeckoClient.canGoForward(), !(mProgressBar.getAlpha() <= 0 || mProgressBar.getVisibility() == View.INVISIBLE), mGeckoClient.getUserAgent(), mGeckoClient.getSession().getCurrentURL(), mBookmarked);
mHomeViewController.onOpenMenu(view, mGeckoClient.canGoForward(), !(mProgressBar.getAlpha() <= 0 || mProgressBar.getVisibility() == View.INVISIBLE || mProgressBar.getVisibility() == View.GONE), mGeckoClient.getUserAgent(), mGeckoClient.getSession().getCurrentURL(), mBookmarked);
view.setClickable(false);
new Handler().postDelayed(() ->
@ -1747,8 +1751,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
@Override
public void onBackPressed() {
mSearchEngineBar.findViewById(R.id.pSearchEngineHintInvoke).setVisibility(View.GONE);
if (mTabFragment.getVisibility() == View.VISIBLE) {
if (activityContextManager.getInstance().getTabController().isSelectionOpened()) {
activityContextManager.getInstance().getTabController().onClearSelection(null);
@ -1896,6 +1898,9 @@ public class homeController extends AppCompatActivity implements ComponentCallba
@Override
public void onResume() {
if(status.sNotificaionStatus == 1){
onShowDefaultNotification();
}
orbotLocalConstants.mAppForceExit = false;
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
@ -2174,21 +2179,23 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
public void onStartApplication(View view) {
//status.sSettingDefaultSearchEngine = constants.CONST_BACKEND_DUCK_DUCK_GO_URL;
onStartBrowser();
//status.sSettingDefaultSearchEngine = constants.CONST_BACKEND_DUCK_DUCK_GO_URL;
int notificationStatus = status.sBridgeNotificationManual;
int notificationStatus = status.sNotificaionStatus;
if (notificationStatus == 0) {
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_DISABLE_NOTIFICATION);
activityContextManager.getInstance().getHomeController().onShowDefaultNotification();
} else {
new Handler().postDelayed(() ->
{
pluginController.getInstance().onOrbotInvoke(Arrays.asList(status.sBridgeCustomBridge, status.sBridgeGatewayManual, status.sBridgeCustomType, status.sBridgeStatus, status.sShowImages, status.sClearOnExit, dataController.getInstance().invokeBridges(dataEnums.eBridgeWebsiteCommands.M_FETCH, null)), pluginEnums.eOrbotManager.M_START_ORBOT);
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_ENABLE_NOTIFICATION);
}, 2000);
}
new Handler().postDelayed(() ->
{
pluginController.getInstance().onOrbotInvoke(Arrays.asList(status.sBridgeCustomBridge, status.sBridgeGatewayManual, status.sBridgeCustomType, status.sBridgeStatus, status.sShowImages, status.sClearOnExit, dataController.getInstance().invokeBridges(dataEnums.eBridgeWebsiteCommands.M_FETCH, null)), pluginEnums.eOrbotManager.M_START_ORBOT);
}, 2000);
}
public void onStartApplicationNoTor(View view) {
@ -2226,6 +2233,8 @@ public class homeController extends AppCompatActivity implements ComponentCallba
return mBannerAds;
}
public void onInvokeProxyLoading() {
Callable<String> callable = () -> {
@ -2593,7 +2602,9 @@ public class homeController extends AppCompatActivity implements ComponentCallba
activityContextManager.getInstance().getHomeController().onClearSession();
activityContextManager.getInstance().getHomeController().onClearCookies();
if(mGeckoClient.getSession()!=null){
onClearSettings();
}
status.initStatus(activityContextManager.getInstance().getHomeController(), false);
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_CLEAR_TAB, null);
pluginController.getInstance().onMessageManagerInvoke(Collections.singletonList(this), M_DATA_CLEARED);
@ -2666,6 +2677,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
if(e_type==null){
return null;
}
if (e_type.equals(homeEnums.eHomeViewCallback.M_INIT_TAB_COUNT_FORCED)) {
initTabCountForced();
}
@ -2711,6 +2723,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getTheme(), true);
}
} else if (e_type.equals(homeEnums.eHomeViewCallback.ON_UPDATE_THEME)) {
mHomeViewController.onResetTabAnimation();
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getTheme(), false);
} else if (e_type.equals(homeEnums.eHomeViewCallback.M_INITIALIZE_TAB_SINGLE)) {
initTabCount(homeEnums.eHomeViewCallback.ON_NEW_TAB_ANIMATION, data);
@ -2724,7 +2737,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
else if (e_type.equals(homeEnums.eHomeViewCallback.ON_INIT_ADS)) {
mHomeViewController.onSetBannerAdMargin((boolean) data.get(0), (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
} else if (e_type.equals(homeEnums.eHomeViewCallback.on_full_screen_ads)) {
} else if (e_type.equals(homeEnums.eHomeViewCallback.ON_FULL_SCREEN_ADS)) {
if((boolean)data.get(0)){
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_HIDE_BANNER);
}else {
@ -2768,7 +2781,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
};
handler.postDelayed(runnable, 2500);
}
} else if (e_type.equals(homeEnums.eHomeViewCallback.on_url_load)) {
} else if (e_type.equals(homeEnums.eHomeViewCallback.ON_URL_LOAD)) {
if (status.sSettingIsAppRedirected) {
mHomeViewController.onPageFinished();
//mGeckoClient.onRedrawPixel(homeController.this);
@ -2948,6 +2961,8 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mScrollHandler.postDelayed(mScrollRunnable, 450);
}
Handler mHandler = null;
public class geckoViewCallback implements eventObserver.eventListener {
@Override
@ -2974,8 +2989,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
} else if (e_type.equals(homeEnums.eGeckoCallback.M_LOAD_HOMEPAGE_GENESIS)) {
onLoadURL(helperMethod.getDomainName(constants.CONST_BACKEND_GENESIS_URL));
} else if (e_type.equals(homeEnums.eGeckoCallback.PROGRESS_UPDATE_FORCED)) {
Log.i("SUPPPP7:", (String) data.get(2));
mHomeViewController.onUpdateSearchBar((String) data.get(2), false, true, false);
mHomeViewController.onProgressBarUpdate((int) data.get(0), true);
} else if (e_type.equals(homeEnums.eGeckoCallback.ON_UPDATE_SEARCH_BAR)) {
mHomeViewController.onUpdateSearchBar((String) data.get(0), false, false, false);
@ -2990,9 +3003,13 @@ public class homeController extends AppCompatActivity implements ComponentCallba
} else if (e_type.equals(homeEnums.eGeckoCallback.M_CLOSE_TAB)) {
onCloseCurrentTab(mGeckoClient.getSession());
} else if (e_type.equals(homeEnums.eGeckoCallback.M_CLOSE_TAB_BACK)) {
mHomeViewController.onNewTabAnimation(Collections.singletonList(mGeckoClient.getSession()), homeEnums.eGeckoCallback.M_CLOSE_TAB_BACK, 250);
mHomeViewController.onNewTabAnimation(Collections.singletonList(mGeckoClient.getSession()), homeEnums.eGeckoCallback.M_CLOSE_TAB_BACK, 500);
} else if (e_type.equals(homeEnums.eGeckoCallback.ON_UPDATE_THEME)) {
mHomeViewController.onResetTabAnimation();
new Handler().postDelayed(() ->
{
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getTheme(), false);
}, 500);
} else if (e_type.equals(homeEnums.eGeckoCallback.START_PROXY)) {
pluginController.getInstance().onOrbotInvoke(data, pluginEnums.eOrbotManager.M_SET_PROXY);
} else if (e_type.equals(homeEnums.eGeckoCallback.ON_UPDATE_HISTORY)) {
@ -3037,7 +3054,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
pluginController.getInstance().onMessageManagerInvoke(data, M_LONG_PRESS_DOWNLOAD);
} else if (e_type.equals(M_LONG_PRESS_URL)) {
pluginController.getInstance().onMessageManagerInvoke(data, M_LONG_PRESS_URL);
} else if (e_type.equals(homeEnums.eGeckoCallback.open_new_tab)) {
} else if (e_type.equals(homeEnums.eGeckoCallback.OPEN_NEW_TAB)) {
initTabCount(OPEN_NEW_TAB, data);
} else if (e_type.equals(homeEnums.eGeckoCallback.ON_CLOSE_SESSION)) {
if (!onCloseCurrentTab(mGeckoClient.getSession())) {
@ -3078,12 +3095,11 @@ public class homeController extends AppCompatActivity implements ComponentCallba
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_INT, Arrays.asList(keys.SETTING_RATE_COUNT, status.sGlobalURLCount));
} else if (e_type.equals(homeEnums.eGeckoCallback.M_ORBOT_LOADING)) {
pluginController.getInstance().onMessageManagerInvoke(Collections.singletonList(homeController.this), M_ORBOT_LOADING);
} else if (e_type.equals(homeEnums.eGeckoCallback.M_DEFAULT_BROWSER)) {
//if (helperMethod.isDefaultBrowserSet(homeController.this)) {
}
else if (e_type.equals(homeEnums.eGeckoCallback.M_DEFAULT_BROWSER)) {
runOnUiThread(() -> {
pluginController.getInstance().onMessageManagerInvoke(Collections.singletonList(homeController.this), M_DEFAULT_BROWSER);
});
//}
} else if (e_type.equals(homeEnums.eGeckoCallback.M_NEW_IDENTITY)) {
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_NEW_CIRCUIT);
} else if (e_type.equals(homeEnums.eGeckoCallback.M_NEW_IDENTITY_MESSAGED)) {

View File

@ -4,11 +4,11 @@ package com.hiddenservices.onionservices.appManager.homeManager.homeController;
public class homeEnums {
public enum eHomeViewCallback {
M_HOME_PAGE, M_INITIALIZE_TAB_LINK_OPEN, OPEN_NEW_TAB_INSTANT, ON_LOAD_TAB_ON_RESUME, ON_LOAD_ADVERT, on_url_load, M_WELCOME_MESSAGE, M_SPLASH_DISABLE, M_GET_CURRENT_URL, M_ON_BANNER_UPDATE, on_full_screen_ads, M_INITIALIZE_TAB_LINK, M_HOME_BUTTON_PRESSED, M_INITIALIZE_TAB_SINGLE, ON_UPDATE_THEME, M_UPDATE_THEME, OPEN_DOWNLOAD_FOLDER, ON_OPEN_TAB_VIEW, ON_NEW_TAB_ANIMATION, M_UPDATE_PIXEL_BACKGROUND, M_CACHE_UPDATE_TAB, OPEN_NEW_TAB, M_RESET_SUGGESTION, M_NEW_LINK_IN_NEW_TAB_LOAD, M_NEW_LINK_IN_NEW_TAB, M_NEW_LINK_ANIMATION, M_ADVERT_LOADED, M_CLOSE_TAB_BACK, M_INIT_TOR, M_GET_SSL_STATUS, M_INIT_TAB_COUNT_FORCED, PROGRESS_UPDATE, ON_INIT_ADS, M_PRELOAD_URL
M_HOME_PAGE, M_INITIALIZE_TAB_LINK_OPEN, OPEN_NEW_TAB_INSTANT, ON_LOAD_TAB_ON_RESUME, ON_LOAD_ADVERT, ON_URL_LOAD, M_WELCOME_MESSAGE, M_SPLASH_DISABLE, M_GET_CURRENT_URL, M_ON_BANNER_UPDATE, ON_FULL_SCREEN_ADS, M_INITIALIZE_TAB_LINK, M_HOME_BUTTON_PRESSED, M_INITIALIZE_TAB_SINGLE, ON_UPDATE_THEME, M_UPDATE_THEME, OPEN_DOWNLOAD_FOLDER, ON_OPEN_TAB_VIEW, ON_NEW_TAB_ANIMATION, M_UPDATE_PIXEL_BACKGROUND, M_CACHE_UPDATE_TAB, OPEN_NEW_TAB, M_RESET_SUGGESTION, M_NEW_LINK_IN_NEW_TAB_LOAD, M_NEW_LINK_IN_NEW_TAB, M_NEW_LINK_ANIMATION, M_ADVERT_LOADED, M_CLOSE_TAB_BACK, M_INIT_TOR, M_GET_SSL_STATUS, M_INIT_TAB_COUNT_FORCED, M_FLUSH_DRAWABLE, PROGRESS_UPDATE, ON_INIT_ADS, M_PRELOAD_URL
}
public enum eGeckoCallback {
ON_FETCH_FAVICON, M_RELOAD,open_new_tab, M_DEFAULT_BROWSER, M_RATE_COUNT, M_INDEX_WEBSITE, ON_DESTROY_MEDIA, ON_HANDLE_EXTERNAL_INTENT, SESSION_ID, ON_LOAD_REQUEST, M_NEW_IDENTITY_MESSAGED, ON_UPDATE_SUGGESTION, M_NEW_IDENTITY, M_ORBOT_LOADING, M_UPDATE_PIXEL_BACKGROUND, M_OPEN_SESSION, M_ON_MAIL, FINDER_RESULT_CALLBACK, M_UPDATE_SESSION_STATE, ON_UPDATE_TAB_TITLE, ON_PLAYSTORE_LOAD, ON_CLOSE_SESSION, ON_LONG_PRESS, ON_UPDATE_FAVICON, ON_FULL_SCREEN, DOWNLOAD_FILE_POPUP, SEARCH_UPDATE, ON_LOAD_ERROR, ON_PAGE_LOADED, ON_UPDATE_HISTORY, START_PROXY, ON_UPDATE_THEME, M_CLOSE_TAB, BACK_LIST_EMPTY, ON_URL_LOAD, ON_SESSION_REINIT, ON_INVOKE_PARSER, ON_FIRST_PAINT, ON_UPDATE_SEARCH_BAR, PROGRESS_UPDATE_FORCED, M_LOAD_HOMEPAGE_GENESIS, PROGRESS_UPDATE, M_ON_BANNER_UPDATE, ON_EXPAND_TOP_BAR, M_ON_SCROLL_NO_BOUNDARIES, M_ON_SCROLL_TOP_BOUNDARIES, M_ON_SCROLL_BOUNDARIES, M_CLOSE_TAB_BACK, M_CHANGE_HOME_THEME, ON_UPDATE_SUGGESTION_URL, ON_REQUEST_COMPLETED, GECKO_SCROLL_DOWN, GECKO_SCROLL_UP_MOVE, WAS_SCROLL_CHANGED, GECKO_SCROLL_DOWN_MOVE, GECKO_SCROLL_UP_ALWAYS
ON_FETCH_FAVICON, M_RELOAD, OPEN_NEW_TAB, M_DEFAULT_BROWSER, M_RATE_COUNT, M_INDEX_WEBSITE, ON_DESTROY_MEDIA, ON_HANDLE_EXTERNAL_INTENT, SESSION_ID, ON_LOAD_REQUEST, M_NEW_IDENTITY_MESSAGED, ON_UPDATE_SUGGESTION, M_NEW_IDENTITY, M_ORBOT_LOADING, M_UPDATE_PIXEL_BACKGROUND, M_OPEN_SESSION, M_ON_MAIL, FINDER_RESULT_CALLBACK, M_UPDATE_SESSION_STATE, ON_UPDATE_TAB_TITLE, ON_PLAYSTORE_LOAD, ON_CLOSE_SESSION, ON_LONG_PRESS, ON_UPDATE_FAVICON, ON_FULL_SCREEN, DOWNLOAD_FILE_POPUP, SEARCH_UPDATE, ON_LOAD_ERROR, ON_PAGE_LOADED, ON_UPDATE_HISTORY, START_PROXY, ON_UPDATE_THEME, M_CLOSE_TAB, BACK_LIST_EMPTY, ON_URL_LOAD, ON_SESSION_REINIT, ON_INVOKE_PARSER, ON_FIRST_PAINT, ON_UPDATE_SEARCH_BAR, PROGRESS_UPDATE_FORCED, M_LOAD_HOMEPAGE_GENESIS, PROGRESS_UPDATE, M_ON_BANNER_UPDATE, ON_EXPAND_TOP_BAR, M_ON_SCROLL_NO_BOUNDARIES, M_ON_SCROLL_TOP_BOUNDARIES, M_ON_SCROLL_BOUNDARIES, M_CLOSE_TAB_BACK, M_CHANGE_HOME_THEME, ON_UPDATE_SUGGESTION_URL, ON_REQUEST_COMPLETED, GECKO_SCROLL_DOWN, GECKO_SCROLL_UP_MOVE, WAS_SCROLL_CHANGED, GECKO_SCROLL_DOWN_MOVE, GECKO_SCROLL_UP_ALWAYS
}
public enum eHintCallback {

View File

@ -1,9 +1,11 @@
package com.hiddenservices.onionservices.appManager.homeManager.homeController;
import static com.hiddenservices.onionservices.constants.constants.CONST_PRIVACY_POLICY_URL_NON_TOR;
import static com.hiddenservices.onionservices.constants.constants.CONST_REPORT_URL;
import android.util.Patterns;
import com.hiddenservices.onionservices.constants.constants;
import com.hiddenservices.onionservices.constants.status;
import com.hiddenservices.onionservices.helperManager.helperMethod;
@ -16,6 +18,9 @@ public class homeModel {
}
public String urlComplete(String pURL, String pSearchEngine) {
if (!pURL.startsWith(CONST_REPORT_URL) && (pURL.startsWith("resource://android/assets/homepage/") || pURL.startsWith("http://167.86.99.31/?pG") || pURL.startsWith("https://167.86.99.31?pG") || pURL.endsWith("167.86.99.31") || pURL.endsWith(constants.CONST_GENESIS_DOMAIN_URL_SLASHED))) {
return pURL;
}
if (pURL.startsWith(CONST_PRIVACY_POLICY_URL_NON_TOR)) {
return CONST_PRIVACY_POLICY_URL_NON_TOR;
}

View File

@ -29,6 +29,8 @@ import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.Animation;
import android.view.animation.Transformation;
import android.view.inputmethod.InputMethodManager;
import android.widget.*;
import androidx.annotation.NonNull;
@ -41,6 +43,8 @@ import androidx.core.graphics.ColorUtils;
import androidx.core.widget.NestedScrollView;
import androidx.fragment.app.FragmentContainerView;
import androidx.recyclerview.widget.RecyclerView;
import com.hiddenservices.onionservices.BuildConfig;
import com.hiddenservices.onionservices.appManager.activityContextManager;
import com.hiddenservices.onionservices.appManager.editTextManager;
import com.hiddenservices.onionservices.constants.*;
@ -242,6 +246,8 @@ public class homeViewController {
mFindText.setLongClickable(false);
mFindText.setOnLongClickListener(v -> false);
String mText = "Copyright © by Orion Technologies | Build "+BuildConfig.VERSION_NAME.substring(20);
mCopyright.setText(mText);
}
@ -275,6 +281,7 @@ public class homeViewController {
String mText = getLocaleStringResource(new Locale(sSettingLanguage), R.string.GENERAL_SEARCH_ENGINE, mContext);
((TextView)mSearchEngineBar.findViewById(R.id.pSearchEngineHintInvoke)).setText(mText);
int e=0;
}
}
@ -624,12 +631,34 @@ public class homeViewController {
mOrbotLogManager.setEnabled(true);
}, 700);
if(status.sTorBrowsing){
mConnectButton.animate().setDuration(350).alpha(0.4f).withEndAction(() -> {
mCopyright.setVisibility(View.GONE);
initSplashLoading();
});
mConnectNoTorButton.animate().setDuration(350).alpha(0f).withEndAction(() -> {
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) mConnectButton.getLayoutParams();
final int bottomMarginStart = params.bottomMargin;
final int bottomMarginEnd = 0;
Animation a = new Animation() {
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) mConnectButton.getLayoutParams();
params.bottomMargin = bottomMarginStart + (int) ((bottomMarginEnd - bottomMarginStart) * interpolatedTime);
mConnectButton.setLayoutParams(params);
}
};
a.setDuration(400);
mConnectButton.startAnimation(a);
mConnectNoTorButton.animate().setDuration(150).alpha(0f).withEndAction(() -> {});
}else {
mConnectButton.animate().setDuration(350).alpha(0f).withEndAction(() -> {
mCopyright.setVisibility(View.GONE);
initSplashLoading();
});
mConnectNoTorButton.animate().setDuration(350).alpha(0.4f).withEndAction(() -> {});
}
mGatewaySplash.animate().setDuration(350).alpha(0.4f);
mPanicButtonLandscape.animate().setInterpolator(new AccelerateInterpolator()).setDuration(170).translationXBy(helperMethod.pxFromDp(55));
mPanicButton.animate().setDuration(170).setInterpolator(new AccelerateInterpolator()).translationXBy(helperMethod.pxFromDp(55));
@ -846,9 +875,11 @@ public class homeViewController {
@SuppressLint("InflateParams")
View popupView = null;
boolean mIsBookmarked = false;
void onOpenMenu(View view, boolean canGoForward, boolean isLoading, int userAgent, String mURL, boolean pIsBookmarked) {
mIsBookmarked = pIsBookmarked;
if (popupWindow != null) {
popupWindow.dismiss();
}
@ -964,14 +995,21 @@ public class homeViewController {
if (popupView != null) {
ImageButton mRefresh = popupView.findViewById(R.id.menu21);
ImageButton close = popupView.findViewById(R.id.menu20);
ImageButton bookmark = popupView.findViewById(R.id.menu23);
close.setVisibility(View.GONE);
mRefresh.setVisibility(View.VISIBLE);
mRefresh.animate().alpha(0.1f);
mRefresh.setAlpha(0.1f);
close.animate().alpha(0);
new Handler().postDelayed(() ->
{
if(!mIsBookmarked){
bookmark.setImageDrawable(helperMethod.getDrawableXML(mContext, R.xml.ic_baseline_bookmark));
bookmark.setColorFilter(ContextCompat.getColor(mContext, R.color.c_navigation_tint), android.graphics.PorterDuff.Mode.MULTIPLY);
bookmark.animate().alpha(1);
bookmark.setClickable(true);
}
mRefresh.animate().setDuration(250).alpha(1f);
}, 300);
}
}
@ -1419,7 +1457,7 @@ public class homeViewController {
return;
}
if (mSearchbar.getText().toString().equals("orion.onion")) {
if (mSearchbar.getText().toString().equals("orion.onion") && !mForced) {
return;
}
@ -1460,7 +1498,9 @@ public class homeViewController {
new Handler().postDelayed(() ->
{
if(e_type!=null && e_type.equals(homeEnums.eGeckoCallback.M_CLOSE_TAB_BACK)){
onResetTabAnimation();
}
}, pDelay);
mGeckoView.setPivotX(0);
@ -1480,7 +1520,7 @@ public class homeViewController {
final Handler handler = new Handler();
handler.postDelayed(() -> {
mEvent.invokeObserver(data, e_type);
}, 450);
}, 300);
scaleDown.addListener(new Animator.AnimatorListener() {
@Override
@ -1500,18 +1540,14 @@ public class homeViewController {
@Override
public void onAnimationEnd(Animator animation) {
//scaleDown.removeAllListeners();
//mEvent.invokeObserver(data, e_type);
}
@Override
public void onAnimationCancel(Animator animation) {
Log.i("","");
}
@Override
public void onAnimationRepeat(Animator animation) {
Log.i("","");
}
});
}else {
@ -1620,7 +1656,7 @@ public class homeViewController {
mDefaultColor = mContext.getWindow().getNavigationBarColor();
mContext.getWindow().setNavigationBarColor(Color.BLACK);
mEvent.invokeObserver(Collections.singletonList(true), homeEnums.eHomeViewCallback.on_full_screen_ads);
mEvent.invokeObserver(Collections.singletonList(true), homeEnums.eHomeViewCallback.ON_FULL_SCREEN_ADS);
new Handler().postDelayed(() ->
{
@ -1718,7 +1754,7 @@ public class homeViewController {
mProgressBar.setVisibility(View.VISIBLE);
mTopBar.setVisibility(View.VISIBLE);
mEvent.invokeObserver(Collections.singletonList(!isLandscape), homeEnums.eHomeViewCallback.ON_INIT_ADS);
mEvent.invokeObserver(Collections.singletonList(isLandscape), homeEnums.eHomeViewCallback.on_full_screen_ads);
mEvent.invokeObserver(Collections.singletonList(isLandscape), homeEnums.eHomeViewCallback.ON_FULL_SCREEN_ADS);
status.sFullScreenBrowsing = (boolean) dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_FULL_SCREEN_BROWSIING, false));
@ -1814,9 +1850,9 @@ public class homeViewController {
if (mEvent.invokeObserver(null, homeEnums.eHomeViewCallback.M_HOME_PAGE) == null) {
mEvent.invokeObserver(null, homeEnums.eHomeViewCallback.M_PRELOAD_URL);
if (status.sSettingRedirectStatus.equals(strings.GENERIC_EMPTY_STR)) {
mEvent.invokeObserver(Collections.singletonList(helperMethod.getDomainName(status.sSettingDefaultSearchEngine)), homeEnums.eHomeViewCallback.on_url_load);
mEvent.invokeObserver(Collections.singletonList(helperMethod.getDomainName(status.sSettingDefaultSearchEngine)), homeEnums.eHomeViewCallback.ON_URL_LOAD);
} else {
mEvent.invokeObserver(Collections.singletonList(helperMethod.getDomainName(status.sSettingRedirectStatus)), homeEnums.eHomeViewCallback.on_url_load);
mEvent.invokeObserver(Collections.singletonList(helperMethod.getDomainName(status.sSettingRedirectStatus)), homeEnums.eHomeViewCallback.ON_URL_LOAD);
}
}
if (!status.sExternalWebsite.equals(strings.GENERIC_EMPTY_STR)) {

View File

@ -138,7 +138,6 @@ public class languageController extends AppCompatActivity {
String mSystemLangugage = mSystemLocale.toString();
status.sSettingLanguage = CONST_LANGUAGE_DEFAULT_LANG;
status.sSettingLanguageRegion = CONST_LANGUAGE_DEFAULT_LANG;
Log.i("MFUCKER", mSystemLangugage);
if (!mSystemLangugage.equals("en_GB") && !mSystemLangugage.equals("cs_CZ") && !mSystemLangugage.equals("en_US") && !mSystemLangugage.equals("ur_PK") && !mSystemLangugage.equals("de_DE") && !mSystemLangugage.equals("ca_ES") && !mSystemLangugage.equals("zh_CN") && !mSystemLangugage.equals("ch_CZ") && !mSystemLangugage.equals("nl_NL") && !mSystemLangugage.equals("fr_FR") && !mSystemLangugage.equals("el_GR") && !mSystemLangugage.equals("hu_HU") && !mSystemLangugage.equals("in_ID") && !mSystemLangugage.equals("it_IT") && !mSystemLangugage.equals("ja_JP") && !mSystemLangugage.equals("ko_KR") && !mSystemLangugage.equals("pt_PT") && !mSystemLangugage.equals("ro_RO") && !mSystemLangugage.equals("ru_RU") && !mSystemLangugage.equals("th_TH") && !mSystemLangugage.equals("tr_TR") && !mSystemLangugage.equals("uk_UA") && !mSystemLangugage.equals("vi_VN")) {
mDefaultLanguageNotSupported = true;
}

View File

@ -216,7 +216,7 @@ public class settingGeneralController extends AppCompatActivity {
}
public void onSelectTheme(View view) {
if(status.sLowMemory != enums.MemoryStatus.CRITICAL_MEMORY){
if(status.sLowMemory == enums.MemoryStatus.CRITICAL_MEMORY){
pluginController.getInstance().onMessageManagerInvoke(Collections.singletonList(this), M_LOW_MEMORY);
return;
}

View File

@ -91,12 +91,13 @@ public class settingNotificationController extends AppCompatActivity {
activityContextManager.getInstance().setCurrentActivity(this);
super.onResume();
int notificationStatus = status.sBridgeNotificationManual;
int notificationStatus = status.sNotificaionStatus;
if (notificationStatus == 0) {
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_DISABLE_NOTIFICATION);
activityContextManager.getInstance().getHomeController().onShowDefaultNotification();
activityContextManager.getInstance().getHomeController().onHideDefaultNotification();
} else {
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_ENABLE_NOTIFICATION);
activityContextManager.getInstance().getHomeController().onShowDefaultNotification();
}
}
@ -133,6 +134,6 @@ public class settingNotificationController extends AppCompatActivity {
public void onSaveLocalNotificationSettings(View view) {
mSettingNotificationModel.onTrigger(settingNotificationEnums.eNotificationModel.M_UPDATE_LOCAL_NOTIFICATION, Collections.singletonList(!mNotificationManual.isChecked()));
mNotificationManual.toggle();
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_INT, Arrays.asList(keys.SETTING_NOTIFICATION_STATUS, status.sBridgeNotificationManual));
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_INT, Arrays.asList(keys.SETTING_NOTIFICATION_STATUS, status.sNotificaionStatus));
}
}

View File

@ -25,15 +25,16 @@ class settingNotificationModel {
private void updateLocalNotification(boolean pStatus) {
int mStatus = pStatus ? 1 : 0;
status.sBridgeNotificationManual = mStatus;
status.sNotificaionStatus = mStatus;
if (!pStatus) {
activityContextManager.getInstance().getHomeController().onShowDefaultNotification();
activityContextManager.getInstance().getHomeController().onHideDefaultNotification();
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_DISABLE_NOTIFICATION);
} else {
if(status.sTorBrowsing){
activityContextManager.getInstance().getHomeController().onHideDefaultNotification();
}
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_ENABLE_NOTIFICATION);
}else {
activityContextManager.getInstance().getHomeController().onShowDefaultNotification();
}
}
}

View File

@ -34,7 +34,7 @@ class settingNotificationViewController {
}
private void initViews() {
if (status.sBridgeNotificationManual == 1) {
if (status.sNotificaionStatus == 1) {
mNotificationManual.setChecked(true);
} else {
mNotificationManual.setChecked(false);

View File

@ -75,12 +75,13 @@ public class status {
public static boolean sVPNStatus = false;
public static boolean sBridgeStatus = false;
public static boolean sAppInstalled = false;
public static boolean sDefaultLanguageSet = false;
public static int sTheme = enums.Theme.THEME_DEFAULT;
public static int sSettingCookieStatus = ContentBlocking.AntiTracking.DEFAULT;
public static int sShowImages = -1;
public static int sWidgetResponse = enums.WidgetResponse.NONE;
public static int sBridgeNotificationManual = 0;
public static int sNotificaionStatus = 0;
public static int sSettingTrackingProtection = 0;
public static int sGlobalURLCount = 0;
@ -127,7 +128,7 @@ public class status {
status.sBridgeCustomBridge = (String) dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_STRING, Arrays.asList(keys.BRIDGE_CUSTOM_BRIDGE_1, strings.BRIDGE_CUSTOM_BRIDGE_OBFS4));
status.sBridgeCustomType = (String) dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_STRING, Arrays.asList(keys.BRIDGE_CUSTOM_TYPE, strings.GENERIC_EMPTY_SPACE));
status.sBridgesDefault = (String) dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_STRING, Arrays.asList(keys.BRIDGE_DEFAULT, strings.BRIDGES_DEFAULT));
status.sBridgeNotificationManual = (int) dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_INT, Arrays.asList(keys.SETTING_NOTIFICATION_STATUS, 1));
status.sNotificaionStatus = (int) dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_INT, Arrays.asList(keys.SETTING_NOTIFICATION_STATUS, 1));
status.sRestoreTabs = (boolean) dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_RESTORE_TAB, false));
status.sCharacterEncoding = (boolean) dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_CHARACTER_ENCODING, false));
status.sShowImages = (int) dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_INT, Arrays.asList(keys.SETTING_SHOW_IMAGES, 0));

View File

@ -67,7 +67,7 @@ public class langManager {
} else if (mSystemLangugage.equals("vi_VN") || mSystemLangugage.equals("cs_CZ")) {
mLanguage = new Locale("ch", "Cz");
} else {
mLanguage = new Locale(mSystemLocale.getLanguage(), mSystemLocale.getCountry());
mLanguage = new Locale(mSystemLocale.getCountry(), mSystemLocale.getCountry());
}
} else {
mLanguage = new Locale("en", "Us");

View File

@ -319,7 +319,7 @@
android:id="@+id/pInfoPortrait"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="visible"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
@ -581,7 +581,7 @@
android:id="@+id/pInfoLandscape"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
android:visibility="visible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
@ -592,6 +592,7 @@
android:layout_height="40dp"
android:layout_marginTop="20dp"
android:adjustViewBounds="true"
android:layoutDirection="ltr"
android:alpha="0.95"
android:background="@xml/hox_rounded_corner_splash_right"
android:contentDescription="@string/GENERAL_TODO"
@ -608,6 +609,7 @@
android:layout_height="40dp"
android:layout_marginTop="80dp"
android:adjustViewBounds="true"
android:layoutDirection="ltr"
android:alpha="0.95"
android:background="@xml/hox_rounded_corner_splash_right"
android:contentDescription="@string/GENERAL_TODO"
@ -624,6 +626,7 @@
android:layout_width="90dp"
android:layout_height="90dp"
android:layout_marginStart="7dp"
android:layoutDirection="ltr"
android:layout_marginTop="15dp"
android:contentDescription="@string/GENERAL_TODO"
android:rotationY="@integer/angle_rtl_180"
@ -642,6 +645,7 @@
android:gravity="start"
android:maxHeight="20dp"
android:paddingStart="5dp"
android:layoutDirection="ltr"
android:paddingEnd="15dp"
android:text="@string/HOME_DESCRIPTION_TEXT_7"
android:textAlignment="textStart"
@ -664,6 +668,7 @@
android:ellipsize="end"
android:gravity="start"
android:maxHeight="20dp"
android:layoutDirection="ltr"
android:paddingStart="5dp"
android:paddingEnd="15dp"
android:text="@string/HOME_DESCRIPTION_TEXT_8"
@ -686,6 +691,7 @@
android:layout_marginTop="5dp"
android:ellipsize="end"
android:gravity="start"
android:layoutDirection="ltr"
android:maxHeight="20dp"
android:paddingStart="5dp"
android:paddingEnd="15dp"
@ -703,28 +709,28 @@
</androidx.constraintlayout.widget.ConstraintLayout>
<Button
android:id="@+id/ConnectNoTor"
android:id="@+id/ConnectTor"
android:textSize="13sp"
android:layout_width="190dp"
android:layout_width="170dp"
android:layout_height="51dp"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:layout_marginStart="23dp"
android:layout_marginBottom="8dp"
android:layout_marginBottom="58dp"
android:textAlignment="textStart"
android:layoutDirection="ltr"
android:drawableStart="@drawable/ic_no_tor"
android:drawableStart="@drawable/ic_tor"
android:background="@xml/hox_rounded_corner_splash_no_ripple"
android:onClick="onStartApplicationNoTor"
android:text="@string/HOME_CONNECT_NO_TOR"
app:layout_constraintBottom_toTopOf="@+id/ConnectTor"
android:onClick="onStartApplication"
android:text="@string/HOME_CONNECT_TOR"
app:layout_constraintBottom_toBottomOf="@+id/ConnectNoTor"
app:layout_constraintStart_toStartOf="parent"
tools:ignore="RtlSymmetry" />
<Button
android:id="@+id/ConnectTor"
android:id="@+id/ConnectNoTor"
android:textSize="13sp"
android:layout_width="190dp"
android:layout_width="170dp"
android:layout_height="51dp"
android:paddingStart="10dp"
android:layoutDirection="ltr"
@ -733,9 +739,9 @@
android:textAlignment="textStart"
android:paddingEnd="10dp"
android:background="@xml/hox_rounded_corner_splash_no_ripple"
android:drawableStart="@drawable/ic_tor"
android:onClick="onStartApplication"
android:text="@string/HOME_CONNECT_TOR"
android:drawableStart="@drawable/ic_no_tor"
android:onClick="onStartApplicationNoTor"
android:text="@string/HOME_CONNECT_NO_TOR"
app:layout_constraintBottom_toTopOf="@+id/pCopyright"
app:layout_constraintStart_toStartOf="parent"
tools:ignore="RtlSymmetry" />

View File

@ -33,8 +33,8 @@
<string name="HOME_DESCRIPTION_TEXT_7">Secured by Tor Network</string>
<string name="HOME_DESCRIPTION_TEXT_8">Builtin Onion Search Engine</string>
<string name="HOME_DESCRIPTION_TEXT_9">No Record and Digital Fingerprinting</string>
<string name="HOME_CONNECT_NO_TOR">Normal Browsing</string>
<string name="HOME_CONNECT_TOR">Tor Browsing</string>
<string name="HOME_CONNECT_NO_TOR">Fast &amp; Secure</string>
<string name="HOME_CONNECT_TOR">Dark Web - VPN</string>
<!-- Default Notification -->
<string name="DEFAULT_NOTIFICATION_RESET" translatable="false">EXIT AND RESET</string>