Skip to content

Commit

Permalink
Avoid accidental "Skip to Homepage" in release build
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahmud0808 committed Sep 8, 2023
1 parent 78dca89 commit 81655d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class SplashActivity extends AppCompatActivity {
private final Runnable runner = () -> Shell.getShell(shell -> {
Intent intent;

if (SKIP_TO_HOMEPAGE_FOR_TESTING_PURPOSES || (RootUtil.deviceProperlyRooted() && ModuleUtil.moduleProperlyInstalled() && BuildConfig.VERSION_CODE == SystemUtil.getSavedVersionCode())) {
if ((SKIP_TO_HOMEPAGE_FOR_TESTING_PURPOSES && BuildConfig.DEBUG) || (RootUtil.deviceProperlyRooted() && ModuleUtil.moduleProperlyInstalled() && BuildConfig.VERSION_CODE == SystemUtil.getSavedVersionCode())) {
keepShowing = false;
intent = new Intent(SplashActivity.this, HomePage.class);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import androidx.fragment.app.FragmentTransaction;

import com.airbnb.lottie.LottieCompositionFactory;
import com.drdisagree.iconify.BuildConfig;
import com.drdisagree.iconify.R;
import com.drdisagree.iconify.config.Prefs;
import com.drdisagree.iconify.databinding.ActivityHomePageBinding;
Expand Down Expand Up @@ -87,7 +88,7 @@ else if (Objects.equals(FragmentHelper.getTopFragment(fragmentManager), FRAGMENT
Thread thread1 = new Thread(runnable1);
thread1.start();

if (!SKIP_TO_HOMEPAGE_FOR_TESTING_PURPOSES && Build.VERSION.SDK_INT >= 33 && ContextCompat.checkSelfPermission(this, Manifest.permission.POST_NOTIFICATIONS) != PackageManager.PERMISSION_GRANTED) {
if (!(SKIP_TO_HOMEPAGE_FOR_TESTING_PURPOSES && BuildConfig.DEBUG) && Build.VERSION.SDK_INT >= 33 && ContextCompat.checkSelfPermission(this, Manifest.permission.POST_NOTIFICATIONS) != PackageManager.PERMISSION_GRANTED) {
new Handler(Looper.getMainLooper()).postDelayed(() -> {
requestPermissions(new String[]{Manifest.permission.POST_NOTIFICATIONS}, 0);
}, 2000);
Expand Down

0 comments on commit 81655d6

Please sign in to comment.