Skip to content

Commit

Permalink
Stop to clean up the lib-main folder if enable SOLOADER_DISABLE_BACKU…
Browse files Browse the repository at this point in the history
…P_SOSOURCE

Summary:
remove this optional backup soSource clean up logic to migrate below Violation.
```
- Caused by: android.os.strictmode.CredentialProtectedWhileLockedViolation: Accessed credential protected path /<pkg>/lib-main while user 0 was locked
- android.os.StrictMode.onCredentialProtectedPathAccess (StrictMode.java:2226)
- android.os.StrictMode.access$2000 (StrictMode.java:153)
- android.os.StrictMode$5.onPathAccess (StrictMode.java:1858)
- libcore.io.BlockGuardOs.access (BlockGuardOs.java:72)
- libcore.io.ForwardingOs.access (ForwardingOs.java:72)
- android.app.ActivityThread$AndroidOs.access (ActivityThread.java:7616)
- java.io.UnixFileSystem.checkAccess (UnixFileSystem.java:281)
- java.io.File.exists (File.java:815)
- com.facebook.soloader.SoLoader.addBackupSoSource (SoLoader.java:460)
 [inlined]
- com.facebook.soloader.SoLoader.initSoSources (SoLoader.java:371)
```

Reviewed By: phecdarain

Differential Revision: D53060447

fbshipit-source-id: 2cca0cda601cf4cf60a863b586ed2624584632e6
  • Loading branch information
simpleton authored and facebook-github-bot committed Jan 25, 2024
1 parent c96d478 commit d67b4af
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions java/com/facebook/soloader/SoLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -455,15 +455,6 @@ private static void addApplicationSoSource(ArrayList<SoSource> soSources, int fl
private static void addBackupSoSource(Context context, ArrayList<SoSource> soSources)
throws IOException {
if ((sFlags & SOLOADER_DISABLE_BACKUP_SOSOURCE) != 0) {
// Clean up backups
final File backupDir = UnpackingSoSource.getSoStorePath(context, SO_STORE_NAME_MAIN);
try {
if (backupDir.exists()) {
SysUtil.dumbDelete(backupDir);
}
} catch (Throwable e) {
LogUtil.w(TAG, "Failed to delete " + backupDir.getCanonicalPath(), e);
}
return;
}

Expand Down

0 comments on commit d67b4af

Please sign in to comment.