fix: installApk 验证 cp 复制成功且文件大小 > 0 再加入安装列表
This commit is contained in:
@@ -173,8 +173,12 @@ object RestoreOperation {
|
|||||||
for (name in apkFiltered) {
|
for (name in apkFiltered) {
|
||||||
val src = File(appDir, name)
|
val src = File(appDir, name)
|
||||||
val dst = File(installDir, name)
|
val dst = File(installDir, name)
|
||||||
RootShell.exec("cp '${src.absolutePath.shellEscape()}' '${dst.absolutePath.shellEscape()}' && chmod 644 '${dst.absolutePath.shellEscape()}'")
|
val copyResult = RootShell.exec("cp '${src.absolutePath.shellEscape()}' '${dst.absolutePath.shellEscape()}' && chmod 644 '${dst.absolutePath.shellEscape()}'")
|
||||||
localApks.add(dst)
|
if (copyResult.isSuccess && BackupOperation.backupPathExists(dst) && BackupOperation.backupFileSize(dst) > 0L) {
|
||||||
|
localApks.add(dst)
|
||||||
|
} else {
|
||||||
|
Log.w(TAG, "installApk: failed to copy APK ${name}, skipping")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun doInstall(): Boolean {
|
suspend fun doInstall(): Boolean {
|
||||||
|
|||||||
Reference in New Issue
Block a user