Skip to content

Commit

Permalink
Rolled token resolution back.
Browse files Browse the repository at this point in the history
  • Loading branch information
oldestlivingboy committed Oct 28, 2024
1 parent 045693f commit 7a3d8e0
Showing 1 changed file with 32 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ public class MainActivity extends AppCompatActivity {
static final String RETRIEVED_ACCOUNT_PREF = "retrieved_account";
static final int REQUEST_PERMISSION_GET_ACCOUNTS = 1;
static final int REQUEST_CODE_ACCOUNT_INTENT = 2;
boolean hasSamsungBrowser = false;
boolean isLogoAnimating = false;
Typeface bodyFont;
Typeface emphasisFont;
ImageButton logoButton;
TextView statusText;
TextView hintText;
Dialog dialog;
boolean isLogoAnimating = false;
boolean hasSamsungBrowser = false;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand Down Expand Up @@ -360,10 +360,7 @@ void presentHelp(Runnable continuationHandler) {
editor.putBoolean(SHOULD_OVERRIDE_BROWSER_DETECTION_KEY, true).apply();
help.dismiss();
Plausible.INSTANCE.event("Override", "/samsung-browser", "", null);
presentHelp(() -> {
editor.putBoolean(IS_FIRST_RUN_KEY, false).apply();
AdblockFastApplication.init(this);
});
presentHelp(() -> editor.putBoolean(IS_FIRST_RUN_KEY, false).apply());
});
}

Expand Down Expand Up @@ -406,22 +403,19 @@ Dialog presentDialog(int id) {
if (dialog != null && dialog.isShowing()) dialog.dismiss();

dialog = new Dialog(this);
Window window = dialog.getWindow();

if (!isDestroyed() && !isFinishing()) {
Window window = dialog.getWindow();

if (window != null) {
window.getAttributes().windowAnimations = R.style.Animation;
if (window != null) {
window.getAttributes().windowAnimations = R.style.Animation;

window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
}

dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(id);
dialog.setCancelable(false);
dialog.show();
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
}

dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(id);
dialog.setCancelable(false);
if (!isDestroyed() && !isFinishing()) dialog.show();

return dialog;
}

Expand Down Expand Up @@ -588,7 +582,10 @@ void onboardUser() {
AdblockFastApplication.init(this);
});
} else {
presentHelp(() -> getOnBackPressedDispatcher().onBackPressed());
presentHelp(() -> {
AdblockFastApplication.init(this);
getOnBackPressedDispatcher().onBackPressed();
});
}
});
} else {
Expand All @@ -598,7 +595,10 @@ void onboardUser() {
AdblockFastApplication.init(this);
});
} else {
presentHelp(() -> getOnBackPressedDispatcher().onBackPressed());
presentHelp(() -> {
AdblockFastApplication.init(this);
getOnBackPressedDispatcher().onBackPressed();
});
}
}
});
Expand All @@ -613,7 +613,10 @@ void onboardUser() {
AdblockFastApplication.init(this);
});
} else {
presentHelp(() -> getOnBackPressedDispatcher().onBackPressed());
presentHelp(() -> {
AdblockFastApplication.init(this);
getOnBackPressedDispatcher().onBackPressed();
});
}
});
} else {
Expand All @@ -623,14 +626,20 @@ void onboardUser() {
AdblockFastApplication.init(this);
});
} else {
presentHelp(() -> getOnBackPressedDispatcher().onBackPressed());
presentHelp(() -> {
AdblockFastApplication.init(this);
getOnBackPressedDispatcher().onBackPressed();
});
}
}
} else if (
!hasSamsungBrowser &&
!prefs.getBoolean(SHOULD_OVERRIDE_BROWSER_DETECTION_KEY, false)
) {
presentHelp(() -> getOnBackPressedDispatcher().onBackPressed());
presentHelp(() -> {
AdblockFastApplication.init(this);
getOnBackPressedDispatcher().onBackPressed();
});
}
}

Expand Down

0 comments on commit 7a3d8e0

Please sign in to comment.