Bug fixes

Bug fixes
master
Abdul Mannan Saeed 2023-02-04 14:46:32 +05:00
parent b85ee0beb1
commit a5c0306636
28 changed files with 621 additions and 273 deletions

View File

@ -1,3 +1,3 @@
#Sat Jan 28 15:55:26 PKT 2023 #Sat Feb 04 14:33:30 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= \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\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=-1628746731 json=2027486056

View File

@ -1,5 +1,5 @@
# #
#Sat Jan 28 16:12:03 PKT 2023 #Sat Feb 04 14:33:30 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\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\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.3 sdk_analysis_plugin_version=4.8.3
set_multidex=true set_multidex=true

View File

@ -0,0 +1 @@
o/jetified-OrbotLib-runtime

View File

@ -87,7 +87,7 @@ dependencies {
/* Android Support Repository Dependencies */ /* Android Support Repository Dependencies */
implementation 'com.google.android.material:material:1.7.0' implementation 'com.google.android.material:material:1.8.0'
implementation 'org.apache.commons:commons-text:1.3' implementation 'org.apache.commons:commons-text:1.3'
/* Firefox ABI Splits */ /* Firefox ABI Splits */
@ -104,7 +104,7 @@ dependencies {
/* Ads Manager */ /* Ads Manager */
implementation 'com.applovin:applovin-sdk:11.5.5' implementation 'com.applovin:applovin-sdk:11.7.0'
implementation 'com.facebook.android:audience-network-sdk:6.10.0' implementation 'com.facebook.android:audience-network-sdk:6.10.0'
implementation 'com.applovin.mediation:facebook-adapter:6.12.0.1' implementation 'com.applovin.mediation:facebook-adapter:6.12.0.1'

View File

@ -150,7 +150,7 @@
android:exported="true" android:exported="true"
android:launchMode="singleTask" android:launchMode="singleTask"
android:screenOrientation="fullSensor" android:screenOrientation="fullSensor"
android:windowSoftInputMode="adjustPan"> android:windowSoftInputMode="adjustNothing">
<meta-data <meta-data
android:name="android.app.shortcuts" android:name="android.app.shortcuts"
android:resource="@xml/shortcuts" /> android:resource="@xml/shortcuts" />

View File

@ -523,9 +523,7 @@ public class geckoClients {
public void onRedrawPixel(AppCompatActivity pcontext) { public void onRedrawPixel(AppCompatActivity pcontext) {
if(status.sLowMemory != enums.MemoryStatus.CRITICAL_MEMORY){ if(status.sLowMemory != enums.MemoryStatus.CRITICAL_MEMORY){
mSession.onRedrawPixel(); mSession.onRedrawPixel();
Log.i("FUCKSSS1111","333");
onLoadFavIcon(pcontext); onLoadFavIcon(pcontext);
Log.i("FUCKSSS1111","444");
} }
} }
@ -535,6 +533,7 @@ public class geckoClients {
public void onClearAll() { public void onClearAll() {
if (mRuntime != null) { if (mRuntime != null) {
if(status.sClearOnExit){
mRuntime.getStorageController().clearData(NETWORK_CACHE); mRuntime.getStorageController().clearData(NETWORK_CACHE);
mRuntime.getStorageController().clearData(IMAGE_CACHE); mRuntime.getStorageController().clearData(IMAGE_CACHE);
mRuntime.getStorageController().clearData(DOM_STORAGES); mRuntime.getStorageController().clearData(DOM_STORAGES);
@ -543,6 +542,7 @@ public class geckoClients {
mRuntime.getStorageController().clearData(SITE_DATA); mRuntime.getStorageController().clearData(SITE_DATA);
} }
} }
}
public void onClearSiteData() { public void onClearSiteData() {
if (mRuntime != null) { if (mRuntime != null) {
@ -697,7 +697,7 @@ public class geckoClients {
public void onUpdateFont() { public void onUpdateFont() {
float font = (status.sSettingFontSize - 100) / 3 + 100; float font = (status.sSettingFontSize - 100) / 3 + 100;
mRuntime.getSettings().setFontSizeFactor(font / 100); mRuntime.getSettings().setFontSizeFactor(font / 117);
} }
public void reinitHomeTheme() { public void reinitHomeTheme() {

View File

@ -210,7 +210,7 @@ final class geckoPromptView implements GeckoSession.PromptDelegate {
builder.setNegativeButton("Cancel", listener); builder.setNegativeButton("Cancel", listener);
try { try {
if(!((Activity) builder.getContext()).isFinishing()) if(mActivity!=null && !mActivity.isFinishing())
{ {
createStandardDialog(builder, prompt, res).show(); createStandardDialog(builder, prompt, res).show();
} }
@ -596,7 +596,7 @@ final class geckoPromptView implements GeckoSession.PromptDelegate {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
try { try {
if(!((Activity) builder.getContext()).isFinishing()) if(mActivity!=null && !mActivity.isFinishing())
{ {
dialog.show(); dialog.show();
} }

View File

@ -21,15 +21,12 @@ import android.os.Handler;
import android.util.Base64; import android.util.Base64;
import android.util.Log; import android.util.Log;
import android.view.autofill.AutofillManager; import android.view.autofill.AutofillManager;
import android.view.autofill.AutofillValue;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.UiThread; import androidx.annotation.UiThread;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.NotificationCompat; import androidx.core.app.NotificationCompat;
import androidx.core.content.FileProvider; import androidx.core.content.FileProvider;
import com.hiddenservices.onionservices.constants.constants; import com.hiddenservices.onionservices.constants.constants;
import com.hiddenservices.onionservices.constants.enums; import com.hiddenservices.onionservices.constants.enums;
import com.hiddenservices.onionservices.constants.status; import com.hiddenservices.onionservices.constants.status;
@ -41,37 +38,30 @@ import com.hiddenservices.onionservices.libs.trueTime.trueTimeEncryption;
import com.hiddenservices.onionservices.pluginManager.pluginController; import com.hiddenservices.onionservices.pluginManager.pluginController;
import com.hiddenservices.onionservices.pluginManager.pluginEnums; import com.hiddenservices.onionservices.pluginManager.pluginEnums;
import com.example.myapplication.R; import com.example.myapplication.R;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import org.mozilla.gecko.EventDispatcher; import org.mozilla.gecko.EventDispatcher;
import org.mozilla.gecko.util.GeckoBundle; import org.mozilla.gecko.util.GeckoBundle;
import org.mozilla.gecko.util.ThreadUtils;
import org.mozilla.geckoview.AllowOrDeny; import org.mozilla.geckoview.AllowOrDeny;
import org.mozilla.geckoview.Autofill; import org.mozilla.geckoview.Autofill;
import org.mozilla.geckoview.GeckoResult; import org.mozilla.geckoview.GeckoResult;
import org.mozilla.geckoview.GeckoSession; import org.mozilla.geckoview.GeckoSession;
import org.mozilla.geckoview.GeckoView; import org.mozilla.geckoview.GeckoView;
import org.mozilla.geckoview.Image;
import org.mozilla.geckoview.MediaSession; import org.mozilla.geckoview.MediaSession;
import org.mozilla.geckoview.SlowScriptResponse; import org.mozilla.geckoview.SlowScriptResponse;
import org.mozilla.geckoview.WebExtension; import org.mozilla.geckoview.WebExtension;
import org.mozilla.geckoview.WebRequestError; import org.mozilla.geckoview.WebRequestError;
import org.mozilla.geckoview.WebResponse; import org.mozilla.geckoview.WebResponse;
import org.torproject.android.service.wrapper.orbotLocalConstants; import org.torproject.android.service.wrapper.orbotLocalConstants;
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
import java.text.SimpleDateFormat;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import static com.hiddenservices.onionservices.constants.constants.CONST_GENESIS_BADCERT_CACHED; import static com.hiddenservices.onionservices.constants.constants.CONST_GENESIS_BADCERT_CACHED;
import static com.hiddenservices.onionservices.constants.constants.CONST_GENESIS_BADCERT_CACHED_DARK; import static com.hiddenservices.onionservices.constants.constants.CONST_GENESIS_BADCERT_CACHED_DARK;
import static com.hiddenservices.onionservices.constants.constants.CONST_GENESIS_ERROR_CACHED; import static com.hiddenservices.onionservices.constants.constants.CONST_GENESIS_ERROR_CACHED;
@ -84,12 +74,10 @@ import static com.hiddenservices.onionservices.constants.enums.etype.M_DEFAULT_B
import static com.hiddenservices.onionservices.constants.enums.etype.M_RATE_COUNT; import static com.hiddenservices.onionservices.constants.enums.etype.M_RATE_COUNT;
import static com.hiddenservices.onionservices.pluginManager.pluginEnums.eMessageManager.M_LONG_PRESS_URL; 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 static com.hiddenservices.onionservices.pluginManager.pluginEnums.eMessageManager.M_LONG_PRESS_WITH_LINK;
import static com.hiddenservices.onionservices.pluginManager.pluginEnums.eMessageManagerCallbacks.M_RATE_APPLICATION;
import static org.mozilla.geckoview.GeckoSessionSettings.USER_AGENT_MODE_DESKTOP; import static org.mozilla.geckoview.GeckoSessionSettings.USER_AGENT_MODE_DESKTOP;
import static org.mozilla.geckoview.GeckoSessionSettings.USER_AGENT_MODE_MOBILE; import static org.mozilla.geckoview.GeckoSessionSettings.USER_AGENT_MODE_MOBILE;
public class public class geckoSession extends GeckoSession implements MediaSession.Delegate, GeckoSession.MediaDelegate, GeckoSession.ScrollDelegate, GeckoSession.PermissionDelegate, GeckoSession.ProgressDelegate, GeckoSession.HistoryDelegate, GeckoSession.NavigationDelegate, GeckoSession.ContentDelegate {
geckoSession extends GeckoSession implements MediaSession.Delegate, GeckoSession.MediaDelegate, GeckoSession.ScrollDelegate, GeckoSession.PermissionDelegate, GeckoSession.ProgressDelegate, GeckoSession.HistoryDelegate, GeckoSession.NavigationDelegate, GeckoSession.ContentDelegate {
private eventObserver.eventListener event; private eventObserver.eventListener event;
private boolean wasBackPressed = false; private boolean wasBackPressed = false;
@ -118,7 +106,6 @@ geckoSession extends GeckoSession implements MediaSession.Delegate, GeckoSession
/*Temp Variables*/ /*Temp Variables*/
private GeckoSession.HistoryDelegate.HistoryList mHistoryList = null; private GeckoSession.HistoryDelegate.HistoryList mHistoryList = null;
private int rateCount = 0;
private int m_current_url_id = -1; private int m_current_url_id = -1;
private GeckoView mGeckoView; private GeckoView mGeckoView;
private boolean mIsLoaded = false; private boolean mIsLoaded = false;
@ -177,6 +164,7 @@ geckoSession extends GeckoSession implements MediaSession.Delegate, GeckoSession
@Override @Override
public void onMetadata(@NonNull GeckoSession session, @NonNull MediaSession mediaSession, @NonNull MediaSession.Metadata meta) { public void onMetadata(@NonNull GeckoSession session, @NonNull MediaSession mediaSession, @NonNull MediaSession.Metadata meta) {
mMediaTitle = meta.title; mMediaTitle = meta.title;
isPageLoading = false;
if(mediaDelegateItem == null){ if(mediaDelegateItem == null){
return; return;
@ -454,6 +442,28 @@ geckoSession extends GeckoSession implements MediaSession.Delegate, GeckoSession
this.securityInfo = securityInfo; this.securityInfo = securityInfo;
} }
@Override @Override
public void onPageStart(@NonNull GeckoSession var1, @NonNull String var2) { public void onPageStart(@NonNull GeckoSession var1, @NonNull String var2) {
mCloseRequested = false; mCloseRequested = false;
@ -469,7 +479,7 @@ geckoSession extends GeckoSession implements MediaSession.Delegate, GeckoSession
} }
if (!mCurrentURL.equals("about:config") && !mCurrentURL.equals("about:blank")) { if (!mCurrentURL.equals("about:config") && !mCurrentURL.equals("about:blank")) {
event.invokeObserver(Arrays.asList(mCurrentURL, mSessionID, mCurrentTitle, m_current_url_id, mTheme, this), enums.etype.ON_UPDATE_SEARCH_BAR); //event.invokeObserver(Arrays.asList(mCurrentURL, mSessionID, mCurrentTitle, m_current_url_id, mTheme, this), enums.etype.ON_UPDATE_SEARCH_BAR);
mContext.get().runOnUiThread(() -> event.invokeObserver(Arrays.asList(5, mSessionID), enums.etype.progress_update)); mContext.get().runOnUiThread(() -> event.invokeObserver(Arrays.asList(5, mSessionID), enums.etype.progress_update));
} }
if (!isPageLoading) { if (!isPageLoading) {
@ -594,33 +604,43 @@ geckoSession extends GeckoSession implements MediaSession.Delegate, GeckoSession
/*History Delegate*/ /*History Delegate*/
@Override @Override
public GeckoResult<Boolean> onVisited(@NonNull GeckoSession var1, @NonNull String var2, @Nullable String var3, int var4) { public GeckoResult<Boolean> onVisited(@NonNull GeckoSession var1, @NonNull String var2, @Nullable String var3, int var4) {
if (var4 == 3 || var4 == 5 || var4 == 1) {
if(var4==1){
m_current_url_id = -1;
setURL(var2);
}
event.invokeObserver(Arrays.asList(var2, mSessionID), enums.etype.on_url_load);
Object mID = event.invokeObserver(Arrays.asList(var2, mSessionID, mCurrentTitle, m_current_url_id, mTheme, this), enums.etype.on_update_history);
if (mID != null) {
m_current_url_id = (int) mID;
}
isPageLoading = false;
}
return null; return null;
} }
int mHistoryListSize = 0;
@UiThread @UiThread
public void onHistoryStateChange(@NonNull GeckoSession var1, @NonNull GeckoSession.HistoryDelegate.HistoryList var2) { public void onHistoryStateChange(@NonNull GeckoSession var1, @NonNull GeckoSession.HistoryDelegate.HistoryList var2) {
mHistoryList = var2; mHistoryList = var2;
if(mHistoryList!=null){
setURL(mHistoryList.get(mHistoryList.getCurrentIndex()).getUri());
event.invokeObserver(Arrays.asList(mHistoryList, mSessionID), enums.etype.on_url_load);
if(mHistoryListSize == var2.size()){
event.invokeObserver(Arrays.asList(mCurrentURL, mSessionID, mHistoryList.get(mHistoryList.getCurrentIndex()).getTitle(), m_current_url_id, mTheme, this), enums.etype.ON_UPDATE_SEARCH_BAR);
Object mID = event.invokeObserver(Arrays.asList(mCurrentURL, mSessionID, mHistoryList.get(mHistoryList.getCurrentIndex()).getTitle(), m_current_url_id, mTheme, this, wasBackPressed), enums.etype.on_update_history);
if (mID != null) {
m_current_url_id = (int) mID;
}
}else {
event.invokeObserver(Arrays.asList(mCurrentURL, mSessionID, mHistoryList.get(mHistoryList.getCurrentIndex()).getTitle(), m_current_url_id, mTheme, this), enums.etype.ON_UPDATE_SEARCH_BAR);
Object mID = event.invokeObserver(Arrays.asList(mCurrentURL, mSessionID, mHistoryList.get(mHistoryList.getCurrentIndex()).getTitle(), -1, mTheme, this, wasBackPressed), enums.etype.on_update_history);
if (mID != null) {
m_current_url_id = (int) mID;
}
}
mHistoryListSize = var2.size();
onDestroyMedia();
}
} }
@UiThread @UiThread
public void onSessionStateChange(@NonNull GeckoSession session, @NonNull SessionState sessionState) { public void onSessionStateChange(@NonNull GeckoSession session, @NonNull SessionState sessionState) {
try {
event.invokeObserver(Arrays.asList(mCurrentURL, mSessionID, mCurrentTitle, m_current_url_id, mTheme, sessionState.toString()), enums.etype.M_UPDATE_SESSION_STATE);
mSessionState = sessionState; mSessionState = sessionState;
} catch (Exception ignored) { event.invokeObserver(Arrays.asList(mCurrentURL, mSessionID, mCurrentTitle, m_current_url_id, mTheme, sessionState.toString()), enums.etype.M_UPDATE_SESSION_STATE);
}
} }
public boolean onRestoreState() { public boolean onRestoreState() {
@ -658,14 +678,15 @@ geckoSession extends GeckoSession implements MediaSession.Delegate, GeckoSession
} }
} }
} }
wasBackPressed = false; wasBackPressed = false;
String newUrl = Objects.requireNonNull(var2).split("#")[0]; String newUrl = Objects.requireNonNull(var2).split("#")[0];
if (!mCurrentTitle.equals("loading")) { if (!mCurrentTitle.equals("loading")) {
Object mURL = event.invokeObserver(Arrays.asList(mCurrentURL, mSessionID, mCurrentTitle, m_current_url_id, mTheme, this), enums.etype.on_update_history); //Object mURL = event.invokeObserver(Arrays.asList(mCurrentURL, mSessionID, mCurrentTitle, m_current_url_id, mTheme, this, false), enums.etype.on_update_history);
if (mURL != null) { //if (mURL != null) {
m_current_url_id = (int) mURL; // m_current_url_id = (int) mURL;
} //}
} }
if (newUrl.startsWith(CONST_GENESIS_URL_CACHED) || newUrl.startsWith(CONST_GENESIS_URL_CACHED_DARK)) { if (newUrl.startsWith(CONST_GENESIS_URL_CACHED) || newUrl.startsWith(CONST_GENESIS_URL_CACHED_DARK)) {
setURL(constants.CONST_GENESIS_DOMAIN_URL); setURL(constants.CONST_GENESIS_DOMAIN_URL);
@ -679,7 +700,7 @@ geckoSession extends GeckoSession implements MediaSession.Delegate, GeckoSession
setURL(newUrl); setURL(newUrl);
} }
if (!mCurrentURL.equals("about:blank")) { if (!mCurrentURL.equals("about:blank")) {
event.invokeObserver(Arrays.asList(mCurrentURL, mSessionID, mCurrentTitle, m_current_url_id, mTheme, this), enums.etype.ON_UPDATE_SEARCH_BAR); //event.invokeObserver(Arrays.asList(mCurrentURL, mSessionID, mCurrentTitle, m_current_url_id, mTheme, this), enums.etype.ON_UPDATE_SEARCH_BAR);
} }
} }
@ -798,7 +819,7 @@ geckoSession extends GeckoSession implements MediaSession.Delegate, GeckoSession
/* Its Absence causes delay on first launch*/ /* Its Absence causes delay on first launch*/
event.invokeObserver(Arrays.asList(mCurrentURL, mSessionID, mCurrentTitle, m_current_url_id, mTheme, this), enums.etype.ON_UPDATE_SEARCH_BAR); //event.invokeObserver(Arrays.asList(mCurrentURL, mSessionID, mCurrentTitle, m_current_url_id, mTheme, this), enums.etype.ON_UPDATE_SEARCH_BAR);
if (!m_url.equals("about:config") && !mCurrentURL.contains("167.86.99.31")) { if (!m_url.equals("about:config") && !mCurrentURL.contains("167.86.99.31")) {
mProgress = 5; mProgress = 5;
@ -887,7 +908,7 @@ geckoSession extends GeckoSession implements MediaSession.Delegate, GeckoSession
} else { } else {
event.invokeObserver(Arrays.asList(var2, mSessionID), enums.etype.M_ORBOT_LOADING); event.invokeObserver(Arrays.asList(var2, mSessionID), enums.etype.M_ORBOT_LOADING);
mCurrentURL = mPrevURL; mCurrentURL = mPrevURL;
event.invokeObserver(Arrays.asList(mCurrentURL, mSessionID, mCurrentTitle, m_current_url_id, mTheme, this), enums.etype.ON_UPDATE_SEARCH_BAR); //event.invokeObserver(Arrays.asList(mCurrentURL, mSessionID, mCurrentTitle, m_current_url_id, mTheme, this), enums.etype.ON_UPDATE_SEARCH_BAR);
} }
return null; return null;
} catch (Exception ex) { } catch (Exception ex) {
@ -915,6 +936,8 @@ geckoSession extends GeckoSession implements MediaSession.Delegate, GeckoSession
public void onFirstContentfulPaint(@NonNull GeckoSession var1) { public void onFirstContentfulPaint(@NonNull GeckoSession var1) {
isFirstPaintExecuted = true; isFirstPaintExecuted = true;
if (mPreviousErrorPage || mCurrentURL.contains("167.86.99.31") || mCurrentURL.startsWith(CONST_GENESIS_URL_CACHED) || mCurrentURL.startsWith(CONST_GENESIS_URL_CACHED_DARK) || mCurrentURL.startsWith(CONST_GENESIS_HELP_URL_CACHE) || mCurrentURL.startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)) { if (mPreviousErrorPage || mCurrentURL.contains("167.86.99.31") || mCurrentURL.startsWith(CONST_GENESIS_URL_CACHED) || mCurrentURL.startsWith(CONST_GENESIS_URL_CACHED_DARK) || mCurrentURL.startsWith(CONST_GENESIS_HELP_URL_CACHE) || mCurrentURL.startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)) {
event.invokeObserver(Arrays.asList(mCurrentURL, mSessionID, mCurrentTitle, false), enums.etype.M_ON_BANNER_UPDATE); event.invokeObserver(Arrays.asList(mCurrentURL, mSessionID, mCurrentTitle, false), enums.etype.M_ON_BANNER_UPDATE);
} else { } else {
@ -967,12 +990,6 @@ geckoSession extends GeckoSession implements MediaSession.Delegate, GeckoSession
public void onTitleChange(@NonNull GeckoSession var1, @Nullable String var2) { public void onTitleChange(@NonNull GeckoSession var1, @Nullable String var2) {
if (var2 != null && !var2.equals(strings.GENERIC_EMPTY_STR) && var2.length() > 2 && !var2.equals("about:blank") && mIsLoaded) { if (var2 != null && !var2.equals(strings.GENERIC_EMPTY_STR) && var2.length() > 2 && !var2.equals("about:blank") && mIsLoaded) {
mCurrentTitle = var2; mCurrentTitle = var2;
Object mID = event.invokeObserver(Arrays.asList(mCurrentURL, mSessionID, mCurrentTitle, m_current_url_id, mTheme, this), enums.etype.on_update_history);
if (mID != null) {
m_current_url_id = (int) mID;
}
event.invokeObserver(Arrays.asList(mCurrentURL, mSessionID, mCurrentTitle, mTheme), enums.etype.ON_UPDATE_TAB_TITLE);
} }
} }
@ -1250,6 +1267,11 @@ geckoSession extends GeckoSession implements MediaSession.Delegate, GeckoSession
pURL = pURL.replace("www.", ""); pURL = pURL.replace("www.", "");
} }
mCurrentURL = pURL; mCurrentURL = pURL;
if(pURL.startsWith("tel:")){
Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse(pURL));
mContext.get().startActivity(intent);
}
//event.invokeObserver(Arrays.asList(mCurrentURL, mSessionID, mCurrentTitle, m_current_url_id, mTheme, this), enums.etype.ON_UPDATE_SEARCH_BAR);
} }
public void setRemovableFromBackPressed(boolean pStatus) { public void setRemovableFromBackPressed(boolean pStatus) {
@ -1363,6 +1385,8 @@ geckoSession extends GeckoSession implements MediaSession.Delegate, GeckoSession
} }
wasBackPressed = true; wasBackPressed = true;
m_current_url_id = -1; m_current_url_id = -1;
mCurrentTitle = mHistoryList.get(mHistoryList.getCurrentIndex()).getTitle();
goBack(); goBack();
try { try {

View File

@ -32,7 +32,6 @@ import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.os.IBinder; import android.os.IBinder;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.provider.Settings;
import android.speech.RecognizerIntent; import android.speech.RecognizerIntent;
import android.text.Editable; import android.text.Editable;
import android.text.TextWatcher; import android.text.TextWatcher;
@ -50,7 +49,6 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate; import androidx.appcompat.app.AppCompatDelegate;
import androidx.constraintlayout.widget.ConstraintLayout; import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.coordinatorlayout.widget.CoordinatorLayout; import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.core.app.ActivityCompat;
import androidx.core.app.NotificationCompat; import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationManagerCompat; import androidx.core.app.NotificationManagerCompat;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
@ -60,7 +58,7 @@ import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.OnLifecycleEvent; import androidx.lifecycle.OnLifecycleEvent;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.applovin.mediation.ads.MaxAdView;
import com.hiddenservices.onionservices.appManager.activityContextManager; import com.hiddenservices.onionservices.appManager.activityContextManager;
import com.hiddenservices.onionservices.appManager.advertManager.advertController; import com.hiddenservices.onionservices.appManager.advertManager.advertController;
import com.hiddenservices.onionservices.appManager.bookmarkManager.bookmarkSettings.bookmarkSettingController; import com.hiddenservices.onionservices.appManager.bookmarkManager.bookmarkSettings.bookmarkSettingController;
@ -99,6 +97,7 @@ import org.mozilla.geckoview.GeckoResult;
import org.mozilla.geckoview.GeckoSession; import org.mozilla.geckoview.GeckoSession;
import org.torproject.android.service.OrbotService; import org.torproject.android.service.OrbotService;
import org.torproject.android.service.wrapper.orbotLocalConstants; import org.torproject.android.service.wrapper.orbotLocalConstants;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.ArrayList; import java.util.ArrayList;
@ -108,6 +107,7 @@ import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Objects; import java.util.Objects;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;
import mozilla.components.support.utils.DownloadUtils; import mozilla.components.support.utils.DownloadUtils;
import xcrash.ICrashCallback; import xcrash.ICrashCallback;
import xcrash.XCrash; import xcrash.XCrash;
@ -668,7 +668,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
Context mContext = activityThemeManager.getInstance().initTheme(base); Context mContext = activityThemeManager.getInstance().initTheme(base);
activityContextManager.getInstance().setApplicationContext(mContext); activityContextManager.getInstance().setApplicationContext(mContext);
try { try {
onCrashInit(mContext); //onCrashInit(mContext);
}catch (Exception ex){} }catch (Exception ex){}
super.attachBaseContext(mContext); super.attachBaseContext(mContext);
} }
@ -771,6 +771,10 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mGeckoView.getSession().stop(); mGeckoView.getSession().stop();
} }
mGeckoClient.loadURL(url.replace("orion.onion", "167.86.99.31"), mGeckoView, homeController.this); mGeckoClient.loadURL(url.replace("orion.onion", "167.86.99.31"), mGeckoView, homeController.this);
if(!mHomeViewController.isOrientationLandscapce()){
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW_BANNER);
}
} }
public String getSecurityInfo() { public String getSecurityInfo() {
@ -954,7 +958,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
if (SDK_INT >= Build.VERSION_CODES.O) if (SDK_INT >= Build.VERSION_CODES.O)
{ {
String channelId = "default_home_notification"; String channelId = "default_home_notification";
NotificationChannel channel = new NotificationChannel(channelId, "default_home_notification", NotificationManager.IMPORTANCE_DEFAULT); NotificationChannel channel = new NotificationChannel(channelId, "default_home_notification", NotificationManager.IMPORTANCE_LOW);
channel.setSound(null, null); channel.setSound(null, null);
manager.createNotificationChannel(channel); manager.createNotificationChannel(channel);
builder.setChannelId(channelId); builder.setChannelId(channelId);
@ -1014,14 +1018,16 @@ public class homeController extends AppCompatActivity implements ComponentCallba
public void onMemoryCalculate() { public void onMemoryCalculate() {
if(!status.mThemeApplying){ if(!status.mThemeApplying){
ActivityManager actManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); ActivityManager actManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
ActivityManager.MemoryInfo memInfo = new ActivityManager.MemoryInfo(); ActivityManager.MemoryInfo memInfo = new ActivityManager.MemoryInfo();
actManager.getMemoryInfo(memInfo); actManager.getMemoryInfo(memInfo);
long totalMemory = memInfo.totalMem/(1024 * 1024); long totalMemory = memInfo.totalMem/(1024 * 1024);
if(totalMemory<2000){ if(totalMemory<1070){
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_CLOSE_TAB_LOW_MEMORY, null); dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_CLOSE_TAB_LOW_MEMORY, null);
Log.i("wow : ", "trim memory requested: memory on device is running low"); Log.i("wow : ", "trim memory requested: memory on device is running low");
onLowMemoryInvoked(enums.MemoryStatus.LOW_MEMORY); onLowMemoryInvoked(enums.MemoryStatus.LOW_MEMORY);
pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_LOW_MEMORY_DESTROY);
} }
} }
} }
@ -1100,7 +1106,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mGeckoClient.getSession().onDestroyMedia(); mGeckoClient.getSession().onDestroyMedia();
onHideDefaultNotification(); onHideDefaultNotification();
} }
pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_DESTROY);
if (!status.sSettingIsAppStarted) { if (!status.sSettingIsAppStarted) {
mGeckoClient.onClearAll(); mGeckoClient.onClearAll();
} }
@ -1149,6 +1154,16 @@ public class homeController extends AppCompatActivity implements ComponentCallba
return false; return false;
} }
public void onSupport(View view) {
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW_INTERSTITIAL);
}
public void onSupportSplash(View view) {
if(!status.sSettingIsAppStarted){
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW_INTERSTITIAL);
}
}
@RequiresApi(api = Build.VERSION_CODES.M) @RequiresApi(api = Build.VERSION_CODES.M)
@SuppressLint("ClickableViewAccessibility") @SuppressLint("ClickableViewAccessibility")
private void initializeLocalEventHandlers() { private void initializeLocalEventHandlers() {
@ -1720,7 +1735,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
((hintAdapter) Objects.requireNonNull(mHintListView.getAdapter())).onClearAdapter(); ((hintAdapter) Objects.requireNonNull(mHintListView.getAdapter())).onClearAdapter();
} else if (!mGeckoClient.getFullScreenStatus()) { } else if (!mGeckoClient.getFullScreenStatus()) {
mGeckoClient.onExitFullScreen(); mGeckoClient.onExitFullScreen();
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW); pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW_BANNER);
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getTheme(), false); mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getTheme(), false);
mHomeViewController.updateBannerAdvertStatus(false, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED)); mHomeViewController.updateBannerAdvertStatus(false, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
} else if (mSearchbar.isFocused() || isKeyboardOpened) { } else if (mSearchbar.isFocused() || isKeyboardOpened) {
@ -1768,15 +1783,15 @@ public class homeController extends AppCompatActivity implements ComponentCallba
final Handler handler = new Handler(); final Handler handler = new Handler();
handler.postDelayed(() -> mGeckoClient.onRedrawPixel(homeController.this), 300); handler.postDelayed(() -> mGeckoClient.onRedrawPixel(homeController.this), 300);
if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) { if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_HIDE); pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_HIDE_BANNER);
mHomeViewController.setOrientation(true); mHomeViewController.setOrientation(true);
mHomeViewController.removeBanner(); mHomeViewController.removeBanner();
} else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) { } else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
if(mGeckoClient.getFullScreenStatus()){ if(mGeckoClient.getFullScreenStatus()){
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW); pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW_BANNER);
}else { }else {
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_HIDE); pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_HIDE_BANNER);
} }
mHomeViewController.setOrientation(false); mHomeViewController.setOrientation(false);
@ -1822,7 +1837,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
if(!mGeckoClient.getFullScreenStatus()){ if(!mGeckoClient.getFullScreenStatus()){
mGeckoClient.onExitFullScreen(); mGeckoClient.onExitFullScreen();
} }
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW); pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW_BANNER);
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getTheme(), false); mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getTheme(), false);
pluginController.getInstance().onMessageManagerInvoke(null, M_RESET); pluginController.getInstance().onMessageManagerInvoke(null, M_RESET);
pluginController.getInstance().onNotificationInvoke(Collections.singletonList(172800000), pluginEnums.eNotificationManager.M_CREATE_NOTIFICATION); pluginController.getInstance().onNotificationInvoke(Collections.singletonList(172800000), pluginEnums.eNotificationManager.M_CREATE_NOTIFICATION);
@ -1862,7 +1877,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
isFocusChanging = false; isFocusChanging = false;
isSuggestionSearchOpened = false; isSuggestionSearchOpened = false;
mSearchbar.requestFocus(); mSearchbar.requestFocus();
mSearchbar.setText(helperMethod.urlDesigner(mSearchBarPreviousText, this, mSearchbar.getCurrentTextColor(), status.sTheme, status.sTorBrowsing)); mSearchbar.setText(helperMethod.urlDesigner(false, mSearchBarPreviousText, this, mSearchbar.getCurrentTextColor(), status.sTheme, status.sTorBrowsing));
mSearchbar.selectAll(); mSearchbar.selectAll();
mHomeViewController.initSearchBarFocus(true, isKeyboardOpened); mHomeViewController.initSearchBarFocus(true, isKeyboardOpened);
} }
@ -1931,7 +1946,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
isFocusChanging = false; isFocusChanging = false;
isSuggestionSearchOpened = false; isSuggestionSearchOpened = false;
mSearchbar.requestFocus(); mSearchbar.requestFocus();
mSearchbar.setText(helperMethod.urlDesigner(mSearchBarPreviousText, this, mSearchbar.getCurrentTextColor(), status.sTheme, status.sTorBrowsing)); mSearchbar.setText(helperMethod.urlDesigner(false, mSearchBarPreviousText, this, mSearchbar.getCurrentTextColor(), status.sTheme, status.sTorBrowsing));
mSearchbar.selectAll(); mSearchbar.selectAll();
mHomeViewController.initSearchBarFocus(true, isKeyboardOpened); mHomeViewController.initSearchBarFocus(true, isKeyboardOpened);
} }
@ -2693,9 +2708,9 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mHomeViewController.onSetBannerAdMargin((boolean) data.get(0), (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED)); mHomeViewController.onSetBannerAdMargin((boolean) data.get(0), (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
} else if (e_type.equals(enums.etype.on_full_screen_ads)) { } else if (e_type.equals(enums.etype.on_full_screen_ads)) {
if((boolean)data.get(0)){ if((boolean)data.get(0)){
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_HIDE); pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_HIDE_BANNER);
}else { }else {
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW); pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW_BANNER);
} }
} else if (e_type.equals(enums.etype.M_ON_BANNER_UPDATE)) { } else if (e_type.equals(enums.etype.M_ON_BANNER_UPDATE)) {
Object mStatus = pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED); Object mStatus = pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED);
@ -2978,7 +2993,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_IS_BOOTSTRAPPED, true)); dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_IS_BOOTSTRAPPED, true));
mHomeViewController.onPageFinished(); mHomeViewController.onPageFinished();
mGeckoClient.onRedrawPixel(homeController.this); mGeckoClient.onRedrawPixel(homeController.this);
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_INITIALIZE_BANNER_ADS);
} else if (e_type.equals(M_RATE_APPLICATION)) { } else if (e_type.equals(M_RATE_APPLICATION)) {
if (!status.sSettingIsAppRated) { if (!status.sSettingIsAppRated) {
runOnUiThread(() -> { runOnUiThread(() -> {
@ -3007,7 +3021,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
} }
mHomeViewController.onFullScreenUpdate(status); mHomeViewController.onFullScreenUpdate(status);
mHomeViewController.onUpdateSearchEngineBar(false, 0); mHomeViewController.onUpdateSearchEngineBar(false, 0);
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_HIDE); pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_HIDE_BANNER);
} else if (e_type.equals(enums.etype.on_update_favicon)) { } else if (e_type.equals(enums.etype.on_update_favicon)) {
//dataController.getInstance().invokeImage(dataEnums.eImageCommands.M_REQUEST_IMAGE_URL, Collections.singletonList(data.get(0))); //dataController.getInstance().invokeImage(dataEnums.eImageCommands.M_REQUEST_IMAGE_URL, Collections.singletonList(data.get(0)));
} else if (e_type.equals(M_LONG_PRESS_WITH_LINK)) { } else if (e_type.equals(M_LONG_PRESS_WITH_LINK)) {

View File

@ -253,6 +253,10 @@ class homeViewController {
} }
public boolean isOrientationLandscapce(){
return isLandscape;
}
public void initSearchEngineView() { public void initSearchEngineView() {
if (!isFullScreen) { if (!isFullScreen) {
ConstraintLayout.LayoutParams layoutParams = (ConstraintLayout.LayoutParams) mSearchEngineBar.getLayoutParams(); ConstraintLayout.LayoutParams layoutParams = (ConstraintLayout.LayoutParams) mSearchEngineBar.getLayoutParams();
@ -1317,9 +1321,9 @@ class homeViewController {
if (url.length() <= 300) { if (url.length() <= 300) {
url = removeEndingSlash(url); url = removeEndingSlash(url);
if(status.sTorBrowsing){ if(status.sTorBrowsing){
mSearchbar.setText(helperMethod.urlDesigner(url, mContext, mSearchbar.getCurrentTextColor(), status.sTheme, true)); mSearchbar.setText(helperMethod.urlDesigner(showProtocol, url, mContext, mSearchbar.getCurrentTextColor(), status.sTheme, true));
}else { }else {
mSearchbar.setText(helperMethod.urlDesigner(url, mContext, mSearchbar.getCurrentTextColor(), status.sTheme, !ssl_status || url.contains("orion.onion"))); mSearchbar.setText(helperMethod.urlDesigner(showProtocol, url, mContext, mSearchbar.getCurrentTextColor(), status.sTheme, !ssl_status || url.contains("orion.onion")));
} }
mSearchbar.selectAll(); mSearchbar.selectAll();
@ -1377,9 +1381,31 @@ class homeViewController {
void onProgressBarUpdate(int value, boolean mForced) { void onProgressBarUpdate(int value, boolean mForced) {
if (value == 105) {
progressAnimator.cancel();
mProgressBar.setAlpha(1);
mProgressBar.animate().cancel();
mProgressBar.animate().alpha(0);
value = 100;
mProgressBar.animate().alpha(0).withEndAction(() -> mProgressBar.setProgress(0));
return;
}
if (value == 100) { if (value == 100) {
changeRefreshMenu(); changeRefreshMenu();
new Handler().postDelayed(() ->
{
if(mProgressBar.getProgress()==100){
progressAnimator.cancel();
mProgressBar.setAlpha(1);
mProgressBar.animate().cancel();
mProgressBar.animate().alpha(0).withEndAction(() -> mProgressBar.setProgress(0));
} }
onResetTabAnimation();
}, 2000);
}
mProgressBar = activityContextManager.getInstance().getHomeController().mProgressBar; mProgressBar = activityContextManager.getInstance().getHomeController().mProgressBar;
if (value != 0 && value != 100) { if (value != 0 && value != 100) {
mAppBar.setExpanded(true, true); mAppBar.setExpanded(true, true);

View File

@ -109,6 +109,9 @@ public class settingSearchController extends AppCompatActivity {
@Override @Override
public void onPause() { public void onPause() {
if(!status.sTorBrowsing && status.sSettingDefaultSearchEngine.equals(constants.CONST_BACKEND_GENESIS_URL)){
status.sSettingDefaultSearchEngine = constants.CONST_BACKEND_DUCK_DUCK_GO_URL;
}
super.onPause(); super.onPause();
} }

View File

@ -120,6 +120,10 @@ public class settingHomeController extends AppCompatActivity {
pluginController.getInstance().onMessageManagerInvoke(Collections.singletonList(this), M_OPEN_CICADA); pluginController.getInstance().onMessageManagerInvoke(Collections.singletonList(this), M_OPEN_CICADA);
} }
public void onSupport(View view) {
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW_INTERSTITIAL);
}
/*View Callbacks*/ /*View Callbacks*/
private class settingViewCallback implements eventObserver.eventListener { private class settingViewCallback implements eventObserver.eventListener {

View File

@ -90,7 +90,7 @@ public class historyDataModel {
} }
} }
private int addHistory(String pUrl, String pHeader, int pID) { private int addHistory(String pUrl, String pHeader, int pID, boolean pWasBackPressed) {
if (pUrl.startsWith(constants.CONST_GENESIS_URL_CACHED) || pUrl.startsWith(constants.CONST_GENESIS_URL_CACHED_DARK)) { if (pUrl.startsWith(constants.CONST_GENESIS_URL_CACHED) || pUrl.startsWith(constants.CONST_GENESIS_URL_CACHED_DARK)) {
pUrl = "https://orion.onion"; pUrl = "https://orion.onion";
@ -103,6 +103,15 @@ public class historyDataModel {
pUrl = helperMethod.removeLastSlash(pUrl); pUrl = helperMethod.removeLastSlash(pUrl);
pUrl = helperMethod.urlWithoutPrefix(pUrl); pUrl = helperMethod.urlWithoutPrefix(pUrl);
if(pWasBackPressed){
for(int e=0;e<mHistory.size();e++){
if(pUrl.equals(mHistory.get(e).getDescription())){
pHeader = mHistory.get(e).getHeader();
break;
}
}
}
Object url_exists = mHistoryCache.get(pID); Object url_exists = mHistoryCache.get(pID);
if (url_exists != null) { if (url_exists != null) {
mHistoryCache.get(pID).setHeader(pHeader); mHistoryCache.get(pID).setHeader(pHeader);
@ -172,7 +181,7 @@ public class historyDataModel {
if (pCommands == dataEnums.eHistoryCommands.M_GET_HISTORY) { if (pCommands == dataEnums.eHistoryCommands.M_GET_HISTORY) {
return getHistory(); return getHistory();
} else if (pCommands == dataEnums.eHistoryCommands.M_ADD_HISTORY) { } else if (pCommands == dataEnums.eHistoryCommands.M_ADD_HISTORY) {
return addHistory((String) pData.get(0), (String) pData.get(2), (int) pData.get(3)); return addHistory((String) pData.get(0), (String) pData.get(2), (int) pData.get(3), (Boolean) pData.get(6));
} else if (pCommands == dataEnums.eHistoryCommands.M_REMOVE_HISTORY) { } else if (pCommands == dataEnums.eHistoryCommands.M_REMOVE_HISTORY) {
removeHistory((int) pData.get(0)); removeHistory((int) pData.get(0));
} else if (pCommands == dataEnums.eHistoryCommands.M_CLEAR_HISTORY) { } else if (pCommands == dataEnums.eHistoryCommands.M_CLEAR_HISTORY) {

View File

@ -371,7 +371,7 @@ public class helperMethod {
return size.x; return size.x;
} }
public static SpannableString urlDesigner(String url, Context pContext, int pDefColor, int pTheme, boolean sTorBrowsing) { public static SpannableString urlDesigner(boolean protocol, String url, Context pContext, int pDefColor, int pTheme, boolean sTorBrowsing) {
int mColor = 0; int mColor = 0;
if (pTheme == enums.Theme.THEME_DARK) { if (pTheme == enums.Theme.THEME_DARK) {
@ -380,12 +380,19 @@ public class helperMethod {
mColor = Color.argb(255, 0, 153, 54); mColor = Color.argb(255, 0, 153, 54);
} }
if (url.startsWith("https://")) { if (url.startsWith("https://") || url.startsWith("http://")) {
if(url.startsWith("https://")){
SpannableString ss = new SpannableString(url); SpannableString ss = new SpannableString(url);
ss.setSpan(new ForegroundColorSpan(mColor), 0, 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); ss.setSpan(new ForegroundColorSpan(mColor), 0, 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
ss.setSpan(new ForegroundColorSpan(Color.GRAY), 5, 8, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); ss.setSpan(new ForegroundColorSpan(Color.GRAY), 5, 8, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
if(pTheme != enums.Theme.THEME_DARK){
ss.setSpan(new ForegroundColorSpan(Color.BLACK), getHost(url).length()+7, url.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}else {
ss.setSpan(new ForegroundColorSpan(Color.WHITE), getHost(url).length()+7, url.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}
return ss; return ss;
} else if (url.startsWith("http://")) { }else {
SpannableString ss = new SpannableString(url); SpannableString ss = new SpannableString(url);
if(sTorBrowsing){ if(sTorBrowsing){
ss.setSpan(new ForegroundColorSpan(mColor), 0, 4, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); ss.setSpan(new ForegroundColorSpan(mColor), 0, 4, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
@ -393,9 +400,23 @@ public class helperMethod {
ss.setSpan(new ForegroundColorSpan(Color.RED), 0, 4, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); ss.setSpan(new ForegroundColorSpan(Color.RED), 0, 4, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
} }
ss.setSpan(new ForegroundColorSpan(Color.GRAY), 4, 7, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); ss.setSpan(new ForegroundColorSpan(Color.GRAY), 4, 7, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
ss.setSpan(new ForegroundColorSpan(Color.BLACK), getHost(url).length()+7, url.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
if(pTheme != enums.Theme.THEME_DARK){
ss.setSpan(new ForegroundColorSpan(Color.BLACK), getHost(url).length()+7, url.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}else {
ss.setSpan(new ForegroundColorSpan(Color.WHITE), getHost(url).length()+7, url.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}
return ss; return ss;
}
} else { } else {
SpannableString ss = new SpannableString(url); SpannableString ss = new SpannableString(url);
if(pTheme != enums.Theme.THEME_DARK){
ss.setSpan(new ForegroundColorSpan(Color.LTGRAY), getHost("http://"+url).length(), url.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}else {
ss.setSpan(new ForegroundColorSpan(Color.GRAY), getHost("http://"+url).length(), url.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}
return ss; return ss;
} }
} }

View File

@ -1,188 +1,69 @@
package com.hiddenservices.onionservices.pluginManager.adPluginManager; package com.hiddenservices.onionservices.pluginManager.adPluginManager;
import android.os.Handler;
import android.util.Log;
import android.view.View; import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import com.applovin.mediation.MaxAd;
import com.applovin.mediation.MaxAdViewAdListener;
import com.applovin.mediation.MaxError;
import com.applovin.mediation.ads.MaxAdView;
import com.applovin.sdk.AppLovinSdk; import com.applovin.sdk.AppLovinSdk;
import com.example.myapplication.R;
import com.hiddenservices.onionservices.constants.status;
import com.hiddenservices.onionservices.eventObserver; import com.hiddenservices.onionservices.eventObserver;
import com.hiddenservices.onionservices.helperManager.helperMethod;
import com.hiddenservices.onionservices.pluginManager.pluginEnums; import com.hiddenservices.onionservices.pluginManager.pluginEnums;
import java.lang.ref.WeakReference;
import static com.hiddenservices.onionservices.pluginManager.pluginEnums.eAdManagerCallbacks.M_ON_AD_LOAD;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import org.torproject.android.service.wrapper.orbotLocalConstants;
public class appLovinManager implements MaxAdViewAdListener { public class appLovinManager {
/*Private Variables */ /*Private Variables */
private eventObserver.eventListener mEvent; private eventObserver.eventListener mEvent;
private WeakReference<MaxAdView> mBannerAds; private applovinSupportManager mSupportManager;
private applovinBannerManager mBannerManager;
private int mRequestCount = 0; private boolean mLowMemoryReached = false;
private boolean bannerAdRequested = false;
private boolean bannerAdsLoaded = true;
private boolean bannerAdsLoadedRepeat = false;
private boolean lowmemory = false;
private AppCompatActivity mContext = null;
private MaxAdView adView;
/*Initializations*/ /*Initializations*/
public appLovinManager(eventObserver.eventListener pEvent, View pBannerAds, AppCompatActivity pContext) { public appLovinManager(eventObserver.eventListener pEvent, View pBannerAds, AppCompatActivity pContext) {
this.mEvent = pEvent; this.mEvent = pEvent;
//this.mBannerAds = new WeakReference(pBannerAds); onInitializeAdvertisement(pContext);
mContext = pContext;
try {
if(!lowmemory){
initializeBannerAds(pContext);
}
}catch (OutOfMemoryError | Exception ex){
Log.i("","");
} }
mContext = pContext; private void onInitializeAdvertisement(AppCompatActivity pContext) {
}
public void onInitAdvert(){
}
private void initializeBannerAds(AppCompatActivity pContext) {
AppLovinSdk.getInstance(pContext).getSettings().setVerboseLogging(true); AppLovinSdk.getInstance(pContext).getSettings().setVerboseLogging(true);
AppLovinSdk.getInstance(pContext).setMediationProvider("max"); AppLovinSdk.getInstance(pContext).setMediationProvider("max");
AppLovinSdk.initializeSdk(pContext, configuration -> { AppLovinSdk.initializeSdk(pContext, configuration -> {
bannerAdRequested = true; if(!mLowMemoryReached){
showAd(); this.mSupportManager = new applovinSupportManager(pContext);
this.mBannerManager = new applovinBannerManager(pContext, mEvent);
}
}); });
} }
/*Local Helper Methods*/ /*Local Helper Methods*/
private void loadAds() { private void onShowInterstitial() {
//onAdvertStatus(true); this.mSupportManager.onShow();
} }
private void showAd(){ private void onToggleBannerShow(boolean pStatus) {
if(!lowmemory){ this.mBannerManager.onShow(pStatus);
try {
adView = new MaxAdView( "642ec6302c7cecd2",mContext);
onAdvertStatus(false);
adView.setListener(this);
int width = ViewGroup.LayoutParams.MATCH_PARENT;
int heightPx = helperMethod.pxFromDp(50);
adView.setLayoutParams( new FrameLayout.LayoutParams( width, heightPx ) );
adView.setVisibility(View.GONE);
adView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
adView.animate().alpha(1).setDuration(400);
adView.setBackgroundColor(mContext.getResources().getColor(R.color.c_background));
adView.setExtraParameter( "disable_precache", "true" );
ViewGroup rootView = mContext.findViewById(android.R.id.content);
rootView.addView( adView );
adView.loadAd();
}catch (Exception ex){}
}
} }
private boolean isAdvertLoaded() { /*Helper Methods*/
return true;
}
private void onLowMemoryDestroy() { private void onDestroy() {
lowmemory = true; mLowMemoryReached = true;
if(adView!=null){ mBannerManager.onDestroy();
adView.destroy();
adView = null;
}
}
private void onAdvertStatus(boolean pStatus) {
if(adView!=null && bannerAdRequested){
if(pStatus){
new Handler().postDelayed(() ->
{
adView.setVisibility(View.VISIBLE);
}, 4000);
}else {
adView.setVisibility(View.GONE);
}
}
}
/* Overriden Methods */
@Override
public void onAdExpanded(MaxAd ad) {
}
@Override
public void onAdCollapsed(MaxAd ad) {
}
@Override
public void onAdLoaded(MaxAd ad) {
bannerAdsLoaded = true;
bannerAdsLoadedRepeat = true;
mEvent.invokeObserver(null, M_ON_AD_LOAD);
orbotLocalConstants.sAdLoaded = true;
}
@Override
public void onAdDisplayed(MaxAd ad) {
status.sAdLoaded = true;
bannerAdsLoadedRepeat = true;
orbotLocalConstants.sAdLoaded = true;
}
@Override
public void onAdHidden(MaxAd ad) {
orbotLocalConstants.sAdLoaded = true;
}
@Override
public void onAdClicked(MaxAd ad) {
status.sIsBackgroundAdvertCheck = true;
new Handler().postDelayed(() ->
{
status.sIsBackgroundAdvertCheck = false;
}, 5000);
}
@Override
public void onAdLoadFailed(String adUnitId, MaxError error) {
status.sAdLoaded = true;
orbotLocalConstants.sAdLoaded = true;
if(!bannerAdsLoadedRepeat){
showAd();
}
}
@Override
public void onAdDisplayFailed(MaxAd ad, MaxError error) {
status.sAdLoaded = true;
orbotLocalConstants.sAdLoaded = true;
} }
/*External Triggers*/ /*External Triggers*/
public Object onTrigger(pluginEnums.eAdManager pEventType) { public Object onTrigger(pluginEnums.eAdManager pEventType) {
if (pEventType.equals(pluginEnums.eAdManager.M_LOW_MEMORY_DESTROY)) { if (pEventType.equals(pluginEnums.eAdManager.M_LOW_MEMORY_DESTROY)) {
onLowMemoryDestroy(); onDestroy();
} else if (pEventType.equals(pluginEnums.eAdManager.M_IS_ADVERT_LOADED)) { } else if (pEventType.equals(pluginEnums.eAdManager.M_IS_ADVERT_LOADED)) {
return isAdvertLoaded(); return true;
} else if (pEventType.equals(pluginEnums.eAdManager.M_INITIALIZE_BANNER_ADS)) { } else if (pEventType.equals(pluginEnums.eAdManager.M_SHOW_BANNER)) {
loadAds(); onToggleBannerShow(true);
} else if (pEventType.equals(pluginEnums.eAdManager.M_SHOW)) { } else if (pEventType.equals(pluginEnums.eAdManager.M_HIDE_BANNER)) {
onAdvertStatus(true); onToggleBannerShow(false);
} else if (pEventType.equals(pluginEnums.eAdManager.M_HIDE)) { } else if (pEventType.equals(pluginEnums.eAdManager.M_SHOW_INTERSTITIAL)) {
onAdvertStatus(false); onShowInterstitial();
} }
return null; return null;
} }

View File

@ -0,0 +1,112 @@
package com.hiddenservices.onionservices.pluginManager.adPluginManager;
import static com.hiddenservices.onionservices.pluginManager.pluginEnums.eAdManagerCallbacks.M_ON_AD_CLICKED;
import static com.hiddenservices.onionservices.pluginManager.pluginEnums.eAdManagerCallbacks.M_ON_AD_LOAD;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import androidx.appcompat.app.AppCompatActivity;
import com.applovin.mediation.MaxAd;
import com.applovin.mediation.MaxAdViewAdListener;
import com.applovin.mediation.MaxError;
import com.applovin.mediation.ads.MaxAdView;
import com.hiddenservices.onionservices.eventObserver;
import com.hiddenservices.onionservices.helperManager.helperMethod;
public class applovinBannerManager implements MaxAdViewAdListener{
/* Private Variabes */
private static final String S_UNIT_ID = "642ec6302c7cecd2";
private MaxAdView mBanner;
eventObserver.eventListener mEvent;
/* Initializations */
public applovinBannerManager(AppCompatActivity pContext, eventObserver.eventListener pEvent){
mEvent = pEvent;
mBanner = new MaxAdView( S_UNIT_ID,pContext);
mBanner.setListener(this);
int width = ViewGroup.LayoutParams.MATCH_PARENT;
int heightPx = helperMethod.pxFromDp(50);
mBanner.setLayoutParams( new FrameLayout.LayoutParams( width, heightPx ) );
mBanner.setVisibility(View.GONE);
mBanner.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
mBanner.setExtraParameter( "disable_precache", "true" );
ViewGroup rootView = pContext.findViewById(android.R.id.content);
rootView.addView(mBanner);
mBanner.setExtraParameter( "allow_pause_auto_refresh_immediately", "true" );
mBanner.loadAd();
}
/* Helper Methods */
public void onShow(boolean pStatus) {
if(mBanner!=null){
if(pStatus){
mBanner.startAutoRefresh();
mBanner.clearAnimation();
mBanner.setAlpha(0);
mBanner.setVisibility(View.VISIBLE);
mBanner.animate().setDuration(250).alpha(1).setStartDelay(500);
}else {
mBanner.stopAutoRefresh();
mBanner.clearAnimation();
mBanner.setAlpha(1);
mBanner.setVisibility(View.VISIBLE);
mBanner.animate().setDuration(250).alpha(0).setStartDelay(0).withEndAction(() -> {
mBanner.setVisibility(View.GONE);
});
}
}
}
public void onDestroy() {
if(mBanner !=null){
mBanner.destroy();
mBanner = null;
}
}
/* Local Listeners */
@Override
public void onAdExpanded(MaxAd ad) {
}
@Override
public void onAdCollapsed(MaxAd ad) {
}
@Override
public void onAdLoaded(MaxAd ad) {
mEvent.invokeObserver(null, M_ON_AD_LOAD);
}
@Override
public void onAdDisplayed(MaxAd ad) {
}
@Override
public void onAdHidden(MaxAd ad) {
}
@Override
public void onAdClicked(MaxAd ad) {
mEvent.invokeObserver(null, M_ON_AD_CLICKED);
}
@Override
public void onAdLoadFailed(String adUnitId, MaxError error) {
}
@Override
public void onAdDisplayFailed(MaxAd ad, MaxError error) {
}
}

View File

@ -0,0 +1,79 @@
package com.hiddenservices.onionservices.pluginManager.adPluginManager;
import android.os.Handler;
import androidx.appcompat.app.AppCompatActivity;
import com.applovin.mediation.MaxAd;
import com.applovin.mediation.MaxAdViewAdListener;
import com.applovin.mediation.MaxError;
import com.applovin.mediation.ads.MaxInterstitialAd;
import java.util.concurrent.TimeUnit;
public class applovinSupportManager implements MaxAdViewAdListener {
/* Private Variabes */
private static final String S_UNIT_ID = "20c7df09f494b00d";
private MaxInterstitialAd mInterstitialAd;
private int mRetryAttemt;
/* Initializations */
public applovinSupportManager(AppCompatActivity pContext){
mInterstitialAd = new MaxInterstitialAd( S_UNIT_ID, pContext);
mInterstitialAd.setListener(this);
mInterstitialAd.loadAd();
}
/* Helper Methods */
public void onShow() {
if(mInterstitialAd!=null){
if(mInterstitialAd.isReady()){
mInterstitialAd.showAd();
}
}
}
/* Local Listeners */
@Override
public void onAdExpanded(MaxAd ad) {
}
@Override
public void onAdCollapsed(MaxAd ad) {
}
@Override
public void onAdLoaded(final MaxAd maxAd)
{
mRetryAttemt = 0;
}
@Override
public void onAdLoadFailed(final String adUnitId, final MaxError error)
{
mRetryAttemt++;
long delayMillis = TimeUnit.SECONDS.toMillis( (long) Math.pow( 2, Math.min( 6, mRetryAttemt) ) );
new Handler().postDelayed(() -> mInterstitialAd.loadAd(), delayMillis );
}
@Override
public void onAdDisplayFailed(final MaxAd maxAd, final MaxError error)
{
mInterstitialAd.loadAd();
}
@Override
public void onAdDisplayed(final MaxAd maxAd) {}
@Override
public void onAdClicked(final MaxAd maxAd) {}
@Override
public void onAdHidden(final MaxAd maxAd)
{
mInterstitialAd.loadAd();
}
}

View File

@ -12,9 +12,6 @@ public class orbotLogManager {
private String onGetCleanedLogs(String pLogs) { private String onGetCleanedLogs(String pLogs) {
String logs = pLogs; String logs = pLogs;
if(!status.sAdLoaded){
return "Initializing extentions";
}
if (logs.equals("Starting Orion | Please Wait ...")) { if (logs.equals("Starting Orion | Please Wait ...")) {
return logs; return logs;
} }

View File

@ -1,5 +1,6 @@
package com.hiddenservices.onionservices.pluginManager; package com.hiddenservices.onionservices.pluginManager;
import android.os.Handler;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.ImageView; import android.widget.ImageView;
@ -33,8 +34,7 @@ import java.util.List;
import java.util.Locale; import java.util.Locale;
import static com.hiddenservices.onionservices.constants.enums.etype.fetch_favicon; import static com.hiddenservices.onionservices.constants.enums.etype.fetch_favicon;
import static com.hiddenservices.onionservices.pluginManager.pluginEnums.eAdManagerCallbacks.M_ON_AD_CLICK; import static com.hiddenservices.onionservices.pluginManager.pluginEnums.eAdManagerCallbacks.M_ON_AD_CLICKED;
import static com.hiddenservices.onionservices.pluginManager.pluginEnums.eAdManagerCallbacks.M_ON_AD_HIDE;
import static com.hiddenservices.onionservices.pluginManager.pluginEnums.eAdManagerCallbacks.M_ON_AD_LOAD; import static com.hiddenservices.onionservices.pluginManager.pluginEnums.eAdManagerCallbacks.M_ON_AD_LOAD;
import static com.hiddenservices.onionservices.pluginManager.pluginEnums.eLangManager.M_ACTIVITY_CREATED; import static com.hiddenservices.onionservices.pluginManager.pluginEnums.eLangManager.M_ACTIVITY_CREATED;
import static com.hiddenservices.onionservices.pluginManager.pluginEnums.eLangManager.M_RESUME; import static com.hiddenservices.onionservices.pluginManager.pluginEnums.eLangManager.M_RESUME;
@ -110,13 +110,14 @@ public class pluginController {
private class admobCallback implements eventObserver.eventListener { private class admobCallback implements eventObserver.eventListener {
@Override @Override
public Object invokeObserver(List<Object> data, Object event_type) { public Object invokeObserver(List<Object> data, Object event_type) {
if (event_type.equals(M_ON_AD_CLICK)) { if (event_type.equals(M_ON_AD_LOAD)) {
helperMethod.onMinimizeApp(mHomeController.get());
activityContextManager.getInstance().getHomeController().onAdClicked();
} else if (event_type.equals(M_ON_AD_LOAD)) {
activityContextManager.getInstance().getHomeController().onUpdateBannerAdvert(); activityContextManager.getInstance().getHomeController().onUpdateBannerAdvert();
} else if (event_type.equals(M_ON_AD_HIDE)) { } else if (event_type.equals(M_ON_AD_CLICKED)) {
activityContextManager.getInstance().getHomeController().onAdClicked(); status.sIsBackgroundAdvertCheck = true;
new Handler().postDelayed(() ->
{
status.sIsBackgroundAdvertCheck = false;
}, 5000);
} }
return null; return null;
} }

View File

@ -1,13 +1,14 @@
package com.hiddenservices.onionservices.pluginManager; package com.hiddenservices.onionservices.pluginManager;
public class pluginEnums { public class pluginEnums {
/*Advert Manager*/ /*Advert Manager*/
public enum eAdManager { public enum eAdManager {
M_INITIALIZE_BANNER_ADS, M_IS_ADVERT_LOADED, M_LOW_MEMORY_DESTROY, M_DESTROY, M_HIDE, M_SHOW M_IS_ADVERT_LOADED, M_LOW_MEMORY_DESTROY, M_HIDE_BANNER, M_SHOW_BANNER, M_SHOW_INTERSTITIAL
} }
public enum eAdManagerCallbacks { public enum eAdManagerCallbacks {
M_ON_AD_CLICK, M_ON_AD_LOAD, M_ON_AD_HIDE M_ON_AD_LOAD, M_ON_AD_CLICKED
} }
/*Analytics Manager*/ /*Analytics Manager*/

View File

@ -35,7 +35,6 @@ public class defaultNotificationReciever extends BroadcastReceiver {
protected void onDestroy(Context context) { protected void onDestroy(Context context) {
orbotLocalConstants.mAppForceExit = true; orbotLocalConstants.mAppForceExit = true;
pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_DESTROY);
if (!status.mThemeApplying) { if (!status.mThemeApplying) {
if (!status.sSettingIsAppStarted) { if (!status.sSettingIsAppStarted) {

View File

@ -0,0 +1,7 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M1,11h4v11h-4z"/>
<path android:fillColor="@android:color/white" android:pathData="M16,3.25C16.65,2.49 17.66,2 18.7,2C20.55,2 22,3.45 22,5.3c0,2.27 -2.91,4.9 -6,7.7c-3.09,-2.81 -6,-5.44 -6,-7.7C10,3.45 11.45,2 13.3,2C14.34,2 15.35,2.49 16,3.25z"/>
<path android:fillColor="@android:color/white" android:pathData="M20,17h-7l-2.09,-0.73l0.33,-0.94L13,16h2.82c0.65,0 1.18,-0.53 1.18,-1.18v0c0,-0.49 -0.31,-0.93 -0.77,-1.11L8.97,11H7v9.02L14,22l8.01,-3v0C22,17.9 21.11,17 20,17z"/>
</vector>

View File

@ -463,6 +463,23 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<ImageButton
android:id="@+id/pSupportButton"
android:layout_width="50dp"
android:layout_height="40dp"
android:layout_marginTop="80dp"
android:adjustViewBounds="true"
android:alpha="0.95"
android:background="@xml/hox_rounded_corner_splash_right"
android:contentDescription="@string/GENERAL_TODO"
android:onClick="onSupportSplash"
app:tint="@color/c_setting_icon_tint"
android:padding="6dp"
android:scaleType="fitCenter"
android:src="@xml/ic_baseline_support"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView <TextView
android:id="@+id/pInfo2" android:id="@+id/pInfo2"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -571,6 +588,23 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<ImageButton
android:id="@+id/pSupportLandscape"
android:layout_width="50dp"
android:layout_height="40dp"
android:layout_marginTop="80dp"
android:adjustViewBounds="true"
android:alpha="0.95"
android:background="@xml/hox_rounded_corner_splash_right"
android:contentDescription="@string/GENERAL_TODO"
android:onClick="onSupportSplash"
android:padding="7dp"
android:scaleType="fitCenter"
app:tint="@color/c_setting_icon_tint"
android:src="@xml/ic_baseline_support"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView <ImageView
android:id="@+id/pGenesisLogoBottom" android:id="@+id/pGenesisLogoBottom"
android:layout_width="90dp" android:layout_width="90dp"

View File

@ -51,7 +51,7 @@
android:contentDescription="@string/GENERAL_TODO" android:contentDescription="@string/GENERAL_TODO"
android:onClick="onMenuItemInvoked" android:onClick="onMenuItemInvoked"
android:src="@xml/ic_home" android:src="@xml/ic_home"
android:tint="@color/c_navigation_tint" /> app:tint="@color/c_navigation_tint" />
<ImageButton <ImageButton
android:id="@+id/menu23" android:id="@+id/menu23"
@ -64,7 +64,7 @@
android:scaleX="0.96" android:scaleX="0.96"
android:scaleY="0.96" android:scaleY="0.96"
android:src="@xml/ic_baseline_bookmark" android:src="@xml/ic_baseline_bookmark"
android:tint="@color/c_navigation_tint" /> app:tint="@color/c_navigation_tint" />
<ImageButton <ImageButton
android:id="@+id/menu22" android:id="@+id/menu22"
@ -77,7 +77,7 @@
android:scaleX="0.96" android:scaleX="0.96"
android:scaleY="0.96" android:scaleY="0.96"
android:src="@xml/ic_arrow_right" android:src="@xml/ic_arrow_right"
android:tint="@color/c_navigation_tint" /> app:tint="@color/c_navigation_tint" />
<ImageButton <ImageButton
android:id="@+id/menuItem25" android:id="@+id/menuItem25"
@ -91,7 +91,7 @@
android:paddingTop="1.5dp" android:paddingTop="1.5dp"
android:scaleY="0.96" android:scaleY="0.96"
android:src="@xml/ic_baseline_file_download" android:src="@xml/ic_baseline_file_download"
android:tint="@color/c_navigation_tint" /> app:tint="@color/c_navigation_tint" />
<ImageButton <ImageButton
android:id="@+id/menu21" android:id="@+id/menu21"
@ -104,7 +104,7 @@
android:contentDescription="@string/GENERAL_TODO" android:contentDescription="@string/GENERAL_TODO"
android:onClick="onMenuItemInvoked" android:onClick="onMenuItemInvoked"
android:src="@xml/ic_refresh" android:src="@xml/ic_refresh"
android:tint="@color/c_navigation_tint" /> app:tint="@color/c_navigation_tint" />
<ImageButton <ImageButton
android:id="@+id/menu20" android:id="@+id/menu20"
@ -118,7 +118,7 @@
android:contentDescription="@string/GENERAL_TODO" android:contentDescription="@string/GENERAL_TODO"
android:onClick="onMenuItemInvoked" android:onClick="onMenuItemInvoked"
android:src="@xml/ic_close" android:src="@xml/ic_close"
android:tint="@color/c_navigation_tint" /> app:tint="@color/c_navigation_tint" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
@ -165,6 +165,41 @@
android:layout_marginEnd="15dp" android:layout_marginEnd="15dp"
android:background="@color/c_home_side" /> android:background="@color/c_home_side" />
<LinearLayout
android:id="@+id/menu9"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="1dp"
android:background="@xml/gx_side_item"
android:clickable="true"
android:focusable="true"
android:onClick="onSupport"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:layout_width="21dp"
android:layout_height="match_parent"
android:layout_marginStart="15dp"
android:contentDescription="@string/GENERAL_TODO"
android:src="@xml/ic_baseline_support"
app:tint="@color/c_alert_divider" />
<TextView
android:layout_width="0dp"
android:layout_height="45dp"
android:layout_marginStart="17dp"
android:layout_weight="1"
android:gravity="start|center_vertical"
android:paddingStart="3dp"
android:text="Support Orion Browser"
android:textAllCaps="false"
android:textColor="@color/c_text_home_menu"
android:textSize="15sp"
tools:ignore="RtlHardcoded,RtlSymmetry" />
</LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/menu7" android:id="@+id/menu7"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -18,16 +18,29 @@
<!-- Title Header --> <!-- Title Header -->
<LinearLayout <LinearLayout
android:id="@+id/pHeaderContainerTop" android:id="@+id/pHeaderSupport"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="48dp" android:layout_height="48dp"
android:clickable="true"
android:paddingEnd="0dp"
android:paddingStart="5dp"
android:focusable="true"
android:elevation="8dp"
android:background="@color/c_background" android:background="@color/c_background"
android:clickable="true"
android:elevation="8dp"
android:focusable="true"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingStart="5dp"
android:paddingEnd="0dp"
tools:ignore="RtlSymmetry">
<LinearLayout
android:id="@+id/pHeaderContainerTop"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/c_background"
android:clickable="true"
android:elevation="8dp"
android:focusable="true"
android:orientation="horizontal"
android:paddingStart="5dp"
android:paddingEnd="0dp"
tools:ignore="RtlSymmetry"> tools:ignore="RtlSymmetry">
<ImageButton <ImageButton
@ -45,10 +58,10 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginTop="-3dp" android:layout_marginTop="-3dp"
android:gravity="center_vertical|start"
android:onClick="onNavigationBackPressed"
android:paddingStart="10dp" android:paddingStart="10dp"
android:paddingEnd="10dp" android:paddingEnd="10dp"
android:onClick="onNavigationBackPressed"
android:gravity="center_vertical|start"
android:text="@string/SETTING_HEADER" android:text="@string/SETTING_HEADER"
android:textColor="@color/c_text_v1" android:textColor="@color/c_text_v1"
android:textSize="17sp" android:textSize="17sp"
@ -62,16 +75,102 @@
<ImageView <ImageView
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="40dp" android:layout_height="40dp"
android:paddingStart="8dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:onClick="onOpenInfo"
android:background="@xml/gx_ripple_gray_round_left" android:background="@xml/gx_ripple_gray_round_left"
android:contentDescription="@string/GENERAL_TODO" android:contentDescription="@string/GENERAL_TODO"
android:onClick="onOpenInfo"
android:paddingStart="8dp"
android:src="@xml/ic_info" android:src="@xml/ic_info"
app:tint="@color/c_header_icon_tint" /> app:tint="@color/c_header_icon_tint" />
</LinearLayout> </LinearLayout>
<ImageButton
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_marginStart="0dp"
android:layout_marginTop="1dp"
android:background="@xml/gx_ripple_default_round"
android:contentDescription="@string/GENERAL_TODO"
android:onClick="onNavigationBackPressed"
android:src="@xml/ic_arrow_back"
app:tint="@color/c_navigation_tint" />
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="-3dp"
android:gravity="center_vertical|start"
android:onClick="onNavigationBackPressed"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:text="@string/SETTING_HEADER"
android:textColor="@color/c_text_v1"
android:textSize="17sp"
android:textStyle="bold" />
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
<ImageView
android:layout_width="50dp"
android:layout_height="40dp"
android:layout_gravity="center_vertical"
android:background="@xml/gx_ripple_gray_round_left"
android:contentDescription="@string/GENERAL_TODO"
android:onClick="onOpenInfo"
android:paddingStart="8dp"
android:src="@xml/ic_info"
app:tint="@color/c_header_icon_tint" />
</LinearLayout>
<LinearLayout
android:id="@+id/pSearchSettingOption0"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@xml/gx_ripple_gray"
android:onClick="onSupport"
android:orientation="horizontal"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:contentDescription="@string/GENERAL_TODO"
android:padding="10dp"
android:src="@xml/ic_baseline_support"
app:tint="@color/c_setting_icon_tint" />
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="7"
android:alpha="1"
android:background="@android:color/transparent"
android:clickable="false"
android:paddingEnd="20dp"
android:text="Support Orion Browser"
android:textAlignment="textStart"
android:textAllCaps="false"
android:textColor="@color/c_text_v1"
android:textSize="15sp"
tools:ignore="RtlSymmetry" />
</LinearLayout>
<View
android:id="@+id/view3"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@color/c_orbot_setting_divider" />
<!-- Title Header --> <!-- Title Header -->
<LinearLayout <LinearLayout
android:id="@+id/pSearchSettingOption2" android:id="@+id/pSearchSettingOption2"

View File

@ -0,0 +1 @@
o/jetified-tor-android-runtime