[Xposed General] tonyp:
I have a very similiar issue when using handleInitPackageResources().

I'm not sure if I'm doing something wrong or the issue is related - InitPackageResourcesParam doesn't have a "processName" which I could check as a workaround as with handleLoadPackage().

Does anyone have an idea?

Code (the red line is the one throwing the exception:

@Override
public void handleInitPackageResources(XC_InitPackageResources.InitPackageResourcesParam resparam) throws Throwable {
if (!resparam.packageName.equals("com.android.systemui"))
return;

[COLOR="red"]XModuleResources modRes = XModuleResources.createInstance(MODULE_PATH, resparam.res);[/COLOR]

try {
resparam.res.setReplacement("com.android.systemui", "drawable", ...));
} catch (Exception e) {
}
}

Logcat:

E/Xposed﹕ java.lang.NoSuchMethodError: No static method parsePackageLite(Ljava/lang/String;I)Landroid/content/pm/PackageParser$PackageLite; in class Landroid/content/pm/PackageParser; or its super classes (declaration of 'android.content.pm.PackageParser' appears in /system/framework/framework.jar)
at android.content.res.XResources.getPackageName(XResources.java:153)
at android.content.res.XResources.getPackageNameDuringConstruction(XResources.java:178)
at de.robv.android.xposed.mods.appsettings.XposedMod$3.beforeHookedMethod(XposedMod.java:133)
at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:636)
at android.content.res.Resources.updateConfiguration(Unknown Source)
at android.content.res.Resources.updateConfiguration(Resources.java:1732)
at android.content.res.Resources.<init>(Resources.java:232)
at android.content.res.Resources.<init>(Resources.java:209)
at android.content.res.XModuleResources.<init>(XModuleResources.java:12)
at android.content.res.XModuleResources.createInstance(XModuleResources.java:29)
[COLOR="Red"]at com.thetonyp.truesilentmode.TrueSilentMode.handleInitPackageResources(TrueSilentMode.java:55)[/COLOR]
at de.robv.android.xposed.IXposedHookInitPackageResources$Wrapper.handleInitPackageResources(IXposedHookInitPackageResources.java:20)
at de.robv.android.xposed.callbacks.XC_InitPackageResources.call(XC_InitPackageResources.java:28)
at de.robv.android.xposed.callbacks.XCallback.callAll(XCallback.java:70)
at de.robv.android.xposed.XposedBridge$7.afterHookedMethod(XposedBridge.java:369)
at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:670)
at android.app.ResourcesManager.getTopLevelResources(Unknown Source)
at android.app.ActivityThread.getTopLevelResources(ActivityThread.java:1625)
at android.app.LoadedApk.getResources(LoadedApk.java:533)
at android.app.ContextImpl.<init>(ContextImpl.java:2254)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2212)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4329)
at de.robv.android.xposed.XposedBridge.invokeOriginalMethodNative(Native Method)
at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:656)
at android.app.ActivityThread.handleBindApplication(Unknown Source)
at android.app.ActivityThread.access$1500(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1339)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:117)