diff --git a/app/src/main/java/de/robv/android/xposed/XposedHelpers.java b/app/src/main/java/de/robv/android/xposed/XposedHelpers.java index f53a26ac..0d195e79 100644 --- a/app/src/main/java/de/robv/android/xposed/XposedHelpers.java +++ b/app/src/main/java/de/robv/android/xposed/XposedHelpers.java @@ -1,5 +1,7 @@ package de.robv.android.xposed; +import android.content.Context; +import android.content.pm.PackageInfo; import android.content.res.Resources; import java.io.ByteArrayOutputStream; @@ -1161,6 +1163,15 @@ public static String getMD5Sum(String file) throws IOException { return ""; } } + + public static PackageInfo getPackageInfo(String packageName) { + Object activityThread = callStaticMethod(findClass("android.app.ActivityThread", null), "currentActivityThread"); + if (activityThread == null) return null; + Context context = (Context) callMethod(activityThread, "getSystemContext"); + if (context == null) return null; + return context.getPackageManager().getPackageInfo(packageName, 0); + + } //################################################################################################# /**