Bug Fixes

Bug Fixes
master
Abdul Mannan Saeed 2022-08-22 18:51:56 +05:00
parent edcd452fcc
commit 8dd19543ca
10 changed files with 87 additions and 57 deletions

View File

@ -7,11 +7,11 @@
<deviceKey>
<Key>
<type value="VIRTUAL_DEVICE_PATH" />
<value value="C:\Users\msman\.android\avd\Pixel_4_API_31_2.avd" />
<value value="C:\Users\msman\.android\avd\Pixel_2_API_33.avd" />
</Key>
</deviceKey>
</Target>
</targetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2022-08-18T13:09:12.710571200Z" />
<timeTargetWasSelectedWithDropDown value="2022-08-21T18:03:56.258272500Z" />
</component>
</project>

View File

@ -108,9 +108,9 @@ dependencies {
/* Ads Manager */
implementation 'com.facebook.android:audience-network-sdk:6.8.0'
implementation 'com.applovin:applovin-sdk:11.3.1'
implementation 'com.applovin.mediation:facebook-adapter:6.8.0.12'
implementation 'com.applovin:applovin-sdk:+'
implementation 'com.applovin.mediation:mytarget-adapter:+'
implementation 'com.adcolony:sdk:4.8.0'
/* Orbot Service */

View File

@ -80,10 +80,17 @@ public class activityContextManager {
}
public homeController getHomeController() {
if (pHomeController == null) {
helperMethod.onStartApplication(pApplicationContext.get(), CONST_PACKAGE_NAME);
try {
if (pHomeController == null) {
if(pApplicationContext == null){
return null;
}
helperMethod.onStartApplication(pApplicationContext.get(), CONST_PACKAGE_NAME);
}
return pHomeController.get();
}catch (Exception ex){
return null;
}
return pHomeController.get();
}
public void setApplicationContext(Context pContext) {

View File

@ -45,7 +45,7 @@ public class externalURLNavigationContoller extends AppCompatActivity {
return;
}
status.sExternalWebsiteLoading = true;
if (mData.toString().contains("applovin")) {
if (mData!=null && mData.toString().contains("applovin")) {
Intent myIntent = new Intent(this, advertController.class);
myIntent.putExtra(keys.ADVERT_URL, mData.toString());
myIntent.addFlags(FLAG_ACTIVITY_NO_ANIMATION);

View File

@ -144,7 +144,12 @@ final class geckoPromptView implements GeckoSession.PromptDelegate {
builder.setPositiveButton("Resend", listener);
builder.setNegativeButton("Cancel", listener);
createStandardDialog(builder, prompt, res).show();
try {
if(!((Activity) builder.getContext()).isFinishing())
{
createStandardDialog(builder, prompt, res).show();
}
}catch (Exception ex){}
return res;
}
@ -517,7 +522,12 @@ final class geckoPromptView implements GeckoSession.PromptDelegate {
} else {
throw new UnsupportedOperationException();
}
dialog.show();
try {
if(!((Activity) builder.getContext()).isFinishing())
{
dialog.show();
}
}catch (Exception ex){}
}
@Override

View File

@ -912,6 +912,9 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mSearchbar.setOnEditorActionListener((v, actionId, event) ->
{
if (actionId == EditorInfo.IME_ACTION_NEXT || actionId == EditorInfo.IME_ACTION_GO || actionId == EditorInfo.IME_ACTION_DONE) {
if(mGeckoClient == null || mGeckoClient.getSession() == null){
return false;
}
onSearchBarInvoked(v);
if (!mSearchBarPreviousText.equals(mSearchbar.getText())) {
mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(), false, true, false);
@ -1740,11 +1743,15 @@ public class homeController extends AppCompatActivity implements ComponentCallba
public void onStartApplication(View view) {
if (!mStateService) {
mStateService = true;
if (!isMyServiceRunning(activityStateManager.class)) {
new Handler().postDelayed(() ->
{
startService(new Intent(this, activityStateManager.class));
}, 500);
try{
if (!isMyServiceRunning(activityStateManager.class)) {
new Handler().postDelayed(() ->
{
startService(new Intent(this, activityStateManager.class));
}, 500);
}
}catch (Exception ex){
}
}

View File

@ -3,12 +3,14 @@ package com.hiddenservices.onionservices.pluginManager.adPluginManager;
import android.content.Context;
import android.os.Handler;
import com.adcolony.sdk.AdColony;
import com.adcolony.sdk.AdColonyAppOptions;
import com.applovin.mediation.MaxAd;
import com.applovin.mediation.MaxAdViewAdListener;
import com.applovin.mediation.MaxError;
import com.applovin.mediation.ads.MaxAdView;
import com.applovin.sdk.AppLovinSdk;
import com.facebook.ads.AdSettings;
import com.hiddenservices.onionservices.appManager.activityContextManager;
import com.hiddenservices.onionservices.eventObserver;
import com.hiddenservices.onionservices.pluginManager.pluginEnums;
@ -23,7 +25,6 @@ public class appLovinManager implements MaxAdViewAdListener {
private WeakReference<MaxAdView> mBannerAds;
private int mRequestCount = 0;
private boolean bannerAdsLoaded = false;
private boolean bannerAdRequested = false;
/*Initializations*/
@ -35,7 +36,9 @@ public class appLovinManager implements MaxAdViewAdListener {
}
private void initializeBannerAds(Context pContext) {
AdSettings.setDataProcessingOptions(new String[]{});
AdColonyAppOptions appOptions = new AdColonyAppOptions();
AdColony.configure(activityContextManager.getInstance().getHomeController(), appOptions,"app3b56c67c45544c5c89");
AppLovinSdk.getInstance(pContext).setMediationProvider("max");
AppLovinSdk.initializeSdk(pContext, configuration -> {
});
@ -69,7 +72,6 @@ public class appLovinManager implements MaxAdViewAdListener {
@Override
public void onAdLoaded(MaxAd ad) {
bannerAdsLoaded = true;
mEvent.invokeObserver(null, M_ON_AD_LOAD);
}

View File

@ -1,6 +1,6 @@
/* Version */
project.ext.vname = 'Build | Dark-Origin 1.0.5.5'
project.ext.vcode = 400
project.ext.vname = 'Build | Dark-Origin 1.0.5.6'
project.ext.vcode = 405
project.ext.buildType = 'release'
/* dimension */

View File

@ -3,3 +3,4 @@ android.enableJetifier=true
kotlin.code.style=official
org.gradle.jvmargs=-Xmx5048M
android.disableAutomaticComponentCreation=true
android.bundle.enableUncompressedNativeLibs=false

View File

@ -421,37 +421,26 @@ public class OrbotService extends VpnService implements OrbotConstants {
isDestroyed=true;
}
private void stopTorAsync(boolean showNotification) {
debug("stopTor");
private void stopTorAsync(boolean notification) {
if (showNotification) sendCallbackLogMessage(getString(R.string.status_shutting_down));
Log.i("OrbotService", "stopTor");
try {
sendCallbackLogMessage(getString(R.string.status_shutting_down));
if (Prefs.bridgesEnabled()) {
if (useIPtObfsMeekProxy())
IPtProxy.stopObfs4Proxy();
else if (useIPtSnowflakeProxyDomainFronting())
IPtProxy.stopSnowflake();
}
else if (Prefs.beSnowflakeProxy())
disableSnowflakeProxy();
stopTor();
showToolbarNotification(getString(R.string.status_starting_up), NOTIFY_ID, R.drawable.ic_stat_starting_tor_logo);
//stop the foreground priority and make sure to remove the persistent notification
stopForeground(!showNotification);
if (showNotification) sendCallbackLogMessage(getString(R.string.status_disabled));
mPortDns = -1;
mPortSOCKS = -1;
mPortHTTP = -1;
mPortTrans = -1;
if (!showNotification) {
clearNotifications();
stopSelf();
stopTor();
//stop the foreground priority and make sure to remove the persistant notification
stopForeground(true);
sendCallbackLogMessage(getString(R.string.status_disabled));
} catch (Exception e) {
logNotice("An error occured stopping Tor: " + e.getMessage());
sendCallbackLogMessage(getString(R.string.something_bad_happened));
}
clearNotifications();
}
private void stopTorOnError(String message) {
@ -539,13 +528,25 @@ public class OrbotService extends VpnService implements OrbotConstants {
}
// if someone stops during startup, we may have to wait for the conn port to be setup, so we can properly shutdown tor
private void stopTor() {
if (shouldUnbindTorService) {
unbindService(torServiceConnection); //unbinding from the tor service will stop tor
shouldUnbindTorService = false;
conn = null;
} else {
sendLocalStatusOffBroadcast();
private synchronized void stopTor() throws Exception {
if (conn != null) {
logNotice("Using control port to shutdown Tor");
try {
logNotice("sending HALT signal to Tor process");
conn.shutdownTor(TorControlCommands.SIGNAL_SHUTDOWN);
if (shouldUnbindTorService) {
unbindService(torServiceConnection);
shouldUnbindTorService = false;
}
conn = null;
} catch (IOException e) {
Log.d(OrbotConstants.TAG, "error shutting down Tor via connection", e);
}
}
}
@ -1638,7 +1639,9 @@ public class OrbotService extends VpnService implements OrbotConstants {
}
case CMD_SETTING: {
onSettingRegister();
sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));
try{
sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));
}catch (Exception ex){}
break;
}
case ACTION_STATUS: {