diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml
deleted file mode 100644
index 131ce921..00000000
--- a/.idea/deploymentTargetDropDown.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.safedk/hashes.safedk b/.safedk/hashes.safedk
index b67c308b..6243fd68 100644
--- a/.safedk/hashes.safedk
+++ b/.safedk/hashes.safedk
@@ -1,3 +1,3 @@
-#Sat Feb 25 16:05:10 PKT 2023
+#Sun Feb 26 18:36:51 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=2083951825
+json=-1222968406
diff --git a/.safedk/plugin.properties b/.safedk/plugin.properties
index 3bf4d037..836c7aec 100644
--- a/.safedk/plugin.properties
+++ b/.safedk/plugin.properties
@@ -1,5 +1,5 @@
#
-#Sat Feb 25 16:05:10 PKT 2023
+#Sun Feb 26 18:36:51 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=
pCPe4EeU2ZQVwQPeHLgseRqHBX1V5pvo9Piuu4J809dRhadEgukXa1A8po_UeXu5hmPOTaP1v4QPaMKIEOhh50=hGlhanpemGqPOKKAgaXvhyxwZaG9uD68csy1OadWTNhEgKvBWR7-7KSpyFr6nfZ4KMOuBBV5J49s2LLSg-SVxg
sdk_analysis_plugin_version=4.8.5
diff --git a/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/geckoManager/delegateModel/contentDelegate.java b/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/geckoManager/delegateModel/contentDelegate.java
index a921cfb6..87a34200 100644
--- a/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/geckoManager/delegateModel/contentDelegate.java
+++ b/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/geckoManager/delegateModel/contentDelegate.java
@@ -3,6 +3,8 @@ package com.hiddenservices.onionservices.appManager.homeManager.geckoManager.del
import static com.hiddenservices.onionservices.pluginManager.pluginEnums.eMessageManager.M_LONG_PRESS_URL;
import static com.hiddenservices.onionservices.pluginManager.pluginEnums.eMessageManager.M_LONG_PRESS_WITH_LINK;
+
+import android.Manifest;
import android.content.ActivityNotFoundException;
import android.os.Handler;
import android.util.Log;
@@ -18,11 +20,18 @@ import com.hiddenservices.onionservices.constants.status;
import com.hiddenservices.onionservices.constants.strings;
import com.hiddenservices.onionservices.eventObserver;
import com.hiddenservices.onionservices.helperManager.helperMethod;
+import com.karumi.dexter.Dexter;
+import com.karumi.dexter.MultiplePermissionsReport;
+import com.karumi.dexter.PermissionToken;
+import com.karumi.dexter.listener.PermissionRequest;
+import com.karumi.dexter.listener.multi.MultiplePermissionsListener;
+
import org.json.JSONObject;
import org.mozilla.geckoview.GeckoSession;
import org.mozilla.geckoview.WebResponse;
import java.lang.ref.WeakReference;
import java.util.Arrays;
+import java.util.List;
public class contentDelegate implements GeckoSession.ContentDelegate {
@@ -94,16 +103,40 @@ public class contentDelegate implements GeckoSession.ContentDelegate {
@UiThread
@Override
public void onExternalResponse(@NonNull GeckoSession session, @NonNull WebResponse response) {
- try {
- if (response.headers.containsKey("Content-Disposition")) {
- mDownloadManager.downloadFile(response, mGeckoSession, mContext.get(), mEvent);
- } else if (response.headers.containsKey("Content-Type")) {
- mDownloadManager.downloadFile(response, mGeckoSession, mContext.get(), mEvent);
- }
- } catch (ActivityNotFoundException e) {
- mEvent.invokeObserver(Arrays.asList(response, mGeckoDataModel.mSessionID), homeEnums.eGeckoCallback.ON_HANDLE_EXTERNAL_INTENT);
- mGeckoSession.stop();
- }
+ Dexter.withContext(mContext.get())
+ .withPermissions(
+ Manifest.permission.CAMERA,
+ Manifest.permission.READ_CONTACTS,
+ Manifest.permission.MEDIA_CONTENT_CONTROL,
+ Manifest.permission.MANAGE_MEDIA,
+ Manifest.permission.ACCESS_MEDIA_LOCATION,
+ Manifest.permission.READ_MEDIA_AUDIO,
+ Manifest.permission.READ_MEDIA_VIDEO,
+ Manifest.permission.READ_MEDIA_IMAGES,
+ Manifest.permission.MANAGE_EXTERNAL_STORAGE,
+ Manifest.permission.READ_EXTERNAL_STORAGE,
+ Manifest.permission.WRITE_EXTERNAL_STORAGE,
+ Manifest.permission.RECORD_AUDIO
+ ).withListener(new MultiplePermissionsListener() {
+ @Override
+ public void onPermissionsChecked(MultiplePermissionsReport multiplePermissionsReport) {
+ try {
+ if (response.headers.containsKey("Content-Disposition")) {
+ mDownloadManager.downloadFile(response, mGeckoSession, mContext.get(), mEvent);
+ } else if (response.headers.containsKey("Content-Type")) {
+ mDownloadManager.downloadFile(response, mGeckoSession, mContext.get(), mEvent);
+ }
+ } catch (ActivityNotFoundException e) {
+ mEvent.invokeObserver(Arrays.asList(response, mGeckoDataModel.mSessionID), homeEnums.eGeckoCallback.ON_HANDLE_EXTERNAL_INTENT);
+ mGeckoSession.stop();
+ }
+ }
+
+ @Override
+ public void onPermissionRationaleShouldBeShown(List list, PermissionToken permissionToken) {
+
+ }
+ }).check();
}
@UiThread
diff --git a/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/geckoManager/delegateModel/mediaDelegate.java b/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/geckoManager/delegateModel/mediaDelegate.java
index e468d364..6f0078fb 100644
--- a/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/geckoManager/delegateModel/mediaDelegate.java
+++ b/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/geckoManager/delegateModel/mediaDelegate.java
@@ -42,7 +42,9 @@ public class mediaDelegate implements GeckoSession.MediaDelegate {
}
public void onHideDefaultNotification(){
- NotificationManagerCompat.from(mContext.get()).cancel(S_NOTIFICATION_ID);
+ if(!status.mThemeApplying){
+ NotificationManagerCompat.from(mContext.get()).cancel(S_NOTIFICATION_ID);
+ }
}
/*Triggers*/
diff --git a/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/geckoManager/delegateModel/navigationDelegate.java b/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/geckoManager/delegateModel/navigationDelegate.java
index 1fc23353..2c20d8cd 100644
--- a/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/geckoManager/delegateModel/navigationDelegate.java
+++ b/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/geckoManager/delegateModel/navigationDelegate.java
@@ -10,10 +10,12 @@ import static com.hiddenservices.onionservices.constants.constants.CONST_GENESIS
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import androidx.annotation.UiThread;
import androidx.appcompat.app.AppCompatActivity;
import com.hiddenservices.onionservices.appManager.homeManager.geckoManager.dataModel.geckoDataModel;
import com.hiddenservices.onionservices.appManager.homeManager.geckoManager.geckoSession;
import com.hiddenservices.onionservices.appManager.homeManager.geckoManager.helperClasses.errorHandler;
+import com.hiddenservices.onionservices.appManager.homeManager.geckoManager.helperClasses.intentHandler;
import com.hiddenservices.onionservices.appManager.homeManager.geckoManager.helperClasses.preferencesHandler;
import com.hiddenservices.onionservices.appManager.homeManager.homeController.homeEnums;
import com.hiddenservices.onionservices.constants.constants;
@@ -30,6 +32,7 @@ import org.torproject.android.service.wrapper.orbotLocalConstants;
import java.io.InputStream;
import java.lang.ref.WeakReference;
import java.util.Arrays;
+import java.util.List;
public class navigationDelegate implements GeckoSession.NavigationDelegate {
@@ -62,6 +65,12 @@ public class navigationDelegate implements GeckoSession.NavigationDelegate {
mCanGoForward = var2;
}
+ @UiThread
+ public void onLocationChange(@NonNull GeckoSession session, @Nullable String url, final @NonNull List perms) {
+ url = "";
+
+ }
+
private String setGenesisVerificationToken(String pString) {
try {
if (pString.contains("?")) {
@@ -84,6 +93,9 @@ public class navigationDelegate implements GeckoSession.NavigationDelegate {
}
String m_url = var1.uri;
+ if(m_url.startsWith("tel:")){
+ return GeckoResult.fromValue(AllowOrDeny.DENY);
+ }
if (helperMethod.getHost(m_url).endsWith(".onion")) {
m_url = m_url.replace("www.", "");
}
diff --git a/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/geckoManager/delegateModel/progressDelegate.java b/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/geckoManager/delegateModel/progressDelegate.java
index 290a7243..74532dbd 100644
--- a/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/geckoManager/delegateModel/progressDelegate.java
+++ b/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/geckoManager/delegateModel/progressDelegate.java
@@ -12,6 +12,9 @@ import com.hiddenservices.onionservices.constants.constants;
import com.hiddenservices.onionservices.constants.status;
import com.hiddenservices.onionservices.eventObserver;
import com.hiddenservices.onionservices.helperManager.helperMethod;
+
+import org.mozilla.geckoview.AllowOrDeny;
+import org.mozilla.geckoview.GeckoResult;
import org.mozilla.geckoview.GeckoSession;
import java.lang.ref.WeakReference;
import java.util.Arrays;
@@ -74,10 +77,15 @@ public class progressDelegate implements GeckoSession.ProgressDelegate {
@Override
public void onPageStart(@NonNull GeckoSession var1, @NonNull String var2) {
+ if(var2.startsWith("tel:")){
+ intentHandler.actionDial(var2, mContext);
+ return;
+ }
securityInfo = null;
mGeckoDataModel.mTheme = null;
mProgress = 5;
mEvent.invokeObserver(Arrays.asList(5, mGeckoDataModel.mSessionID), homeEnums.eGeckoCallback.PROGRESS_UPDATE);
+
if(var2.startsWith("jar:file")){
return;
}
@@ -152,6 +160,9 @@ public class progressDelegate implements GeckoSession.ProgressDelegate {
}
public boolean getSecurtityState(){
+ if(mGeckoDataModel.mCurrentURL.equals("about:blank") || mGeckoDataModel.mCurrentURL.startsWith("resource://android/assets/policy")){
+ return true;
+ }
if(securityInfo==null){
return false;
}else {
diff --git a/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/homeController/homeController.java b/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/homeController/homeController.java
index 8243d5e7..f6454c15 100644
--- a/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/homeController/homeController.java
+++ b/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/homeController/homeController.java
@@ -263,7 +263,9 @@ public class homeController extends AppCompatActivity implements ComponentCallba
status.sSettingIsAppRunning = true;
initPreFixes();
initBundle();
- initTor();
+ if(!status.mThemeApplying){
+ initTor();
+ }
onMemoryCalculate();
pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_INIT_ADS);
mHomeViewController.updateBannerAdvertStatus(true, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
@@ -301,14 +303,14 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
new Handler().postDelayed(() ->
{
- onShowDefaultNotification();
+ onShowDefaultNotification(true);
}, 500);
}else {
onHideDefaultNotification();
int notificationStatus = status.sNotificaionStatus;
if (notificationStatus == 0) {
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_DISABLE_NOTIFICATION);
- activityContextManager.getInstance().getHomeController().onShowDefaultNotification();
+ activityContextManager.getInstance().getHomeController().onShowDefaultNotification(true);
} else {
if(status.mThemeApplying){
new Handler().postDelayed(() ->
@@ -512,7 +514,11 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mHomeViewController.onUpdateSearchEngineBar(false, 150);
mSearchbar.clearFocus();
mHomeViewController.onClearSelections(true);
- mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(), false, false, true);
+ if(mProgressBar.getProgress()<=0 || mProgressBar.getProgress()>=100){
+ mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(), false, false, true);
+ }else {
+ mHomeViewController.triggerUpdateSearchBar(mPastURL, false, false, true);
+ }
}
return false;
});
@@ -620,7 +626,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
public void initPreFixes() {
try {
if(status.mThemeApplying){
- onShowDefaultNotification();
+ onShowDefaultNotification(true);
}else {
onHideDefaultNotification();
}
@@ -918,12 +924,14 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mGeckoClient.onMediaInvoke(enums.MediaController.SKIP_BACKWARD);
}
- public void onShowDefaultNotification(){
- showDefaultNotification(this, "Orion Browser");
+ public void onShowDefaultNotification(boolean pSticky){
+ showDefaultNotification(this, "Orion Browser", pSticky);
}
public void onHideDefaultNotification(){
- NotificationManagerCompat.from(this).cancelAll();
- NotificationManagerCompat.from(this).cancel(1025);
+ if(!status.mThemeApplying){
+ NotificationManagerCompat.from(this).cancelAll();
+ NotificationManagerCompat.from(this).cancel(1125);
+ }
}
public void resetAndRestart(){
@@ -953,20 +961,25 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
NotificationManager manager = null;
- public void showDefaultNotification(Context context, String title) {
+ public void showDefaultNotification(Context context, String title, boolean isSticky) {
if(!status.mThemeApplying && status.sTorBrowsing && status.sNotificaionStatus != 0 || !orbotLocalConstants.mAppStarted || status.sNotificaionStatus == 0){
return;
}
+ if(status.mThemeApplying){
+ return;
+ }
manager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
- pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_DISABLE_NOTIFICATION);
+ if(!status.mThemeApplying){
+ pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_DISABLE_NOTIFICATION);
+ }
PendingIntent action;
if (SDK_INT >= Build.VERSION_CODES.M) {
- action = PendingIntent.getActivity(context, 1025, new Intent(context, homeController.class), PendingIntent.FLAG_IMMUTABLE); // Flag indicating that if the described PendingIntent already exists, the current one should be canceled before generating a new one.
+ action = PendingIntent.getActivity(context, 1125, new Intent(context, homeController.class), PendingIntent.FLAG_IMMUTABLE); // Flag indicating that if the described PendingIntent already exists, the current one should be canceled before generating a new one.
}else {
- action = PendingIntent.getActivity(context, 1025, new Intent(context, homeController.class), 0); // Flag indicating that if the described PendingIntent already exists, the current one should be canceled before generating a new one.
+ action = PendingIntent.getActivity(context, 1125, new Intent(context, homeController.class), 0); // Flag indicating that if the described PendingIntent already exists, the current one should be canceled before generating a new one.
}
NotificationCompat.Builder builder = new NotificationCompat.Builder(this, "notify_001");
@@ -989,31 +1002,33 @@ public class homeController extends AppCompatActivity implements ComponentCallba
Intent intentActionOpen = new Intent(context,homeController.class);
intentActionOpen.putExtra("action","Open");
- PendingIntent pIntentOpen = helperMethod.onCreateActionIntent(context, defaultNotificationReciever.class, 1025, "media_play", 0);
+ PendingIntent pIntentOpen = helperMethod.onCreateActionIntent(context, defaultNotificationReciever.class, 1125, "media_play", 0);
builder.addAction(0, "ERASE AND RESET", pIntentOpen);
Intent intentActionClose = new Intent(context,homeController.class);
intentActionClose.putExtra("action","Exit");
- PendingIntent pIntentClose = helperMethod.onCreateActionIntent(context, defaultNotificationReciever.class, 1025, "media_pause", 1);
+ PendingIntent pIntentClose = helperMethod.onCreateActionIntent(context, defaultNotificationReciever.class, 1125, "media_pause", 1);
builder.addAction(0, "EXIT BROWSER", pIntentClose);
Notification notification = builder.build();
PendingIntent dummyIntent = null;
if (SDK_INT >= Build.VERSION_CODES.M) {
- PendingIntent.getActivity(context, 1025, new Intent(), PendingIntent.FLAG_IMMUTABLE);
+ PendingIntent.getActivity(context, 1125, new Intent(), PendingIntent.FLAG_IMMUTABLE);
}else {
- PendingIntent.getActivity(context, 1025, new Intent(), 0);
+ PendingIntent.getActivity(context, 1125, new Intent(), 0);
}
notification.fullScreenIntent = dummyIntent;
- if (SDK_INT >= Build.VERSION_CODES.TIRAMISU){
- notification.flags = Notification.FLAG_AUTO_CANCEL|Notification.FLAG_ONGOING_EVENT;
- }else {
- notification.flags |= Notification.FLAG_NO_CLEAR;
+ if(isSticky){
+ if (SDK_INT >= Build.VERSION_CODES.TIRAMISU){
+ notification.flags = Notification.FLAG_AUTO_CANCEL|Notification.FLAG_ONGOING_EVENT;
+ }else {
+ notification.flags |= Notification.FLAG_NO_CLEAR;
+ }
}
- int notificationCode = 1025;
+ int notificationCode = 1125;
manager.notify(notificationCode, notification);
}
@@ -1121,10 +1136,10 @@ public class homeController extends AppCompatActivity implements ComponentCallba
orbotLocalConstants.mAppForceExit = true;
if (!status.mThemeApplying) {
NotificationManagerCompat.from(this).cancel(1030);
- NotificationManagerCompat.from(this).cancel(1025);
+ NotificationManagerCompat.from(this).cancel(1125);
}
- if(manager!=null){
- manager.cancel(1025);
+ if(manager!=null && !status.mThemeApplying){
+ manager.cancel(1125);
}
if(mGeckoClient.getSession() !=null){
mGeckoClient.getSession().getMediaSessionDelegate().onTrigger(enums.MediaController.DESTROY);
@@ -1418,12 +1433,18 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mHomeViewController.onUpdateSearchEngineBar(false, 150);
}
mHomeViewController.initSearchBarFocus(false, isKeyboardOpened);
- mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(), false, true, false);
+ if(mProgressBar.getProgress()<=0 || mProgressBar.getProgress()>=100){
+ mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(), false, false, false);
+ }else {
+ mHomeViewController.triggerUpdateSearchBar(mPastURL, false, false, false);
+ }
helperMethod.hideKeyboard(homeController.this);
}
}
mSearchbar.setSelection(0);
} else {
+ mPastURL = mSearchbar.getText().toString();
+
msearchstatuscopy = true;
mSearchBarWasBackButtonPressed = false;
if (!isFocusChanging) {
@@ -1451,6 +1472,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mSearchBarLoading = false;
}, 150);
};
+ String mPastURL = "";
public void onSearchBarInvoked(View view) {
String url;
@@ -1947,13 +1969,14 @@ public class homeController extends AppCompatActivity implements ComponentCallba
if (mGeckoClient.getSession() != null && mGeckoClient != null) {
mGeckoClient.onMediaInvoke(enums.MediaController.PAUSE);
}
-
+ onShowDefaultNotification(false);
+ orbotLocalConstants.mSoftNotification = true;
}
@Override
public void onResume() {
if(status.sNotificaionStatus == 1){
- onShowDefaultNotification();
+ onShowDefaultNotification(true);
}
orbotLocalConstants.mAppForceExit = false;
@@ -2030,6 +2053,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
status.mThemeApplying = false;
+ orbotLocalConstants.mSoftNotification = false;
super.onResume();
}
@@ -2260,7 +2284,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mHomeViewController.initHomePage();
}
onInvokeProxyLoading();
- onShowDefaultNotification();
+ onShowDefaultNotification(true);
}
public void onStartApplication(View view) {
@@ -2269,7 +2293,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
int notificationStatus = status.sNotificaionStatus;
if (notificationStatus == 0) {
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_DISABLE_NOTIFICATION);
- activityContextManager.getInstance().getHomeController().onShowDefaultNotification();
+ activityContextManager.getInstance().getHomeController().onShowDefaultNotification(true);
} else {
new Handler().postDelayed(() ->
{
@@ -3109,6 +3133,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
} else if (e_type.equals(homeEnums.eGeckoCallback.PROGRESS_UPDATE_FORCED)) {
//mHomeViewController.onProgressBarUpdate((int) data.get(0), true, isStaticURL());
} else if (e_type.equals(homeEnums.eGeckoCallback.ON_UPDATE_SEARCH_BAR)) {
+ mPastURL = (String) data.get(0);
mHomeViewController.onUpdateSearchBar((String) data.get(0), false, false, false);
} else if (e_type.equals(homeEnums.eGeckoCallback.ON_FIRST_PAINT)) {
mHomeViewController.onFirstPaint();
@@ -3165,9 +3190,11 @@ public class homeController extends AppCompatActivity implements ComponentCallba
pluginController.getInstance().onLanguageInvoke(Arrays.asList(homeController.this, status.sSettingLanguage, status.sSettingLanguageRegion, status.mThemeApplying), pluginEnums.eLangManager.M_SET_LANGUAGE);
initLocalLanguage();
mHomeViewController.onPageFinished();
- mHomeViewController.onUpdateSearchBar(dataToStr(data.get(0), mGeckoClient.getSession().getCurrentURL()), false, true, false);
+ mPastURL = (String) data.get(0);
+ mHomeViewController.onUpdateSearchBar(dataToStr(data.get(0), mGeckoClient.getSession().getCurrentURL()), false, false, false);
} else if (e_type.equals(homeEnums.eGeckoCallback.SEARCH_UPDATE)) {
- mHomeViewController.onUpdateSearchBar(dataToStr(data.get(0), mGeckoClient.getSession().getCurrentURL()), false, true, false);
+ mPastURL = (String) data.get(0);
+ mHomeViewController.onUpdateSearchBar(dataToStr(data.get(0), mGeckoClient.getSession().getCurrentURL()), false, false, false);
} else if (e_type.equals(homeEnums.eGeckoCallback.DOWNLOAD_FILE_POPUP)) {
List