in java/com/facebook/soloader/SoLoader.java [387:414]
private static void AddBackupSoSource(
Context context, ArrayList<SoSource> soSources, int apkSoSourceFlags) throws IOException {
if ((sFlags & SOLOADER_DISABLE_BACKUP_SOSOURCE) != 0) {
sBackupSoSources = null;
// Clean up backups
final File backupDir = UnpackingSoSource.getSoStorePath(context, SO_STORE_NAME_MAIN);
try {
SysUtil.dumbDeleteRecursive(backupDir);
} catch (IOException e) {
Log.w(TAG, "Failed to delete " + backupDir.getCanonicalPath(), e);
}
return;
}
final File mainApkDir = new File(context.getApplicationInfo().sourceDir);
ArrayList<UnpackingSoSource> backupSources = new ArrayList<>();
ApkSoSource mainApkSource =
new ApkSoSource(context, mainApkDir, SO_STORE_NAME_MAIN, apkSoSourceFlags);
backupSources.add(mainApkSource);
if (Log.isLoggable(TAG, Log.DEBUG)) {
Log.d(TAG, "adding backup source from : " + mainApkSource.toString());
}
addBackupSoSourceFromSplitApk(context, apkSoSourceFlags, backupSources);
sBackupSoSources = backupSources.toArray(new UnpackingSoSource[backupSources.size()]);
soSources.addAll(0, backupSources);
}