Trackers Completely Removed

Trackers Completely Removed
master
Abdul Mannan Saeed 2023-04-13 13:44:17 +05:00
parent c616d1c7f3
commit f105dbbbe9
13 changed files with 405 additions and 539 deletions

View File

@ -6,11 +6,6 @@ plugins {
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply from: 'variables.gradle' apply from: 'variables.gradle'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply plugin: 'applovin-quality-service'
applovin {
apiKey project.ext.applovin_key
}
android { android {
@ -100,16 +95,6 @@ dependencies {
implementation "org.mozilla.components:concept-base:108.2.0" implementation "org.mozilla.components:concept-base:108.2.0"
implementation "org.mozilla.components:support-utils:108.2.0" implementation "org.mozilla.components:support-utils:108.2.0"
/* Analytics */
implementation 'com.flurry.android:analytics:14.0.0'
/* Ads Manager */
implementation 'com.applovin:applovin-sdk:11.7.0'
implementation 'com.facebook.android:audience-network-sdk:6.12.0'
implementation 'com.applovin.mediation:facebook-adapter:6.12.0.1'
/* Orbot Service */ /* Orbot Service */
implementation project(path: ':orbotmanager') implementation project(path: ':orbotmanager')

View File

@ -268,8 +268,8 @@ public class homeController extends AppCompatActivity implements ComponentCallba
initTor(); initTor();
} }
onMemoryCalculate(); onMemoryCalculate();
pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_INIT_ADS); //pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_INIT_ADS);
mHomeViewController.updateBannerAdvertStatus(true, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED)); //mHomeViewController.updateBannerAdvertStatus(true, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
mHomeViewController.onSessionReinit(); mHomeViewController.onSessionReinit();
if(status.mThemeApplying){ if(status.mThemeApplying){
mGeckoClient.initRestore(mGeckoView, homeController.this); mGeckoClient.initRestore(mGeckoView, homeController.this);
@ -446,15 +446,15 @@ public class homeController extends AppCompatActivity implements ComponentCallba
} }
if (mGeckoClient.getSession().getCurrentURL().equals("about:blank") || mGeckoClient.getSession().getCurrentURL().contains("167.86.99.31") || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED_DARK) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)) { if (mGeckoClient.getSession().getCurrentURL().equals("about:blank") || mGeckoClient.getSession().getCurrentURL().contains("167.86.99.31") || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED_DARK) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)) {
mHomeViewController.updateBannerAdvertStatus(false, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED)); //mHomeViewController.updateBannerAdvertStatus(false, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
mHomeViewController.progressBarReset(); mHomeViewController.progressBarReset();
} else { } else {
mHomeViewController.updateBannerAdvertStatus(true, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED)); //mHomeViewController.updateBannerAdvertStatus(true, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
} }
mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(), false, false, false); mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(), false, false, false);
} else { } else {
if (status.sSettingDefaultSearchEngine.equals(constants.CONST_BACKEND_GENESIS_URL)) { if (status.sSettingDefaultSearchEngine.equals(constants.CONST_BACKEND_GENESIS_URL)) {
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));
} }
} }
mHomeViewController.onFullScreen(true); mHomeViewController.onFullScreen(true);
@ -462,7 +462,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
} }
public void onUpdateBannerAdvert() { public void onUpdateBannerAdvert() {
mHomeViewController.updateBannerAdvertStatus(true, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED)); //mHomeViewController.updateBannerAdvertStatus(true, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
new Handler().postDelayed(() -> new Handler().postDelayed(() ->
{ {
@ -783,7 +783,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
new Handler().postDelayed(() -> new Handler().postDelayed(() ->
{ {
if(status.sSettingIsAppStarted) { if(status.sSettingIsAppStarted) {
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW_BANNER); //pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW_BANNER);
} }
}, 3000); }, 3000);
} }
@ -866,9 +866,9 @@ public class homeController extends AppCompatActivity implements ComponentCallba
} }
if (mGeckoClient.getSession().getCurrentURL().equals("about:blank") || mGeckoClient.getSession().getCurrentURL().contains("167.86.99.31") || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED_DARK) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)) { if (mGeckoClient.getSession().getCurrentURL().equals("about:blank") || mGeckoClient.getSession().getCurrentURL().contains("167.86.99.31") || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED_DARK) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)) {
mHomeViewController.updateBannerAdvertStatus(false, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED)); //mHomeViewController.updateBannerAdvertStatus(false, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
} else { } else {
mHomeViewController.updateBannerAdvertStatus(true, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED)); //mHomeViewController.updateBannerAdvertStatus(true, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
} }
if(pGeneratePixel){ if(pGeneratePixel){
@ -1060,7 +1060,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
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); //pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_LOW_MEMORY_DESTROY);
} }
} }
} }
@ -1092,7 +1092,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
onLowMemoryInvoked(enums.MemoryStatus.MODERATE_MEMORY); onLowMemoryInvoked(enums.MemoryStatus.MODERATE_MEMORY);
break; break;
case TRIM_MEMORY_RUNNING_CRITICAL: case TRIM_MEMORY_RUNNING_CRITICAL:
pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_LOW_MEMORY_DESTROY); //pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_LOW_MEMORY_DESTROY);
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 very low and critical"); Log.i("wow : ", "trim memory requested: memory on device is very low and critical");
onLowMemoryInvoked(enums.MemoryStatus.CRITICAL_MEMORY); onLowMemoryInvoked(enums.MemoryStatus.CRITICAL_MEMORY);
@ -1195,12 +1195,12 @@ public class homeController extends AppCompatActivity implements ComponentCallba
} }
public void onSupport(View view) { public void onSupport(View view) {
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW_INTERSTITIAL); //pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW_INTERSTITIAL);
} }
public void onSupportSplash(View view) { public void onSupportSplash(View view) {
if(!status.sSettingIsAppStarted){ if(!status.sSettingIsAppStarted){
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW_INTERSTITIAL); //pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW_INTERSTITIAL);
} }
} }
@ -1665,7 +1665,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
{ {
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_UPDATE_PIXEL, Arrays.asList(mGeckoClient.getSession().getSessionID(), mRenderedBitmap, null, mGeckoView, false)); dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_UPDATE_PIXEL, Arrays.asList(mGeckoClient.getSession().getSessionID(), mRenderedBitmap, null, mGeckoView, false));
if (status.sSettingDefaultSearchEngine.startsWith("http://167.86.99.31") || !status.sOpenURLInNewTab || mGeckoClient.getSession().getCurrentURL().equals("about:blank") || mGeckoClient.getSession().getCurrentURL().contains("167.86.99.31") || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED_DARK) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)) { if (status.sSettingDefaultSearchEngine.startsWith("http://167.86.99.31") || !status.sOpenURLInNewTab || mGeckoClient.getSession().getCurrentURL().equals("about:blank") || mGeckoClient.getSession().getCurrentURL().contains("167.86.99.31") || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED_DARK) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)) {
mHomeViewController.updateBannerAdvertStatus(false, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED)); //mHomeViewController.updateBannerAdvertStatus(false, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
} }
if (status.sOpenURLInNewTab) { if (status.sOpenURLInNewTab) {
@ -1687,7 +1687,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
public void onNewTabBackground(boolean isKeyboardOpenedTemp, boolean isKeyboardOpened) { public void onNewTabBackground(boolean isKeyboardOpenedTemp, boolean isKeyboardOpened) {
if (status.sSettingDefaultSearchEngine.startsWith("http://167.86.99.31") || !status.sOpenURLInNewTab || mGeckoClient.getSession().getCurrentURL().equals("about:blank") || mGeckoClient.getSession().getCurrentURL().contains("167.86.99.31") || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED_DARK) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)) { if (status.sSettingDefaultSearchEngine.startsWith("http://167.86.99.31") || !status.sOpenURLInNewTab || mGeckoClient.getSession().getCurrentURL().equals("about:blank") || mGeckoClient.getSession().getCurrentURL().contains("167.86.99.31") || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED_DARK) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)) {
mHomeViewController.updateBannerAdvertStatus(false, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED)); //mHomeViewController.updateBannerAdvertStatus(false, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
} }
if (status.sOpenURLInNewTab) { if (status.sOpenURLInNewTab) {
@ -1716,7 +1716,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
onGetThumbnail(null, false); onGetThumbnail(null, false);
mHomeViewController.expandTopBar(false, mGeckoView.getMaxY()); mHomeViewController.expandTopBar(false, mGeckoView.getMaxY());
if (status.sSettingDefaultSearchEngine.startsWith("http://167.86.99.31") || !status.sOpenURLInNewTab || mGeckoClient.getSession().getCurrentURL().equals("about:blank") || mGeckoClient.getSession().getCurrentURL().contains("167.86.99.31") || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED_DARK) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)) { if (status.sSettingDefaultSearchEngine.startsWith("http://167.86.99.31") || !status.sOpenURLInNewTab || mGeckoClient.getSession().getCurrentURL().equals("about:blank") || mGeckoClient.getSession().getCurrentURL().contains("167.86.99.31") || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED_DARK) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)) {
mHomeViewController.updateBannerAdvertStatus(false, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED)); //mHomeViewController.updateBannerAdvertStatus(false, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
} }
mHomeViewController.onNewTabAnimation(Collections.singletonList(url), homeEnums.eHomeViewCallback.M_INITIALIZE_TAB_LINK, 1000, mGeckoClient.getSession().getCurrentURL()); mHomeViewController.onNewTabAnimation(Collections.singletonList(url), homeEnums.eHomeViewCallback.M_INITIALIZE_TAB_LINK, 1000, mGeckoClient.getSession().getCurrentURL());
}, 100); }, 100);
@ -1733,7 +1733,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
onGetThumbnail(null, false); onGetThumbnail(null, false);
mHomeViewController.expandTopBar(false, mGeckoView.getMaxY()); mHomeViewController.expandTopBar(false, mGeckoView.getMaxY());
if (status.sSettingDefaultSearchEngine.startsWith("http://167.86.99.31") || !status.sOpenURLInNewTab || mGeckoClient.getSession().getCurrentURL().equals("about:blank") || mGeckoClient.getSession().getCurrentURL().contains("167.86.99.31") || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED_DARK) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)) { if (status.sSettingDefaultSearchEngine.startsWith("http://167.86.99.31") || !status.sOpenURLInNewTab || mGeckoClient.getSession().getCurrentURL().equals("about:blank") || mGeckoClient.getSession().getCurrentURL().contains("167.86.99.31") || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED_DARK) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)) {
mHomeViewController.updateBannerAdvertStatus(false, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED)); //mHomeViewController.updateBannerAdvertStatus(false, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
} }
mNewTab.setPressed(false); mNewTab.setPressed(false);
@ -1842,10 +1842,10 @@ public class homeController extends AppCompatActivity implements ComponentCallba
} else if (!mGeckoClient.getFullScreenStatus()) { } else if (!mGeckoClient.getFullScreenStatus()) {
mGeckoClient.onExitFullScreen(); mGeckoClient.onExitFullScreen();
if(status.sSettingIsAppStarted){ if(status.sSettingIsAppStarted){
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW_BANNER); //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) {
mHomeViewController.onClearSelections(true); mHomeViewController.onClearSelections(true);
} else if (!mSearchBarWasBackButtonPressed) { } else if (!mSearchBarWasBackButtonPressed) {
@ -1890,21 +1890,21 @@ public class homeController extends AppCompatActivity implements ComponentCallba
final Handler handler = new Handler(); final Handler handler = new Handler();
if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) { if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_HIDE_BANNER); //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()){
if(status.sSettingIsAppStarted){ if(status.sSettingIsAppStarted){
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW_BANNER); //pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW_BANNER);
} }
}else { }else {
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_HIDE_BANNER); //pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_HIDE_BANNER);
} }
mHomeViewController.setOrientation(false); mHomeViewController.setOrientation(false);
mHomeViewController.updateBannerAdvertStatus(true, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED)); //mHomeViewController.updateBannerAdvertStatus(true, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
} }
if (mSplashScreen.getAlpha() > 0) { if (mSplashScreen.getAlpha() > 0) {
mHomeViewController.initSplashOrientation(); mHomeViewController.initSplashOrientation();
@ -1949,7 +1949,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mGeckoClient.onExitFullScreen(); mGeckoClient.onExitFullScreen();
} }
if(status.sSettingIsAppStarted){ if(status.sSettingIsAppStarted){
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW_BANNER); //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);
@ -2157,7 +2157,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
} }
public void onSetBannerAdMargin() { public void onSetBannerAdMargin() {
mHomeViewController.onSetBannerAdMargin(true, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED)); //mHomeViewController.onSetBannerAdMargin(true, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
} }
public void onVoiceClick(View view) { public void onVoiceClick(View view) {
@ -2820,7 +2820,8 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mHomeViewController.onProgressBarUpdate(100, true, false); mHomeViewController.onProgressBarUpdate(100, true, false);
onCloseCurrentTab((geckoSession) data.get(0)); onCloseCurrentTab((geckoSession) data.get(0));
} else if (e_type.equals(homeEnums.eHomeViewCallback.M_ADVERT_LOADED)) { } else if (e_type.equals(homeEnums.eHomeViewCallback.M_ADVERT_LOADED)) {
return pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED); return false;
//return pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED);
} else if (e_type.equals(homeEnums.eHomeViewCallback.M_NEW_LINK_IN_NEW_TAB)) { } else if (e_type.equals(homeEnums.eHomeViewCallback.M_NEW_LINK_IN_NEW_TAB)) {
postNewLinkTabAnimationInBackground(dataToStr(data.get(0))); postNewLinkTabAnimationInBackground(dataToStr(data.get(0)));
} else if (e_type.equals(homeEnums.eHomeViewCallback.M_NEW_LINK_IN_NEW_TAB_LOAD)) { } else if (e_type.equals(homeEnums.eHomeViewCallback.M_NEW_LINK_IN_NEW_TAB_LOAD)) {
@ -2856,20 +2857,20 @@ public class homeController extends AppCompatActivity implements ComponentCallba
postNewLinkTabAnimationOpen((String) data.get(0), false); postNewLinkTabAnimationOpen((String) data.get(0), false);
} }
else if (e_type.equals(homeEnums.eHomeViewCallback.ON_INIT_ADS)) { else if (e_type.equals(homeEnums.eHomeViewCallback.ON_INIT_ADS)) {
mHomeViewController.onSetBannerAdMargin((boolean) data.get(0), (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED)); //mHomeViewController.onSetBannerAdMargin((boolean) data.get(0), (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
} else if (e_type.equals(homeEnums.eHomeViewCallback.ON_FULL_SCREEN_ADS)) { } else if (e_type.equals(homeEnums.eHomeViewCallback.ON_FULL_SCREEN_ADS)) {
if((boolean)data.get(0)){ if((boolean)data.get(0)){
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_HIDE_BANNER); //pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_HIDE_BANNER);
}else { }else {
if(status.sSettingIsAppStarted){ if(status.sSettingIsAppStarted){
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW_BANNER); //pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW_BANNER);
} }
} }
} else if (e_type.equals(homeEnums.eHomeViewCallback.M_ON_BANNER_UPDATE)) { } else if (e_type.equals(homeEnums.eHomeViewCallback.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);
if (mStatus != null) { //if (mStatus != null) {
mHomeViewController.updateBannerAdvertStatus(false, (boolean) mStatus); // mHomeViewController.updateBannerAdvertStatus(false, (boolean) mStatus);
} //}
} else if (e_type.equals(homeEnums.eHomeViewCallback.M_GET_CURRENT_URL)) { } else if (e_type.equals(homeEnums.eHomeViewCallback.M_GET_CURRENT_URL)) {
if (mGeckoClient == null || mGeckoClient.getSession() == null) { if (mGeckoClient == null || mGeckoClient.getSession() == null) {
return null; return null;
@ -3114,11 +3115,11 @@ public class homeController extends AppCompatActivity implements ComponentCallba
} else if (e_type.equals(homeEnums.eGeckoCallback.ON_EXPAND_TOP_BAR)) { } else if (e_type.equals(homeEnums.eGeckoCallback.ON_EXPAND_TOP_BAR)) {
mHomeViewController.expandTopBar(false, mGeckoView.getMaxY()); mHomeViewController.expandTopBar(false, mGeckoView.getMaxY());
} else if (e_type.equals(homeEnums.eGeckoCallback.M_ON_BANNER_UPDATE)) { } else if (e_type.equals(homeEnums.eGeckoCallback.M_ON_BANNER_UPDATE)) {
Object mAdvertResponse = pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED); //Object mAdvertResponse = pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED);
if (mAdvertResponse != null) { // if (mAdvertResponse != null) {
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getTheme(), true); // mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getTheme(), true);
mHomeViewController.updateBannerAdvertStatus((boolean) data.get(3), (boolean) mAdvertResponse); // mHomeViewController.updateBannerAdvertStatus((boolean) data.get(3), (boolean) mAdvertResponse);
} //}
} else if (e_type.equals(homeEnums.eGeckoCallback.PROGRESS_UPDATE)) { } else if (e_type.equals(homeEnums.eGeckoCallback.PROGRESS_UPDATE)) {
mHomeViewController.onProgressBarUpdate((int) data.get(0), false, isStaticURL()); mHomeViewController.onProgressBarUpdate((int) data.get(0), false, isStaticURL());
} else if (e_type.equals(homeEnums.eGeckoCallback.M_LOAD_HOMEPAGE_GENESIS)) { } else if (e_type.equals(homeEnums.eGeckoCallback.M_LOAD_HOMEPAGE_GENESIS)) {
@ -3200,7 +3201,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_BANNER); //pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_HIDE_BANNER);
} else if (e_type.equals(homeEnums.eGeckoCallback.ON_UPDATE_FAVICON)) { } else if (e_type.equals(homeEnums.eGeckoCallback.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

@ -1112,8 +1112,8 @@ public class homeViewController {
if (mBannerAds.getAlpha() == 0) { if (mBannerAds.getAlpha() == 0) {
mBannerAds.animate().cancel(); mBannerAds.animate().cancel();
mBannerAds.setAlpha(0); mBannerAds.setAlpha(0);
mBannerAds.animate().alpha(1); mBannerAds.animate().alpha(0);
mBannerAds.setVisibility(View.VISIBLE); mBannerAds.setVisibility(View.GONE);
} }
onSetBannerAdMargin(true, true); onSetBannerAdMargin(true, true);
} else if (mBannerAds.getVisibility() != View.VISIBLE) { } else if (mBannerAds.getVisibility() != View.VISIBLE) {

View File

@ -120,7 +120,7 @@ public class settingHomeController extends AppCompatActivity {
} }
public void onSupport(View view) { public void onSupport(View view) {
pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW_INTERSTITIAL); //pluginController.getInstance().onAdsInvoke(Collections.singletonList(this), pluginEnums.eAdManager.M_SHOW_INTERSTITIAL);
} }
/*View Callbacks*/ /*View Callbacks*/

View File

@ -1,83 +1,83 @@
package com.hiddenservices.onionservices.pluginManager.adPluginManager; //package com.hiddenservices.onionservices.pluginManager.adPluginManager;
//
import android.view.View; //import android.view.View;
import com.applovin.sdk.AppLovinSdk; //import com.applovin.sdk.AppLovinSdk;
import com.hiddenservices.onionservices.eventObserver; //import com.hiddenservices.onionservices.eventObserver;
import com.hiddenservices.onionservices.pluginManager.pluginEnums; //import com.hiddenservices.onionservices.pluginManager.pluginEnums;
import androidx.appcompat.app.AppCompatActivity; //import androidx.appcompat.app.AppCompatActivity;
//
public class appLovinManager { //public class appLovinManager {
//
/*Private Variables */ // /*Private Variables */
//
private eventObserver.eventListener mEvent; // private eventObserver.eventListener mEvent;
private applovinSupportManager mSupportManager; // private applovinSupportManager mSupportManager;
private applovinBannerManager mBannerManager; // private applovinBannerManager mBannerManager;
private AppCompatActivity mContext; // private AppCompatActivity mContext;
//
private boolean mLowMemoryReached = false; // private boolean mLowMemoryReached = false;
//
/*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.mContext = pContext; // this.mContext = pContext;
} // }
//
private void onInitializeAdvertisement() { // private void onInitializeAdvertisement() {
if(!mLowMemoryReached){ // if(!mLowMemoryReached){
AppLovinSdk.getInstance(mContext).getSettings().setVerboseLogging(true); // AppLovinSdk.getInstance(mContext).getSettings().setVerboseLogging(true);
AppLovinSdk.getInstance(mContext).setMediationProvider("max"); // AppLovinSdk.getInstance(mContext).setMediationProvider("max");
AppLovinSdk.initializeSdk(mContext, configuration -> { // AppLovinSdk.initializeSdk(mContext, configuration -> {
if(!mLowMemoryReached){ // if(!mLowMemoryReached){
this.mSupportManager = new applovinSupportManager(mContext); // this.mSupportManager = new applovinSupportManager(mContext);
this.mBannerManager = new applovinBannerManager(mContext, mEvent); // this.mBannerManager = new applovinBannerManager(mContext, mEvent);
} // }
}); // });
} // }
} // }
//
/*Local Helper Methods*/ // /*Local Helper Methods*/
//
private void onShowInterstitial() { // private void onShowInterstitial() {
if(AppLovinSdk.getInstance(mContext).isInitialized() && this.mSupportManager!=null){ // if(AppLovinSdk.getInstance(mContext).isInitialized() && this.mSupportManager!=null){
this.mSupportManager.onShow(); // this.mSupportManager.onShow();
} // }
} // }
//
private void onToggleBannerShow(boolean pStatus) { // private void onToggleBannerShow(boolean pStatus) {
if(AppLovinSdk.getInstance(mContext).isInitialized() && this.mBannerManager!=null){ // if(AppLovinSdk.getInstance(mContext).isInitialized() && this.mBannerManager!=null){
this.mBannerManager.onShowToggle(pStatus); // this.mBannerManager.onShowToggle(pStatus);
} // }
} // }
//
/*Helper Methods*/ // /*Helper Methods*/
//
private void onDestroy() { // private void onDestroy() {
mLowMemoryReached = true; // mLowMemoryReached = true;
if(mBannerManager!=null){ // if(mBannerManager!=null){
mBannerManager.onDestroy(); // mBannerManager.onDestroy();
} // }
} // }
//
/*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)) {
onDestroy(); // onDestroy();
} else if (pEventType.equals(pluginEnums.eAdManager.M_IS_ADVERT_LOADED)) { // } else if (pEventType.equals(pluginEnums.eAdManager.M_IS_ADVERT_LOADED)) {
return true; // return true;
} else if (pEventType.equals(pluginEnums.eAdManager.M_SHOW_BANNER)) { // } else if (pEventType.equals(pluginEnums.eAdManager.M_SHOW_BANNER)) {
onToggleBannerShow(true); // onToggleBannerShow(true);
} else if (pEventType.equals(pluginEnums.eAdManager.M_HIDE_BANNER)) { // } else if (pEventType.equals(pluginEnums.eAdManager.M_HIDE_BANNER)) {
onToggleBannerShow(false); // onToggleBannerShow(false);
} else if (pEventType.equals(pluginEnums.eAdManager.M_SHOW_INTERSTITIAL)) { // } else if (pEventType.equals(pluginEnums.eAdManager.M_SHOW_INTERSTITIAL)) {
onShowInterstitial(); // onShowInterstitial();
} else if (pEventType.equals(pluginEnums.eAdManager.M_INIT_ADS)) { // } else if (pEventType.equals(pluginEnums.eAdManager.M_INIT_ADS)) {
onInitializeAdvertisement(); // onInitializeAdvertisement();
} // }
return null; // return null;
} // }
//
} //}
//

View File

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

View File

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

View File

@ -1,42 +1,42 @@
package com.hiddenservices.onionservices.pluginManager.analyticPluginManager; //package com.hiddenservices.onionservices.pluginManager.analyticPluginManager;
//
import androidx.appcompat.app.AppCompatActivity; //import androidx.appcompat.app.AppCompatActivity;
//
import com.hiddenservices.onionservices.eventObserver; //import com.hiddenservices.onionservices.eventObserver;
import com.hiddenservices.onionservices.pluginManager.pluginEnums; //import com.hiddenservices.onionservices.pluginManager.pluginEnums;
import com.flurry.android.FlurryAgent; //import com.flurry.android.FlurryAgent;
//
import java.lang.ref.WeakReference; //import java.lang.ref.WeakReference;
import java.util.List; //import java.util.List;
//
public class analyticManager { //public class analyticManager {
/*Private Variables*/ // /*Private Variables*/
//
private WeakReference<AppCompatActivity> mAppContext; // private WeakReference<AppCompatActivity> mAppContext;
//
/*Initializations*/ // /*Initializations*/
//
public analyticManager(WeakReference<AppCompatActivity> pAppContext, eventObserver.eventListener pEvent) { // public analyticManager(WeakReference<AppCompatActivity> pAppContext, eventObserver.eventListener pEvent) {
this.mAppContext = pAppContext; // this.mAppContext = pAppContext;
//
initialize(); // initialize();
} // }
//
private void initialize() { // private void initialize() {
new FlurryAgent.Builder().withLogEnabled(false).build(mAppContext.get(), "ND6QCR4JSHSJ25VWC8DN"); // new FlurryAgent.Builder().withLogEnabled(false).build(mAppContext.get(), "ND6QCR4JSHSJ25VWC8DN");
} // }
//
/*External Triggers*/ // /*External Triggers*/
//
private void logEvent(String pValue) { // private void logEvent(String pValue) {
if (FlurryAgent.isSessionActive()) { // if (FlurryAgent.isSessionActive()) {
FlurryAgent.logEvent(pValue); // FlurryAgent.logEvent(pValue);
} // }
} // }
//
public void onTrigger(List<Object> pData, pluginEnums.eAnalyticManager pEventType) { // public void onTrigger(List<Object> pData, pluginEnums.eAnalyticManager pEventType) {
if (pEventType.equals(pluginEnums.eAnalyticManager.M_LOG_EVENT)) { // if (pEventType.equals(pluginEnums.eAnalyticManager.M_LOG_EVENT)) {
logEvent((String) pData.get(0)); // logEvent((String) pData.get(0));
} // }
} // }
} //}

View File

@ -1,7 +1,5 @@
package com.hiddenservices.onionservices.pluginManager; package com.hiddenservices.onionservices.pluginManager;
import android.Manifest;
import android.content.ActivityNotFoundException;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
@ -10,7 +8,6 @@ import android.widget.ImageView;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import com.hiddenservices.onionservices.appManager.activityContextManager; import com.hiddenservices.onionservices.appManager.activityContextManager;
import com.hiddenservices.onionservices.appManager.homeManager.geckoManager.helperClasses.permissionHandler; import com.hiddenservices.onionservices.appManager.homeManager.geckoManager.helperClasses.permissionHandler;
import com.hiddenservices.onionservices.appManager.homeManager.homeController.homeEnums;
import com.hiddenservices.onionservices.appManager.unproxiedConnectionManager.unproxiedConnectionController; import com.hiddenservices.onionservices.appManager.unproxiedConnectionManager.unproxiedConnectionController;
import com.hiddenservices.onionservices.appManager.homeManager.homeController.homeController; import com.hiddenservices.onionservices.appManager.homeManager.homeController.homeController;
import com.hiddenservices.onionservices.appManager.orbotLogManager.orbotLogController; import com.hiddenservices.onionservices.appManager.orbotLogManager.orbotLogController;
@ -22,25 +19,16 @@ import com.hiddenservices.onionservices.dataManager.dataController;
import com.hiddenservices.onionservices.dataManager.dataEnums; import com.hiddenservices.onionservices.dataManager.dataEnums;
import com.hiddenservices.onionservices.eventObserver; import com.hiddenservices.onionservices.eventObserver;
import com.hiddenservices.onionservices.helperManager.helperMethod; import com.hiddenservices.onionservices.helperManager.helperMethod;
import com.hiddenservices.onionservices.pluginManager.adPluginManager.appLovinManager;
import com.hiddenservices.onionservices.pluginManager.analyticPluginManager.analyticManager;
import com.hiddenservices.onionservices.pluginManager.downloadPluginManager.downloadManager; import com.hiddenservices.onionservices.pluginManager.downloadPluginManager.downloadManager;
import com.hiddenservices.onionservices.pluginManager.langPluginManager.langManager; import com.hiddenservices.onionservices.pluginManager.langPluginManager.langManager;
import com.hiddenservices.onionservices.pluginManager.messagePluginManager.messageManager; import com.hiddenservices.onionservices.pluginManager.messagePluginManager.messageManager;
import com.hiddenservices.onionservices.pluginManager.orbotPluginManager.orbotManager; import com.hiddenservices.onionservices.pluginManager.orbotPluginManager.orbotManager;
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 java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;
import static com.hiddenservices.onionservices.constants.constants.CONST_BRIDGES; import static com.hiddenservices.onionservices.constants.constants.CONST_BRIDGES;
import static com.hiddenservices.onionservices.pluginManager.pluginEnums.eAdManagerCallbacks.M_ON_AD_CLICKED; 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 static com.hiddenservices.onionservices.pluginManager.pluginEnums.eAdManagerCallbacks.M_ON_AD_LOAD;
@ -55,8 +43,8 @@ import static com.hiddenservices.onionservices.pluginManager.pluginEnums.eMessag
public class pluginController { public class pluginController {
/*Plugin Instance*/ /*Plugin Instance*/
private appLovinManager mAdManager; //private appLovinManager mAdManager;
private analyticManager mAnalyticsManager; //private analyticManager mAnalyticsManager;
private messageManager mMessageManager; private messageManager mMessageManager;
private activityContextManager mContextManager; private activityContextManager mContextManager;
private langManager mLangManager; private langManager mLangManager;
@ -92,8 +80,8 @@ public class pluginController {
mHomeController = new WeakReference(activityContextManager.getInstance().getHomeController()); mHomeController = new WeakReference(activityContextManager.getInstance().getHomeController());
mContextManager = activityContextManager.getInstance(); mContextManager = activityContextManager.getInstance();
mAdManager = new appLovinManager(new admobCallback(), ((homeController) mHomeController.get()).getBannerAd(), mHomeController.get()); //mAdManager = new appLovinManager(new admobCallback(), ((homeController) mHomeController.get()).getBannerAd(), mHomeController.get());
mAnalyticsManager = new analyticManager(mHomeController, new analyticCallback()); //mAnalyticsManager = new analyticManager(mHomeController, new analyticCallback());
mMessageManager = new messageManager(new messageCallback()); mMessageManager = new messageManager(new messageCallback());
mOrbotManager = orbotManager.getInstance(); mOrbotManager = orbotManager.getInstance();
mDownloadManager = new downloadManager(mHomeController, new downloadCallback()); mDownloadManager = new downloadManager(mHomeController, new downloadCallback());
@ -113,45 +101,45 @@ public class pluginController {
/*------------------------------------------------ CALLBACK LISTENERS------------------------------------------------------------*/ /*------------------------------------------------ CALLBACK LISTENERS------------------------------------------------------------*/
/*Ad Manager*/ /*Ad Manager*/
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_LOAD)) { // if (event_type.equals(M_ON_AD_LOAD)) {
activityContextManager.getInstance().getHomeController().onUpdateBannerAdvert(); // activityContextManager.getInstance().getHomeController().onUpdateBannerAdvert();
} else if (event_type.equals(M_ON_AD_CLICKED)) { // } else if (event_type.equals(M_ON_AD_CLICKED)) {
status.sIsBackgroundAdvertCheck = true; // status.sIsBackgroundAdvertCheck = true;
new Handler().postDelayed(() -> // new Handler().postDelayed(() ->
{ // {
status.sIsBackgroundAdvertCheck = false; // status.sIsBackgroundAdvertCheck = false;
}, 5000); // }, 5000);
} // }
return null; // return null;
} // }
} // }
public Object onAdsInvoke(List<Object> pData, pluginEnums.eAdManager pEventType) { //public Object onAdsInvoke(List<Object> pData, pluginEnums.eAdManager pEventType) {
if (mAdManager != null) { //if (mAdManager != null) {
return mAdManager.onTrigger(pEventType); // return mAdManager.onTrigger(pEventType);
} //}
return null; //return null;
} //}
/*Analytics Manager*/ /*Analytics Manager*/
private class analyticCallback implements eventObserver.eventListener { //private class analyticCallback implements eventObserver.eventListener {
@Override // @Override
public Object invokeObserver(List<Object> data, Object event_type) { // public Object invokeObserver(List<Object> data, Object event_type) {
return null; // return null;
} //}
} //}
public void onAnalyticsInvoke(List<Object> pData, pluginEnums.eAnalyticManager pEventType) { //public void onAnalyticsInvoke(List<Object> pData, pluginEnums.eAnalyticManager pEventType) {
if (mAnalyticsManager != null) { //if (mAnalyticsManager != null) {
mAnalyticsManager.onTrigger(pData, pEventType); // mAnalyticsManager.onTrigger(pData, pEventType);
} //}
} //}
/*Download Manager*/ /*Download Manager*/
private class downloadCallback implements eventObserver.eventListener { private class downloadCallback implements eventObserver.eventListener {

View File

@ -11,7 +11,7 @@
<View <View
android:id="@+id/adView" android:id="@+id/adView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="50dp" android:layout_height="1dp"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
@ -484,6 +484,7 @@
android:contentDescription="@string/GENERAL_TODO" android:contentDescription="@string/GENERAL_TODO"
android:onClick="onSupportSplash" android:onClick="onSupportSplash"
android:padding="6dp" android:padding="6dp"
android:visibility="gone"
android:scaleType="fitCenter" android:scaleType="fitCenter"
android:src="@xml/ic_baseline_support" android:src="@xml/ic_baseline_support"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
@ -615,6 +616,7 @@
android:contentDescription="@string/GENERAL_TODO" android:contentDescription="@string/GENERAL_TODO"
android:onClick="onSupportSplash" android:onClick="onSupportSplash"
android:padding="7dp" android:padding="7dp"
android:visibility="gone"
android:scaleType="fitCenter" android:scaleType="fitCenter"
app:tint="@color/c_setting_icon_tint" app:tint="@color/c_setting_icon_tint"
android:src="@xml/ic_baseline_support" android:src="@xml/ic_baseline_support"

View File

@ -171,7 +171,7 @@
android:layout_marginEnd="15dp" android:layout_marginEnd="15dp"
android:background="@color/c_home_side" /> android:background="@color/c_home_side" />
<LinearLayout <!--<LinearLayout
android:id="@+id/menu9" android:id="@+id/menu9"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -207,7 +207,7 @@
android:textColor="@color/c_text_home_menu" android:textColor="@color/c_text_home_menu"
android:textSize="15sp" android:textSize="15sp"
tools:ignore="RtlHardcoded,RtlSymmetry" /> tools:ignore="RtlHardcoded,RtlSymmetry" />
</LinearLayout> </LinearLayout>-->
<LinearLayout <LinearLayout
android:id="@+id/menu7" android:id="@+id/menu7"

View File

@ -128,44 +128,6 @@
</LinearLayout> </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="@string/GENERAL_SUPPORT_ORION_BROWSER"
android:textAlignment="textStart"
android:textAllCaps="false"
android:textColor="@color/c_text_v1"
android:textSize="15sp"
tools:ignore="RtlSymmetry" />
</LinearLayout>
<View <View
android:id="@+id/view4" android:id="@+id/view4"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -292,76 +254,6 @@
android:layout_height="0dp" android:layout_height="0dp"
android:background="@color/c_orbot_setting_divider" /> android:background="@color/c_orbot_setting_divider" />
<LinearLayout
android:id="@+id/pSearchSettingOption4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:background="@xml/gx_ripple_gray"
android:onClick="onManageSearchEngine"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:padding="10dp"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
app:tint="@color/c_setting_icon_tint"
android:src="@xml/ic_baseline_search"
android:contentDescription="@string/GENERAL_TODO" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="6"
android:clickable="false"
android:orientation="vertical">
<Button
android:layout_width="match_parent"
android:textAlignment="textStart"
android:layout_height="20dp"
android:alpha="1"
android:background="@android:color/transparent"
android:clickable="false"
android:padding="0dp"
android:text="@string/SETTING_SEARCH"
android:textAllCaps="false"
android:textColor="@color/c_text_v1"
android:textSize="15sp"
tools:ignore="RtlSymmetry" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:alpha="1"
android:background="@android:color/transparent"
android:clickable="false"
android:padding="0dp"
android:text="@string/SETTING_SEARCH_INFO"
android:textAlignment="textStart"
android:textAllCaps="false"
android:textColor="#757575"
android:textSize="13.5sp"
tools:ignore="RtlSymmetry" />
</LinearLayout>
<ImageButton
android:layout_width="45dp"
android:layout_height="match_parent"
android:background="@android:color/transparent"
android:contentDescription="@string/GENERAL_TODO"
android:clickable="false"
android:layout_marginEnd="5dp"
android:src="@xml/ic_arrow_right"
app:tint="@color/c_navigation_tint" />
</LinearLayout>
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"

View File

@ -8,7 +8,6 @@ buildscript {
google() google()
mavenCentral() mavenCentral()
mavenLocal() mavenLocal()
maven { url 'https://artifacts.applovin.com/android' }
maven { url "https://maven.mozilla.org/maven2" } maven { url "https://maven.mozilla.org/maven2" }
maven { url "https://nightly.maven.mozilla.org/maven2" } maven { url "https://nightly.maven.mozilla.org/maven2" }
} }
@ -17,7 +16,6 @@ buildscript {
classpath 'com.android.tools.build:gradle:7.4.2' classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.google.gms:google-services:4.3.15' classpath 'com.google.gms:google-services:4.3.15'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.0" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.0"
classpath "com.applovin.quality:AppLovinQualityServiceGradlePlugin:+"
} }
} }