Skip to content

Commit

Permalink
catch throwable instead exceptoin during deleting backup dir
Browse files Browse the repository at this point in the history
Summary:
CredentialProtectedWhileLockedViolation is not a exception, try to catch the throwable to swallow this.

java.lang.Object
↳	java.lang.Throwable
↳	android.os.strictmode.Violation
↳	android.os.strictmode.CredentialProtectedWhileLockedViolation

https://developer.android.com/reference/android/os/strictmode/CredentialProtectedWhileLockedViolation

Reviewed By: phecdarain

Differential Revision: D52376686

fbshipit-source-id: 28c2d6fbc249e5165d810b96b9860788903684c7
  • Loading branch information
simpleton authored and facebook-github-bot committed Dec 21, 2023
1 parent a470f78 commit 5123d58
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion java/com/facebook/soloader/SoLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.facebook.soloader;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
Expand Down Expand Up @@ -452,6 +453,7 @@ private static void addApplicationSoSource(ArrayList<SoSource> soSources, int fl
}

/** Add the SoSources for recovering the dso if the file is corrupted or missed */
@SuppressLint("CatchGeneralException")
private static void addBackupSoSource(
Context context, ArrayList<SoSource> soSources, int backupSoSourceFlags) throws IOException {
if ((sFlags & SOLOADER_DISABLE_BACKUP_SOSOURCE) != 0) {
Expand All @@ -461,7 +463,7 @@ private static void addBackupSoSource(
if (backupDir.exists()) {
SysUtil.dumbDelete(backupDir);
}
} catch (Exception e) {
} catch (Throwable e) {
LogUtil.w(TAG, "Failed to delete " + backupDir.getCanonicalPath(), e);
}
return;
Expand Down

0 comments on commit 5123d58

Please sign in to comment.