diff --git a/app/src/main/java/com/aefyr/sai/installer/rootless/RootlessSAIPackageInstaller.java b/app/src/main/java/com/aefyr/sai/installer/rootless/RootlessSAIPackageInstaller.java index 96b33650..e772c374 100644 --- a/app/src/main/java/com/aefyr/sai/installer/rootless/RootlessSAIPackageInstaller.java +++ b/app/src/main/java/com/aefyr/sai/installer/rootless/RootlessSAIPackageInstaller.java @@ -65,6 +65,7 @@ private RootlessSAIPackageInstaller(Context c) { sInstance = this; } + @SuppressLint("DefaultLocale") @Override protected void installApkFiles(ApkSource aApkSource) { cleanOldSessions(); @@ -78,8 +79,9 @@ protected void installApkFiles(ApkSource aApkSource) { mSessionsMap.put(sessionID, getOngoingInstallation().getId()); session = mPackageInstaller.openSession(sessionID); + int currentApkFile = 0; while (apkSource.nextApk()) { - try (InputStream inputStream = apkSource.openApkInputStream(); OutputStream outputStream = session.openWrite(apkSource.getApkName(), 0, apkSource.getApkLength())) { + try (InputStream inputStream = apkSource.openApkInputStream(); OutputStream outputStream = session.openWrite(String.format("%d.apk", currentApkFile++), 0, apkSource.getApkLength())) { IOUtils.copyStream(inputStream, outputStream); session.fsync(outputStream); }