Skip to content

Commit

Permalink
[tinker] Fix infinite recurse invocation on startup on Huawei API 27 …
Browse files Browse the repository at this point in the history
…devices.
  • Loading branch information
tys282000 committed Jun 29, 2023
1 parent fc4ec5a commit 19a7713
Showing 1 changed file with 0 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ class TinkerResourcePatcher {
private static Field assetsFiled = null;
private static Field resourcesImplFiled = null;
private static Field resDir = null;
private static Field resources = null;
private static Field packagesFiled = null;
private static Field resourcePackagesFiled = null;
private static Field publicSourceDirField = null;
Expand Down Expand Up @@ -104,12 +103,6 @@ public static void isResourceCanPatch(Context context) throws Throwable {
}

resDir = findField(loadedApkClass, "mResDir");
try {
resources = findField(loadedApkClass, "mResources");
} catch (Throwable thr) {
ShareTinkerLog.printErrStackTrace(TAG, thr, "Fail to get LoadedApk.mResources field.");
resources = null;
}
packagesFiled = findField(activityThread, "mPackages");
try {
resourcePackagesFiled = findField(activityThread, "mResourcePackages");
Expand Down Expand Up @@ -229,9 +222,6 @@ public static void monkeyPatchExistingResources(Context context, String external
final String resDirPath = (String) resDir.get(loadedApk);
if (appInfo.sourceDir.equals(resDirPath)) {
resDir.set(loadedApk, externalResourceFile);
if (resources != null) {
resources.set(loadedApk, null);
}
}
}
}
Expand Down

0 comments on commit 19a7713

Please sign in to comment.