Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Compatibility for ROMs which extend the Resources class themselves #178

Closed
airani opened this issue May 18, 2014 · 19 comments
Closed

Compatibility for ROMs which extend the Resources class themselves #178

airani opened this issue May 18, 2014 · 19 comments
Assignees
Labels

Comments

@airani
Copy link

airani commented May 18, 2014

Hi,
My phone is Huawei P6 with android 4.4.2 and when i upgrade my Xposed to new version (2.6) that is installed but not activated and not worked!
Please fix this bug!

@rovo89
Copy link
Owner

rovo89 commented May 18, 2014

This is not a support forum, please use XDA.

@rovo89 rovo89 closed this as completed May 18, 2014
@airani
Copy link
Author

airani commented May 18, 2014

I don't want to support! actually, i just reported an issue!!

@airani airani changed the title Bug: new version (2.6) not work on Huawei P6 and android 4.4.2 Bug: new version (2.6) not working on Huawei P6 with android 4.4.2 May 18, 2014
@rovo89
Copy link
Owner

rovo89 commented May 18, 2014

Then please provide a logcat that shows the error. But in general, support (including "it doesn't work") is given only on XDA, because there are a lot more people who can help.

@airani
Copy link
Author

airani commented May 18, 2014

The following line is the error of my logcat about XposedInstaller:
E/BufferQueue( 134): [de.robv.android.xposed.installer/de.robv.android.xposed.installer.XposedInstallerActivity] dequeueBuffer: can't dequeue multiple buffers without setting the buffer count

I hope this line of my logcat useful to fix this bug.
Thank you

@rovo89
Copy link
Owner

rovo89 commented May 19, 2014

Unfortunately, that isn't helpful. It's unlikely that the relevant error has the tag of the installer. It might be something with tag "Xposed", or something completely different. There are lots of possibilities.

@airani
Copy link
Author

airani commented May 19, 2014

I watched catlog again and i found these lines:

I/Xposed ( 134): -----------------
I/Xposed ( 134): 19 مهٔ 2014 8:37:26 UTC
I/Xposed ( 134): Loading Xposed v54 (for Zygote)...
I/Xposed ( 134): Running ROM 'P6-U06V100R001C17B506' with fingerprint 'Huawei/P6-U06/hwp6-u06:4.4.2/HuaweiP6-U06/C17B506:user/ota-rel-keys,release-keys'
I/Xposed ( 134): Errors during Xposed initialization
I/Xposed ( 134): java.lang.ClassCastException: class android.content.res.XResources doesn't extend class com.huawei.android.content.res.ResourcesEx
I/Xposed ( 134): at de.robv.android.xposed.XposedBridge.cloneToSubclass(XposedBridge.java:787)
I/Xposed ( 134): at de.robv.android.xposed.XposedBridge.hookResources(XposedBridge.java:365)
I/Xposed ( 134): at de.robv.android.xposed.XposedBridge.initXbridgeZygote(XposedBridge.java:267)
I/Xposed ( 134): at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:117)
I/Xposed ( 134): at dalvik.system.NativeStart.main(Native Method)

@rovo89
Copy link
Owner

rovo89 commented May 19, 2014

Ok, that's it then. Some ROMs have theming engines that conflict with Xposed. I'm looking for solutions, but meanwhile, please use the "Disable resources API" setting in the installer. You might not be able to use some modules, but most should still work.

@airani
Copy link
Author

airani commented May 19, 2014

I used this option but my modules deactivated and i have decided to downgrade to 1.5.1 and waiting for 2.6.1 version
I hope to open my issue and return to queue for fixing bug
Thank you

@rovo89 rovo89 added bug and removed invalid labels May 19, 2014
@rovo89 rovo89 self-assigned this May 19, 2014
@rovo89 rovo89 changed the title Bug: new version (2.6) not working on Huawei P6 with android 4.4.2 Compatibility for ROMs which extend the Resources class themselves May 19, 2014
@rovo89
Copy link
Owner

rovo89 commented May 19, 2014

Ok, I'll keep this one open as a tracker for the general issue. I have an idea how this might be fixed, but it's a rather complex solution which needs some time to be developed and especially needs proper testing. It's not something that can be part of a bugfix release.

@rovo89 rovo89 reopened this May 19, 2014
@airani
Copy link
Author

airani commented May 19, 2014

Thank you Rovo

@airani
Copy link
Author

airani commented Jun 24, 2014

When fix this bug?

@rovo89
Copy link
Owner

rovo89 commented Jun 24, 2014

Probably some time this year.

@pylerSM
Copy link
Contributor

pylerSM commented Jan 3, 2015

@rovo89 Some user reported that 2.4.1 xperia test works on Huawei devices.
http://forum.xda-developers.com/xposed/modules-framework-t2991683#post57920507

@rovo89
Copy link
Owner

rovo89 commented Jan 3, 2015

That's not surprising me at all. Up to 2.5.1, it should work with the regular versions - well, at least Xposed loads, ROM-specific theming functions get lost. On other ROMs, it was crashing completely.

The problem is: Both the ROM and Xposed replace Resources with a specific subclass. But only one can win. Before 2.6, Xposed won, with the effect in parts of the ROM where the ROM-specific subclass is expected, the system crashes. Also some ROMs just add new fields to Resources, which I had to copy and manually copy over to the XResources instance. The new approach is generally safer and works fine for ROMs just adding fields, but Xposed detects conflicts and produces error messages as displayed here.

As a general workaround, resource hooks can be disabled in the settings. For Huawei, I believe someone found out that changing ro.config.hwtheme will avoid that the ROM tries to use its own subclass, so there's no conflict and Xposed works fine. No idea how well that works and if there are any side-effects (except that the ROM's theming engine won't work).

Basically, the solution would be that XResources extends the ROM's class instead of the Resources class directly. I have created such a hack for some MIUI version, but there are quite a few ROMs which would need this and especially Huawei sometimes needs this, but sometimes it would be counterproductive (depending on that parameter mentioned above). I thought about dynamically patching the XposedBridge dex on the ROM, but the specifications are too strict, it's much effort to change it without recompiling. I have another idea, involving an additional jar file with the specific intermediate class per ROM, but it's rather complicated as well, so I don't know when I will be able to try this.

@mieik
Copy link

mieik commented Jan 21, 2015

Here with an EMUI 3.0 ROM (Honor 6). Installing a precedent version of Xposed Framework and editing the build.prop file leads to having the framework working without disabling the hooks. Unfortunately, even if ther UI works, modules functions don't work. I tried GravityBox and it makes no changes; I tried minminguard and the ads are still there. If I install the newer versions I have to disable the hooks to make the framework work, so obviously these modules still don't work. Has anyone came up with a solution to make these modules work? :(

@anaschillin
Copy link

@rovo89 Did you ever figure out how a global patch for rom that use their own theme engine?

@ArionMiles
Copy link

ArionMiles commented Aug 19, 2016

@rovo89 Can you at least write a guide on how we can have the Framework work without the need to disable Resource Hooks on some devices?

A guide as in, a nod in the general direction where people need to look to fix this?

@rovo89
Copy link
Owner

rovo89 commented Aug 19, 2016

Since one of the recent versions (85 or 86), this has been fixed.

@rovo89 rovo89 closed this as completed Aug 19, 2016
@cubakcabak
Copy link

cubakcabak commented Nov 25, 2016

i guess its fixed for newer android version, sadly its not compatible with kitkat anymore.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

7 participants