From f105dbbbe9a30c58d13083bf00e882c60bafce3e Mon Sep 17 00:00:00 2001 From: Abdul Mannan Saeed <111820160@umt.edu.pk> Date: Thu, 13 Apr 2023 13:44:17 +0500 Subject: [PATCH] Trackers Completely Removed Trackers Completely Removed --- app/build.gradle | 15 -- .../homeController/homeController.java | 79 +++--- .../homeController/homeViewController.java | 4 +- .../settingHomeController.java | 2 +- .../adPluginManager/appLovinManager.java | 166 ++++++------- .../applovinBannerManager.java | 230 +++++++++--------- .../applovinSupportManager.java | 162 ++++++------ .../analyticManager.java | 84 +++---- .../pluginManager/pluginController.java | 84 +++---- .../res/layouts/home/layout/home_view.xml | 4 +- .../layouts/home/layout/popup_side_menu.xml | 4 +- .../res/layouts/setting/layout/setting.xml | 108 -------- build.gradle | 2 - 13 files changed, 405 insertions(+), 539 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 9f86536c..4ca6108e 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,11 +6,6 @@ plugins { apply plugin: 'com.android.application' apply from: 'variables.gradle' apply plugin: 'kotlin-android' -apply plugin: 'applovin-quality-service' - -applovin { - apiKey project.ext.applovin_key -} android { @@ -100,16 +95,6 @@ dependencies { implementation "org.mozilla.components:concept-base: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 */ implementation project(path: ':orbotmanager') diff --git a/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/homeController/homeController.java b/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/homeController/homeController.java index 20883894..62d99c6d 100644 --- a/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/homeController/homeController.java +++ b/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/homeController/homeController.java @@ -268,8 +268,8 @@ public class homeController extends AppCompatActivity implements ComponentCallba initTor(); } onMemoryCalculate(); - pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_INIT_ADS); - mHomeViewController.updateBannerAdvertStatus(true, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED)); + //pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_INIT_ADS); + //mHomeViewController.updateBannerAdvertStatus(true, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED)); mHomeViewController.onSessionReinit(); if(status.mThemeApplying){ 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)) { - 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(); } 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); } else { 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); @@ -462,7 +462,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba } 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(() -> { @@ -783,7 +783,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba new Handler().postDelayed(() -> { 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); } @@ -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)) { - 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 { - 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){ @@ -1060,7 +1060,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_CLOSE_TAB_LOW_MEMORY, null); Log.i("wow : ", "trim memory requested: memory on device is running low"); 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); break; 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); Log.i("wow : ", "trim memory requested: memory on device is very low and critical"); onLowMemoryInvoked(enums.MemoryStatus.CRITICAL_MEMORY); @@ -1195,12 +1195,12 @@ public class homeController extends AppCompatActivity implements ComponentCallba } 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) { 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)); 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) { @@ -1687,7 +1687,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba public void onNewTabBackground(boolean isKeyboardOpenedTemp, boolean isKeyboardOpened) { if (status.sSettingDefaultSearchEngine.startsWith("http://167.86.99.31") || !status.sOpenURLInNewTab || mGeckoClient.getSession().getCurrentURL().equals("about:blank") || mGeckoClient.getSession().getCurrentURL().contains("167.86.99.31") || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED_DARK) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)) { - mHomeViewController.updateBannerAdvertStatus(false, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED)); + //mHomeViewController.updateBannerAdvertStatus(false, (boolean) pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED)); } if (status.sOpenURLInNewTab) { @@ -1716,7 +1716,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba onGetThumbnail(null, false); 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)) { - 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()); }, 100); @@ -1733,7 +1733,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba onGetThumbnail(null, false); 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)) { - 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); @@ -1842,10 +1842,10 @@ public class homeController extends AppCompatActivity implements ComponentCallba } else if (!mGeckoClient.getFullScreenStatus()) { mGeckoClient.onExitFullScreen(); 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.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) { mHomeViewController.onClearSelections(true); } else if (!mSearchBarWasBackButtonPressed) { @@ -1890,21 +1890,21 @@ public class homeController extends AppCompatActivity implements ComponentCallba final Handler handler = new Handler(); 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.removeBanner(); } else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) { if(mGeckoClient.getFullScreenStatus()){ 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 { - 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.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) { mHomeViewController.initSplashOrientation(); @@ -1949,7 +1949,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba mGeckoClient.onExitFullScreen(); } 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); pluginController.getInstance().onMessageManagerInvoke(null, M_RESET); @@ -2157,7 +2157,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba } 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) { @@ -2820,7 +2820,8 @@ public class homeController extends AppCompatActivity implements ComponentCallba mHomeViewController.onProgressBarUpdate(100, true, false); onCloseCurrentTab((geckoSession) data.get(0)); } 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)) { postNewLinkTabAnimationInBackground(dataToStr(data.get(0))); } 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); } 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)) { 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 { 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)) { - Object mStatus = pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED); - if (mStatus != null) { - mHomeViewController.updateBannerAdvertStatus(false, (boolean) mStatus); - } + //Object mStatus = pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED); + //if (mStatus != null) { + // mHomeViewController.updateBannerAdvertStatus(false, (boolean) mStatus); + //} } else if (e_type.equals(homeEnums.eHomeViewCallback.M_GET_CURRENT_URL)) { if (mGeckoClient == null || mGeckoClient.getSession() == 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)) { mHomeViewController.expandTopBar(false, mGeckoView.getMaxY()); } else if (e_type.equals(homeEnums.eGeckoCallback.M_ON_BANNER_UPDATE)) { - Object mAdvertResponse = pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED); - if (mAdvertResponse != null) { - mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getTheme(), true); - mHomeViewController.updateBannerAdvertStatus((boolean) data.get(3), (boolean) mAdvertResponse); - } + //Object mAdvertResponse = pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED); + // if (mAdvertResponse != null) { + // mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getTheme(), true); + // mHomeViewController.updateBannerAdvertStatus((boolean) data.get(3), (boolean) mAdvertResponse); + //} } else if (e_type.equals(homeEnums.eGeckoCallback.PROGRESS_UPDATE)) { mHomeViewController.onProgressBarUpdate((int) data.get(0), false, isStaticURL()); } 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.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)) { //dataController.getInstance().invokeImage(dataEnums.eImageCommands.M_REQUEST_IMAGE_URL, Collections.singletonList(data.get(0))); } else if (e_type.equals(M_LONG_PRESS_WITH_LINK)) { diff --git a/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/homeController/homeViewController.java b/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/homeController/homeViewController.java index 32066530..2719786e 100644 --- a/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/homeController/homeViewController.java +++ b/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/homeController/homeViewController.java @@ -1112,8 +1112,8 @@ public class homeViewController { if (mBannerAds.getAlpha() == 0) { mBannerAds.animate().cancel(); mBannerAds.setAlpha(0); - mBannerAds.animate().alpha(1); - mBannerAds.setVisibility(View.VISIBLE); + mBannerAds.animate().alpha(0); + mBannerAds.setVisibility(View.GONE); } onSetBannerAdMargin(true, true); } else if (mBannerAds.getVisibility() != View.VISIBLE) { diff --git a/app/src/main/java/com/hiddenservices/onionservices/appManager/settingManager/settingHomeManager/settingHomeController.java b/app/src/main/java/com/hiddenservices/onionservices/appManager/settingManager/settingHomeManager/settingHomeController.java index f050d967..73721e21 100644 --- a/app/src/main/java/com/hiddenservices/onionservices/appManager/settingManager/settingHomeManager/settingHomeController.java +++ b/app/src/main/java/com/hiddenservices/onionservices/appManager/settingManager/settingHomeManager/settingHomeController.java @@ -120,7 +120,7 @@ public class settingHomeController extends AppCompatActivity { } 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*/ diff --git a/app/src/main/java/com/hiddenservices/onionservices/pluginManager/adPluginManager/appLovinManager.java b/app/src/main/java/com/hiddenservices/onionservices/pluginManager/adPluginManager/appLovinManager.java index ae44276f..cb25e12c 100644 --- a/app/src/main/java/com/hiddenservices/onionservices/pluginManager/adPluginManager/appLovinManager.java +++ b/app/src/main/java/com/hiddenservices/onionservices/pluginManager/adPluginManager/appLovinManager.java @@ -1,83 +1,83 @@ -package com.hiddenservices.onionservices.pluginManager.adPluginManager; - -import android.view.View; -import com.applovin.sdk.AppLovinSdk; -import com.hiddenservices.onionservices.eventObserver; -import com.hiddenservices.onionservices.pluginManager.pluginEnums; -import androidx.appcompat.app.AppCompatActivity; - -public class appLovinManager { - - /*Private Variables */ - - private eventObserver.eventListener mEvent; - private applovinSupportManager mSupportManager; - private applovinBannerManager mBannerManager; - private AppCompatActivity mContext; - - private boolean mLowMemoryReached = false; - - /*Initializations*/ - - public appLovinManager(eventObserver.eventListener pEvent, View pBannerAds, AppCompatActivity pContext) { - this.mEvent = pEvent; - this.mContext = pContext; - } - - private void onInitializeAdvertisement() { - if(!mLowMemoryReached){ - AppLovinSdk.getInstance(mContext).getSettings().setVerboseLogging(true); - AppLovinSdk.getInstance(mContext).setMediationProvider("max"); - AppLovinSdk.initializeSdk(mContext, configuration -> { - if(!mLowMemoryReached){ - this.mSupportManager = new applovinSupportManager(mContext); - this.mBannerManager = new applovinBannerManager(mContext, mEvent); - } - }); - } - } - - /*Local Helper Methods*/ - - private void onShowInterstitial() { - if(AppLovinSdk.getInstance(mContext).isInitialized() && this.mSupportManager!=null){ - this.mSupportManager.onShow(); - } - } - - private void onToggleBannerShow(boolean pStatus) { - if(AppLovinSdk.getInstance(mContext).isInitialized() && this.mBannerManager!=null){ - this.mBannerManager.onShowToggle(pStatus); - } - } - - /*Helper Methods*/ - - private void onDestroy() { - mLowMemoryReached = true; - if(mBannerManager!=null){ - mBannerManager.onDestroy(); - } - } - - /*External Triggers*/ - - public Object onTrigger(pluginEnums.eAdManager pEventType) { - if (pEventType.equals(pluginEnums.eAdManager.M_LOW_MEMORY_DESTROY)) { - onDestroy(); - } else if (pEventType.equals(pluginEnums.eAdManager.M_IS_ADVERT_LOADED)) { - return true; - } else if (pEventType.equals(pluginEnums.eAdManager.M_SHOW_BANNER)) { - onToggleBannerShow(true); - } else if (pEventType.equals(pluginEnums.eAdManager.M_HIDE_BANNER)) { - onToggleBannerShow(false); - } else if (pEventType.equals(pluginEnums.eAdManager.M_SHOW_INTERSTITIAL)) { - onShowInterstitial(); - } else if (pEventType.equals(pluginEnums.eAdManager.M_INIT_ADS)) { - onInitializeAdvertisement(); - } - return null; - } - -} - +//package com.hiddenservices.onionservices.pluginManager.adPluginManager; +// +//import android.view.View; +//import com.applovin.sdk.AppLovinSdk; +//import com.hiddenservices.onionservices.eventObserver; +//import com.hiddenservices.onionservices.pluginManager.pluginEnums; +//import androidx.appcompat.app.AppCompatActivity; +// +//public class appLovinManager { +// +// /*Private Variables */ +// +// private eventObserver.eventListener mEvent; +// private applovinSupportManager mSupportManager; +// private applovinBannerManager mBannerManager; +// private AppCompatActivity mContext; +// +// private boolean mLowMemoryReached = false; +// +// /*Initializations*/ +// +// public appLovinManager(eventObserver.eventListener pEvent, View pBannerAds, AppCompatActivity pContext) { +// this.mEvent = pEvent; +// this.mContext = pContext; +// } +// +// private void onInitializeAdvertisement() { +// if(!mLowMemoryReached){ +// AppLovinSdk.getInstance(mContext).getSettings().setVerboseLogging(true); +// AppLovinSdk.getInstance(mContext).setMediationProvider("max"); +// AppLovinSdk.initializeSdk(mContext, configuration -> { +// if(!mLowMemoryReached){ +// this.mSupportManager = new applovinSupportManager(mContext); +// this.mBannerManager = new applovinBannerManager(mContext, mEvent); +// } +// }); +// } +// } +// +// /*Local Helper Methods*/ +// +// private void onShowInterstitial() { +// if(AppLovinSdk.getInstance(mContext).isInitialized() && this.mSupportManager!=null){ +// this.mSupportManager.onShow(); +// } +// } +// +// private void onToggleBannerShow(boolean pStatus) { +// if(AppLovinSdk.getInstance(mContext).isInitialized() && this.mBannerManager!=null){ +// this.mBannerManager.onShowToggle(pStatus); +// } +// } +// +// /*Helper Methods*/ +// +// private void onDestroy() { +// mLowMemoryReached = true; +// if(mBannerManager!=null){ +// mBannerManager.onDestroy(); +// } +// } +// +// /*External Triggers*/ +// +// public Object onTrigger(pluginEnums.eAdManager pEventType) { +// if (pEventType.equals(pluginEnums.eAdManager.M_LOW_MEMORY_DESTROY)) { +// onDestroy(); +// } else if (pEventType.equals(pluginEnums.eAdManager.M_IS_ADVERT_LOADED)) { +// return true; +// } else if (pEventType.equals(pluginEnums.eAdManager.M_SHOW_BANNER)) { +// onToggleBannerShow(true); +// } else if (pEventType.equals(pluginEnums.eAdManager.M_HIDE_BANNER)) { +// onToggleBannerShow(false); +// } else if (pEventType.equals(pluginEnums.eAdManager.M_SHOW_INTERSTITIAL)) { +// onShowInterstitial(); +// } else if (pEventType.equals(pluginEnums.eAdManager.M_INIT_ADS)) { +// onInitializeAdvertisement(); +// } +// return null; +// } +// +//} +// diff --git a/app/src/main/java/com/hiddenservices/onionservices/pluginManager/adPluginManager/applovinBannerManager.java b/app/src/main/java/com/hiddenservices/onionservices/pluginManager/adPluginManager/applovinBannerManager.java index 655ba47a..437f3e71 100644 --- a/app/src/main/java/com/hiddenservices/onionservices/pluginManager/adPluginManager/applovinBannerManager.java +++ b/app/src/main/java/com/hiddenservices/onionservices/pluginManager/adPluginManager/applovinBannerManager.java @@ -1,115 +1,115 @@ -package com.hiddenservices.onionservices.pluginManager.adPluginManager; - -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_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 = APPLOVIN_BANNER_KEY; - private MaxAdView mBanner; - private 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 onShowToggle(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 if (mBanner!=null){ - mBanner.stopAutoRefresh(); - mBanner.clearAnimation(); - mBanner.setAlpha(1); - mBanner.setVisibility(View.VISIBLE); - mBanner.animate().setDuration(250).alpha(0).setStartDelay(0).withEndAction(() -> { - if(mBanner!=null){ - 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) { - } - -} +//package com.hiddenservices.onionservices.pluginManager.adPluginManager; +// +//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_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 = APPLOVIN_BANNER_KEY; +// private MaxAdView mBanner; +// private 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 onShowToggle(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 if (mBanner!=null){ +// mBanner.stopAutoRefresh(); +// mBanner.clearAnimation(); +// mBanner.setAlpha(1); +// mBanner.setVisibility(View.VISIBLE); +// mBanner.animate().setDuration(250).alpha(0).setStartDelay(0).withEndAction(() -> { +// if(mBanner!=null){ +// 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) { +// } +// +//} diff --git a/app/src/main/java/com/hiddenservices/onionservices/pluginManager/adPluginManager/applovinSupportManager.java b/app/src/main/java/com/hiddenservices/onionservices/pluginManager/adPluginManager/applovinSupportManager.java index c0a6508c..4a89cca0 100644 --- a/app/src/main/java/com/hiddenservices/onionservices/pluginManager/adPluginManager/applovinSupportManager.java +++ b/app/src/main/java/com/hiddenservices/onionservices/pluginManager/adPluginManager/applovinSupportManager.java @@ -1,81 +1,81 @@ -package com.hiddenservices.onionservices.pluginManager.adPluginManager; - -import static com.hiddenservices.onionservices.constants.keys.APPLOVIN_SUPPORT_KEY; - -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 = APPLOVIN_SUPPORT_KEY; - 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(); - } -} +//package com.hiddenservices.onionservices.pluginManager.adPluginManager; +// +//import static com.hiddenservices.onionservices.constants.keys.APPLOVIN_SUPPORT_KEY; +// +//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 = APPLOVIN_SUPPORT_KEY; +// 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(); +// } +//} diff --git a/app/src/main/java/com/hiddenservices/onionservices/pluginManager/analyticPluginManager/analyticManager.java b/app/src/main/java/com/hiddenservices/onionservices/pluginManager/analyticPluginManager/analyticManager.java index 28734848..38cc6fcf 100644 --- a/app/src/main/java/com/hiddenservices/onionservices/pluginManager/analyticPluginManager/analyticManager.java +++ b/app/src/main/java/com/hiddenservices/onionservices/pluginManager/analyticPluginManager/analyticManager.java @@ -1,42 +1,42 @@ -package com.hiddenservices.onionservices.pluginManager.analyticPluginManager; - -import androidx.appcompat.app.AppCompatActivity; - -import com.hiddenservices.onionservices.eventObserver; -import com.hiddenservices.onionservices.pluginManager.pluginEnums; -import com.flurry.android.FlurryAgent; - -import java.lang.ref.WeakReference; -import java.util.List; - -public class analyticManager { - /*Private Variables*/ - - private WeakReference mAppContext; - - /*Initializations*/ - - public analyticManager(WeakReference pAppContext, eventObserver.eventListener pEvent) { - this.mAppContext = pAppContext; - - initialize(); - } - - private void initialize() { - new FlurryAgent.Builder().withLogEnabled(false).build(mAppContext.get(), "ND6QCR4JSHSJ25VWC8DN"); - } - - /*External Triggers*/ - - private void logEvent(String pValue) { - if (FlurryAgent.isSessionActive()) { - FlurryAgent.logEvent(pValue); - } - } - - public void onTrigger(List pData, pluginEnums.eAnalyticManager pEventType) { - if (pEventType.equals(pluginEnums.eAnalyticManager.M_LOG_EVENT)) { - logEvent((String) pData.get(0)); - } - } -} +//package com.hiddenservices.onionservices.pluginManager.analyticPluginManager; +// +//import androidx.appcompat.app.AppCompatActivity; +// +//import com.hiddenservices.onionservices.eventObserver; +//import com.hiddenservices.onionservices.pluginManager.pluginEnums; +//import com.flurry.android.FlurryAgent; +// +//import java.lang.ref.WeakReference; +//import java.util.List; +// +//public class analyticManager { +// /*Private Variables*/ +// +// private WeakReference mAppContext; +// +// /*Initializations*/ +// +// public analyticManager(WeakReference pAppContext, eventObserver.eventListener pEvent) { +// this.mAppContext = pAppContext; +// +// initialize(); +// } +// +// private void initialize() { +// new FlurryAgent.Builder().withLogEnabled(false).build(mAppContext.get(), "ND6QCR4JSHSJ25VWC8DN"); +// } +// +// /*External Triggers*/ +// +// private void logEvent(String pValue) { +// if (FlurryAgent.isSessionActive()) { +// FlurryAgent.logEvent(pValue); +// } +// } +// +// public void onTrigger(List pData, pluginEnums.eAnalyticManager pEventType) { +// if (pEventType.equals(pluginEnums.eAnalyticManager.M_LOG_EVENT)) { +// logEvent((String) pData.get(0)); +// } +// } +//} diff --git a/app/src/main/java/com/hiddenservices/onionservices/pluginManager/pluginController.java b/app/src/main/java/com/hiddenservices/onionservices/pluginManager/pluginController.java index 74574e09..e7ca982d 100644 --- a/app/src/main/java/com/hiddenservices/onionservices/pluginManager/pluginController.java +++ b/app/src/main/java/com/hiddenservices/onionservices/pluginManager/pluginController.java @@ -1,7 +1,5 @@ package com.hiddenservices.onionservices.pluginManager; -import android.Manifest; -import android.content.ActivityNotFoundException; import android.content.Intent; import android.os.Bundle; import android.os.Handler; @@ -10,7 +8,6 @@ import android.widget.ImageView; import androidx.appcompat.app.AppCompatActivity; import com.hiddenservices.onionservices.appManager.activityContextManager; 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.homeManager.homeController.homeController; 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.eventObserver; 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.langPluginManager.langManager; import com.hiddenservices.onionservices.pluginManager.messagePluginManager.messageManager; 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.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Locale; import java.util.concurrent.Callable; - 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_LOAD; @@ -55,8 +43,8 @@ import static com.hiddenservices.onionservices.pluginManager.pluginEnums.eMessag public class pluginController { /*Plugin Instance*/ - private appLovinManager mAdManager; - private analyticManager mAnalyticsManager; + //private appLovinManager mAdManager; + //private analyticManager mAnalyticsManager; private messageManager mMessageManager; private activityContextManager mContextManager; private langManager mLangManager; @@ -92,8 +80,8 @@ public class pluginController { mHomeController = new WeakReference(activityContextManager.getInstance().getHomeController()); mContextManager = activityContextManager.getInstance(); - mAdManager = new appLovinManager(new admobCallback(), ((homeController) mHomeController.get()).getBannerAd(), mHomeController.get()); - mAnalyticsManager = new analyticManager(mHomeController, new analyticCallback()); + //mAdManager = new appLovinManager(new admobCallback(), ((homeController) mHomeController.get()).getBannerAd(), mHomeController.get()); + //mAnalyticsManager = new analyticManager(mHomeController, new analyticCallback()); mMessageManager = new messageManager(new messageCallback()); mOrbotManager = orbotManager.getInstance(); mDownloadManager = new downloadManager(mHomeController, new downloadCallback()); @@ -113,45 +101,45 @@ public class pluginController { /*------------------------------------------------ CALLBACK LISTENERS------------------------------------------------------------*/ /*Ad Manager*/ - private class admobCallback implements eventObserver.eventListener { - @Override - public Object invokeObserver(List data, Object event_type) { - if (event_type.equals(M_ON_AD_LOAD)) { - activityContextManager.getInstance().getHomeController().onUpdateBannerAdvert(); - } else if (event_type.equals(M_ON_AD_CLICKED)) { - status.sIsBackgroundAdvertCheck = true; - new Handler().postDelayed(() -> - { - status.sIsBackgroundAdvertCheck = false; - }, 5000); - } - return null; - } - } +// private class admobCallback implements eventObserver.eventListener { +// @Override +// public Object invokeObserver(List data, Object event_type) { +// if (event_type.equals(M_ON_AD_LOAD)) { +// activityContextManager.getInstance().getHomeController().onUpdateBannerAdvert(); +// } else if (event_type.equals(M_ON_AD_CLICKED)) { +// status.sIsBackgroundAdvertCheck = true; +// new Handler().postDelayed(() -> +// { +// status.sIsBackgroundAdvertCheck = false; +// }, 5000); +// } +// return null; +// } +// } - public Object onAdsInvoke(List pData, pluginEnums.eAdManager pEventType) { + //public Object onAdsInvoke(List pData, pluginEnums.eAdManager pEventType) { - if (mAdManager != null) { - return mAdManager.onTrigger(pEventType); - } + //if (mAdManager != null) { + // return mAdManager.onTrigger(pEventType); + //} - return null; - } + //return null; + //} /*Analytics Manager*/ - private class analyticCallback implements eventObserver.eventListener { - @Override - public Object invokeObserver(List data, Object event_type) { - return null; - } - } + //private class analyticCallback implements eventObserver.eventListener { + // @Override + // public Object invokeObserver(List data, Object event_type) { + // return null; + //} + //} - public void onAnalyticsInvoke(List pData, pluginEnums.eAnalyticManager pEventType) { - if (mAnalyticsManager != null) { - mAnalyticsManager.onTrigger(pData, pEventType); - } - } + //public void onAnalyticsInvoke(List pData, pluginEnums.eAnalyticManager pEventType) { + //if (mAnalyticsManager != null) { + // mAnalyticsManager.onTrigger(pData, pEventType); + //} + //} /*Download Manager*/ private class downloadCallback implements eventObserver.eventListener { diff --git a/app/src/main/res/layouts/home/layout/home_view.xml b/app/src/main/res/layouts/home/layout/home_view.xml index 1ddc30b8..4fd38858 100644 --- a/app/src/main/res/layouts/home/layout/home_view.xml +++ b/app/src/main/res/layouts/home/layout/home_view.xml @@ -11,7 +11,7 @@ - - + --> - - - - -