Skip to content

Commit

Permalink
fix(YouTube - Check environment patch): Allow adb installs even if pa…
Browse files Browse the repository at this point in the history
…tched more than 30 minutes ago
  • Loading branch information
LisoUseInAIKyrios committed Sep 6, 2024
1 parent 5f6239b commit 5adf8bd
Showing 1 changed file with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ private static class CheckIsNearPatchTime extends Check {
*/
long durationBetweenPatchingAndInstallation;

@NonNull
@Override
protected Boolean check() {
try {
Expand All @@ -214,7 +213,8 @@ protected Boolean check() {
}

// User installed more than 30 minutes after patching.
return false;
// Don't fail this, to allow adb install of older patched apps.
return null;
}

@Override
Expand Down Expand Up @@ -273,15 +273,17 @@ public static void check(Activity context) {

CheckIsNearPatchTime nearPatchTime = new CheckIsNearPatchTime();
Boolean timeCheckPassed = nearPatchTime.check();
if (timeCheckPassed && !DEBUG_ALWAYS_SHOW_CHECK_FAILED_DIALOG) {
if (failedChecks.isEmpty()) {
// Recently patched and installed. No further checks are needed.
// Stopping here also prevents showing warnings if patching and installing with Termux.
Check.disableForever();
return;
if (timeCheckPassed != null) {
if (timeCheckPassed && !DEBUG_ALWAYS_SHOW_CHECK_FAILED_DIALOG) {
if (failedChecks.isEmpty()) {
// Recently patched and installed. No further checks are needed.
// Stopping here also prevents showing warnings if patching and installing with Termux.
Check.disableForever();
return;
}
} else {
failedChecks.add(nearPatchTime);
}
} else {
failedChecks.add(nearPatchTime);
}

CheckExpectedInstaller installerCheck = new CheckExpectedInstaller();
Expand Down

0 comments on commit 5adf8bd

Please sign in to comment.