Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zenfone2 art(x86) compatibility patch #7

Closed
sorgelig opened this issue May 6, 2015 · 7 comments

Comments

@sorgelig
Copy link

commented May 6, 2015

Here is format-patch: http://pastebin.com/UH4iJQTe
I couldn't find where these options are really used, but i've made get/set features working in case if it used in other parts of android framework. Not all added features are used in Zenfone2, but all of them are present in stock oat2dex binary.
Without patch, dex2oat refuses to start because of unknown options.

So, far Xposed works ok on Zenfone 2. I've tested it on my xposed module which hooks many system functions.

May i release pre-injected (this is the only option for Zenfone2 due to locked bootloader) xposed as a whole system.img to XDA for public test? Would be good to have feedback from x86 system.

@rovo89

This comment has been minimized.

Copy link
Owner

commented May 7, 2015

Thanks! I'm wondering: If these features aren't supported by AOSP ART anyway - is there any benefit from including parsing and remembering them? Are they checked somewhere, passed to the compiler or something like that? If not, how about simply ignoring unknown features?

By the way, those features seem to be available in the master branch of ART, but the whole handling is completely different there.

@sorgelig

This comment has been minimized.

Copy link
Author

commented May 7, 2015

You can simply ignore these features. It works. But you have to accept them as a dummy anyway. I also don't know how these features used. GetFeatureString() can be called from anywhere outside, so I've thought it wouldn't hurt to pass them there.
Actually, i think, it's worth to modify the code to accept any unknown feature, so dex2oat will be able to start on more devices.

So, may i go to upload system.img with preinstalled Xposed? I want to release it in Zenfone 2 sub-forum (not Xposed sub-forum) because it's obviously only for Zenfone 2 ZE551ML. I think, some x86 public testing will help you make official x86 release.

@pylerSM

This comment has been minimized.

Copy link

commented May 7, 2015

I think you patch should be merged in Xposed itself. You did great job, Samsung, LG users need somebody like you to work around ART changes by these OEMs :)

@rovo89

This comment has been minimized.

Copy link
Owner

commented May 7, 2015

Actually, i think, it's worth to modify the code to accept any unknown feature, so dex2oat will be able to start on more devices.

Yes, that's what I thought. That's pretty easy to do, simply remove the error handling (or maybe replace it with a warning).

Anyway, feel free to post your system.img. As long as you support it yourself and give credit, that's fine for me.

@rovo89

This comment has been minimized.

Copy link
Owner

commented May 7, 2015

Btw, I know that Xposed is working fine on x86, I use Genymotion sometimes. Unfortunately, their drop-to-flash feature doesn't work very well. It just extracts the files to /system instead of running the updater-script/update-binary, so the files get wrong permissions...

@pylerSM

This comment has been minimized.

Copy link

commented May 8, 2015

Can anybody recompile xposed with removed error handling(accept any feature)?

@pylerSM

This comment has been minimized.

Copy link

commented May 22, 2015

This patch is useful: arter97/android_art@e34babd

Maybe merge it?

@rovo89 rovo89 closed this in afd9bd1 Jun 5, 2015
C3C0 added a commit to C3C0/android_art that referenced this issue Jun 9, 2015
Some ROMs are configured to make use of options that are only available in
these ROMs, but not in AOSP (and therefore, not in Xposed). There's little
chance that these options can be implemented in Xposed's version of ART as
well. However, these options aren't necessarily required, they might just
be minor tweaks. So we just log them, but don't prevent the device from
booting (unless it happened to be a strictly required option, but then it
wouldn't boot either way).

Fixes rovo89#7.
wanam referenced this issue Jun 9, 2015
Xposed modules are loaded in the Zygote process. ART compiles the .dex file
and opens the resulting .oat file in the Dalvik cache for that. However,
the same happens again when the user installs a new version of the module,
overwriting the file in the Dalvik cache. When opening the new .oat file
though, ART detects that the file is already opened and reuses this instance.
Later, it detects that the checksum doesn't match, which causes a crash.
This will only occur on every second update (without reboot) as Android
uses alternating suffixes for the .apk files (-1.apk / -2.apk).

Let's work around it by ignoring already opened .oat files if they have been
opened in Zygote. The behavior for files in /system (boot image and framework)
is unchanged.

Fixes rovo89/Xposed#22.
@duoniduoni duoniduoni referenced this issue Apr 28, 2017
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.