Skip to content

Commit

Permalink
[tinker] Add lost modifications: remove old patch async on patch load…
Browse files Browse the repository at this point in the history
…ing.
  • Loading branch information
tangyinsheng authored and tys282000 committed Jun 12, 2023
1 parent 987e4f2 commit 70b4c60
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ private void tryLoadPatchFilesInternal(TinkerApplication app, Intent resultInten

//tinker/patch.info
File patchInfoFile = SharePatchFileUtil.getPatchInfoFile(patchDirectoryPath);

//check patch info file whether exist
if (!patchInfoFile.exists()) {
ShareTinkerLog.w(TAG, "tryLoadPatchFiles:patch info not exist:" + patchInfoFile.getAbsolutePath());
Expand All @@ -102,7 +101,6 @@ private void tryLoadPatchFilesInternal(TinkerApplication app, Intent resultInten
//old = 641e634c5b8f1649c75caf73794acbdf
//new = 2c150d8560334966952678930ba67fa8
File patchInfoLockFile = SharePatchFileUtil.getPatchInfoLockFile(patchDirectoryPath);

patchInfo = SharePatchInfo.readAndCheckPropertyWithLock(patchInfoFile, patchInfoLockFile);
if (patchInfo == null) {
ShareIntentUtil.setIntentReturnCode(resultIntent, ShareConstants.ERROR_LOAD_PATCH_INFO_CORRUPTED);
Expand Down Expand Up @@ -173,7 +171,7 @@ private void tryLoadPatchFilesInternal(TinkerApplication app, Intent resultInten

String patchVersionDirFullPath = patchDirectoryPath + "/" + patchName;
ShareTinkerInternals.killProcessExceptMain(app);
SharePatchFileUtil.deleteDir(patchVersionDirFullPath);
SharePatchFileUtil.deleteDirAsync(patchVersionDirFullPath);
}
} else {
patchInfo.versionToRemove = "";
Expand Down Expand Up @@ -244,7 +242,6 @@ private void tryLoadPatchFilesInternal(TinkerApplication app, Intent resultInten
}

ShareSecurityCheck securityCheck = new ShareSecurityCheck(app);

int returnCode = ShareTinkerInternals.checkTinkerPackage(app, tinkerFlag, patchVersionFile, securityCheck);
if (returnCode != ShareConstants.ERROR_PACKAGE_CHECK_OK) {
ShareTinkerLog.w(TAG, "tryLoadPatchFiles:checkTinkerPackage");
Expand Down

0 comments on commit 70b4c60

Please sign in to comment.