Bug Fixes

Bug Fixes
master
Abdul Mannan Saeed 2022-04-19 00:50:40 -07:00
parent b434a62b26
commit ed6967bdfa
5 changed files with 32 additions and 24 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -570,6 +570,19 @@ public class geckoClients
} }
} }
public void onReloadDelay(NestedGeckoView mNestedGeckoView, AppCompatActivity pcontext, boolean isThemeCall){
new Handler().postDelayed(() ->
{
mSession.stop();
String url = mSession.getCurrentURL();
if(url.startsWith("http://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion/?pG") || url.startsWith("https://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion?pG") || url.endsWith("trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion") || url.contains(constants.CONST_GENESIS_HELP_URL_SUB) || url.contains(constants.CONST_GENESIS_HELP_URL_CACHE) || url.contains(constants.CONST_GENESIS_HELP_URL_CACHE_DARK)){
loadURL(mSession.getCurrentURL(), mNestedGeckoView, pcontext);
}else if(!isThemeCall){
mSession.reload();
}
}, 1000);
}
public void onReloadStatic(NestedGeckoView mNestedGeckoView, AppCompatActivity pcontext){ public void onReloadStatic(NestedGeckoView mNestedGeckoView, AppCompatActivity pcontext){
///mSession.stop(); ///mSession.stop();
loadURL(mSession.getCurrentURL(), mNestedGeckoView, pcontext); loadURL(mSession.getCurrentURL(), mNestedGeckoView, pcontext);

View File

@ -1588,7 +1588,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
if(status.sSettingIsAppStarted && !status.mThemeApplying){ if(status.sSettingIsAppStarted && !status.mThemeApplying){
if(mGeckoClient.getSession().wasPreviousErrorPage()){ if(mGeckoClient.getSession().wasPreviousErrorPage()){
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_NEW_CIRCUIT); pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_NEW_CIRCUIT);
mGeckoClient.onReload(mGeckoView, this, false); mGeckoClient.onReloadDelay(mGeckoView, this, false);
} }
} }
@ -1965,7 +1965,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
{ {
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_NEW_CIRCUIT); pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_NEW_CIRCUIT);
pluginController.getInstance().onMessageManagerInvoke(Collections.singletonList(this), M_NEW_IDENTITY); pluginController.getInstance().onMessageManagerInvoke(Collections.singletonList(this), M_NEW_IDENTITY);
mGeckoClient.onReload(mGeckoView, this, false); mGeckoClient.onReloadDelay(mGeckoView, this, false);
onLoadURL(mSearchbar.getText().toString()); onLoadURL(mSearchbar.getText().toString());
} }
else if (menuId == R.id.pMenuOpenCurrentTab) else if (menuId == R.id.pMenuOpenCurrentTab)
@ -2705,7 +2705,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
else if(e_type.equals(enums.etype.M_NEW_IDENTITY_MESSAGED)){ else if(e_type.equals(enums.etype.M_NEW_IDENTITY_MESSAGED)){
pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_NEW_CIRCUIT); pluginController.getInstance().onOrbotInvoke(null, pluginEnums.eOrbotManager.M_NEW_CIRCUIT);
pluginController.getInstance().onMessageManagerInvoke(Collections.singletonList(homeController.this), M_NEW_IDENTITY); pluginController.getInstance().onMessageManagerInvoke(Collections.singletonList(homeController.this), M_NEW_IDENTITY);
mGeckoClient.onReload(mGeckoView, homeController.this, false); mGeckoClient.onReloadDelay(mGeckoView, homeController.this, false);
} }
else if(e_type.equals(enums.etype.M_INDEX_WEBSITE)){ else if(e_type.equals(enums.etype.M_INDEX_WEBSITE)){
dataController.getInstance().invokeCrawler(dataEnums.eCrawlerCommands.M_INDEX_URL, data); dataController.getInstance().invokeCrawler(dataEnums.eCrawlerCommands.M_INDEX_URL, data);

View File

@ -1027,27 +1027,22 @@ public class OrbotService extends VpnService implements OrbotConstants {
} }
public void newIdentity() { public void newIdentity() {
//it is possible to not have a connection yet, and someone might try to newnym if (conn == null) return;
if (conn != null) { new Thread() {
new Thread() { public void run() {
public void run() { try {
try { if (conn != null && mCurrentStatus.equals(STATUS_ON)) {
if (conn != null && mCurrentStatus.equals(STATUS_ON)) mNotifyBuilder.setSubText(null); // clear previous exit node info if present
showToolbarNotification(getString(R.string.newnym), NOTIFY_ID, R.drawable.ic_stat_starting_tor_logo); showToolbarNotification(getString(R.string.newnym), NOTIFY_ID, R.drawable.ic_stat_starting_tor_logo);
conn.signal(TorControlCommands.SIGNAL_NEWNYM); conn.signal(TorControlCommands.SIGNAL_NEWNYM);
sleep(1000);
if(mConnectivity)
enableNotification();
} catch (Exception ioe) {
debug("error requesting newnym: " + ioe.getLocalizedMessage());
} }
} catch (Exception ioe) {
debug("error requesting newnym: " + ioe.getLocalizedMessage());
} }
}.start(); }
} }.start();
} }
protected void sendCallbackBandwidth(long lastWritten, long lastRead, long totalWritten, long totalRead) { protected void sendCallbackBandwidth(long lastWritten, long lastRead, long totalWritten, long totalRead) {
Intent intent = new Intent(LOCAL_ACTION_BANDWIDTH); Intent intent = new Intent(LOCAL_ACTION_BANDWIDTH);