Xposed - Legacy thread. Don't panic, Xposed is still here.

Status
Not open for further replies.
Search This thread

GermainZ

Inactive Recognized Developer / Retired Forum Mod
Aug 3, 2012
6,170
8,805
Thread cleaned. Honestly, I'd expect more from everyone than flaming others for using a different unit system (seriously, guys?) here. Minor OT might be tolerated by rovo, but that's not a reason to take one comment and turn it into an argument, and definitely not a reason for you to start insulting each other.
 

foxmolder1985

Senior Member
Jan 14, 2012
211
21
Dublin
Hello. Given that i don't know the exact name of the buttons in English (i don't know them neither in Italian), and given that my phone continues correcting my text as if it were italian, i post my problem with some screenshots:
Sometimes the lower bar(the one with the 3 buttons back, home and "the other button") does not disappear, but if i press "the other button" and then click on the app i was using, the lower bar disappears, ad it is supposed to do.
Is it a problem of Immerse Me or it's a problem of mine?
It's the best way i can explain this..
 

Attachments

  • Screenshot_2014-02-10-16-35-20.png
    Screenshot_2014-02-10-16-35-20.png
    255.4 KB · Views: 484
  • Screenshot_2014-02-10-16-35-27.jpg
    Screenshot_2014-02-10-16-35-27.jpg
    69.7 KB · Views: 476
  • Screenshot_2014-02-10-16-35-32.jpg
    Screenshot_2014-02-10-16-35-32.jpg
    140.2 KB · Views: 468
  • Screenshot_2014-02-10-16-35-48.png
    Screenshot_2014-02-10-16-35-48.png
    254.3 KB · Views: 452

Danation

Senior Member
Dec 9, 2009
182
212
startActivityForResult

Alright, I'm a little new to this. I'm trying to write an Xposed module, and I'm having a little trouble.

Here's what I'm trying to accomplish: In the app I'm trying to modify, a user can press a button and a method is called. I would like to replace the method with another that calls startActivityForResult and launches something else.

So far, I have correctly identified the method and replaced it with XC_MethodReplacement. That's no trouble. I think it will not be too difficult to startActivityForResult.

But here's the question: How do I add a onActivityResult method if one doesn't exist? Is there a way I can encapsulate both the call to startActivityForResult and onActivityResult into its own object that is instantiated within the replacement method?
 

Danation

Senior Member
Dec 9, 2009
182
212
A good question. I don't think it's possible unless there's an existing onActivityResult in that particular activity. However, you could hook onto base Activity class where this method belongs to and identify if it's a result of your call and take your action.

Thank you for your answer.

I'm not certain if I'll be able to get to the base activity; I'll do some research into that.

Could I programmatically create a new activity which is invisible? And then have it do the startActivityForResult/onActivityResult?
 

rovo89

Senior Recognized Developer
Jan 4, 2012
2,585
81,434
I'm trying to find a way to reload my module's settings when they're changed. I'm using initZygote so using, for example, a (dynamic) broadcast receiver there and reloading the preferences using XSharedPreferences.reload() isn't an option from what I understand (can't run a thread in zygote.)

Another option would be to reload the settings from hookLoadPackage, also using a broadcast receiver, in a process that's always there (android?) I gave it a quick shot, didn't work, searched a bit in this thread and saw an explanation by rovo about why that's not possible (different processes.)

Is there something I've missed that might allow me to do what I want?

Right, a thread running in the Zygote process will prevent the system from starting for some reason.
If you need those settings in every process (which is probably why you have hooked the method in initZygote), that would mean that you would have to set up a broadcast receiver in every thread. Not very efficient either.
How often are those settings needed? If it's not too often, you could simply reload everytime. There is a check for file modification time and size, which is likely cached, so it shouldn't be too much overhead. I haven't done any performance tests though. If the method is called too often, you could remember when you have last reloaded the settings. So you could reload only once every few seconds (which is almost as good as instant updates).

I decided I was done fighting with such messed up code and discontinued the module, but I still don't understand what I was doing wrong? What's wrong with this snippet?

Code:
XResources res = (XResources) toastContext.getResources();
int icon = res.addResource(toastContext.getResources(), R.drawable.ic_notif);
final Notification n = new Notification.Builder(toastContext)
.setContentText(toastTextView.getText())
.setLargeIcon(toastBD.getBitmap())
.setSmallIcon(icon)

The notiication is sent to the SystemUI process and displayed there. So the SystemUI loads the resources of the app that sent the notification - but it can't know about the replacement which was implecitly added with addResource(). That's why it can't resolve the fake resource ID. And that's why you should make sure to do that replacement in handleInitPackageResources(), which will be called for the app's resources even if they are loaded in other processes.

Hello. Given that i don't know the exact name of the buttons in English (i don't know them neither in Italian), and given that my phone continues correcting my text as if it were italian, i post my problem with some screenshots:
Sometimes the lower bar(the one with the 3 buttons back, home and "the other button") does not disappear, but if i press "the other button" and then click on the app i was using, the lower bar disappears, ad it is supposed to do.
Is it a problem of Immerse Me or it's a problem of mine?
It's the best way i can explain this..

Again, I don't see how this is related to the Xposed.

I'm not certain if I'll be able to get to the base activity; I'll do some research into that?
He means that you could hook onActivityResult() in Activity.class. That's indeed probably the only choice you have, you can't add methods.
 

Danation

Senior Member
Dec 9, 2009
182
212
He means that you could hook onActivityResult() in Activity.class. That's indeed probably the only choice you have, you can't add methods.

Oh, I misread that. Yeah, that would work, but I'd feel bad adding overhead to every single onActivityResult() method in Android.

Hopefully I can find a work around of some kind. What do you think of the invisible Activity idea?
 

rovo89

Senior Recognized Developer
Jan 4, 2012
2,585
81,434
Oh, I misread that. Yeah, that would work, but I'd feel bad adding overhead to every single onActivityResult() method in Android.

Hopefully I can find a work around of some kind. What do you think of the invisible Activity idea?

Not sure if your idea would work. It seems cleaner to me to simply hook Activity.onActivityResult(). If you place the hook inside handleLoadPackage(), you add that (very little) overhead only to that particular app. I don't think you can even measure that, not even talking about noticing it. Of course you need to make sure that param.thisObject is the correct type, but that's a simple check.
 
  • Like
Reactions: Danation

trueiceman

Senior Member
SnowJB Jellybean Stock 4.1.2 Stubborn Signal bars

I have SnowJB Rom which is At&t stock jellybean 4.1.2 and I can't seem to change the stock blue signal bars. The only thing it let me do was change them to full (non-working) static white. I've tried xblast, gravitybox and ex-themer modules but none worked. Has anyone successfully change the signal bars? Can anyone help? Thanks.
 

Pkt_Lnt

Inactive Recognized Contributor
Dec 26, 2011
7,894
5,804
SLO
I have SnowJB Rom which is At&t stock jellybean 4.1.2 and I can't seem to change the stock blue signal bars. The only thing it let me do was change them to full (non-working) static white. I've tried xblast, gravitybox and ex-themer modules but none worked. Has anyone successfully change the signal bars? Can anyone help? Thanks.

You are in the wrong thread. This is for framework development ONLY. The first two posts have links to were to go ask about modules in the Collections of modules thread.
 
  • Like
Reactions: mdamaged

Danation

Senior Member
Dec 9, 2009
182
212
Not sure if your idea would work. It seems cleaner to me to simply hook Activity.onActivityResult(). If you place the hook inside handleLoadPackage(), you add that (very little) overhead only to that particular app. I don't think you can even measure that, not even talking about noticing it. Of course you need to make sure that param.thisObject is the correct type, but that's a simple check.

Ah, I thought that even if you hooked to it within handleLoadPackage it would still run for every app, since it was for the global Activity class. Thank you for the correction. I'll go with that option. Thanks for your help!
 

rovo89

Senior Recognized Developer
Jan 4, 2012
2,585
81,434
Ah, I thought that even if you hooked to it within handleLoadPackage it would still run for every app, since it was for the global Activity class. Thank you for the correction. I'll go with that option. Thanks for your help!

It's limited because different processes have different memory, so hooking a method in one process doesn't have any effect on other processes. Only exception: Zygote is the parent process of every app, so changes done in the Zygote process before the app start are automatically inherited.


Regarding ZOPO devices: @add_pl sent me a useful logcat and the libdvm.so file. I had a look at both and I have to say: Sorry, but they have modified Android way too much to be compatible with Xposed. There are files called "core.jar.jex" (instead of "core.jar.dex") and the library is full of methods related to a compiler called "jazz" - probably their own one. It seems to have be an Ahead-of-time compiler, a bit like ART, but yet completely different. No way I can support that.
Note that this error is related to the ROM - if there are ROMs for these devices which are closer to AOSP, Xposed might actually work on those.

EDIT: @TheDeadCPU mentioned that these ROMs are running on"Aliyun OS" - an Android fork that even Google declared as "incompatible with Android". If you have an AOSP-based ROM, it should work.
 
Last edited:
  • Like
Reactions: Danation

pedromsouza

Senior Member
Oct 19, 2013
131
15
37
Salvador
Hi, I'm sorry about this, someone probably already posted the same issue but I can't find it! Maybe it's because my xposed framework installer is translated I'm not searching using the best keywords.

I'm sure my phone is rooted. After install the apk downloaded from the website link (I believe it's in the first or second post of this thread), Xposed Framework keeps telling me to install and reboot. I've done that more than 3 times...

When I tap "Framework" it says...

Versions
app_process (active - 47, avaliable - 47)
XposedBridge.jar (active - 42, avaliable, 42)

So it is installed and updated, right?

So why it's asking for me to activate and reboot?
 

voorhees13

Senior Member
Sep 14, 2013
1,363
728
Hi, I'm sorry about this, someone probably already posted the same issue but I can't find it! Maybe it's because my xposed framework installer is translated I'm not searching using the best keywords.

I'm sure my phone is rooted. After install the apk downloaded from the website link (I believe it's in the first or second post of this thread), Xposed Framework keeps telling me to install and reboot. I've done that more than 3 times...

When I tap "Framework" it says...

Versions
app_process (active - 47, avaliable - 47)
XposedBridge.jar (active - 42, avaliable, 42)

So it is installed and updated, right?

So why it's asking for me to activate and reboot?

You have to reboot to activate it.
 
  • Like
Reactions: pedromsouza
Status
Not open for further replies.

Top Liked Posts

  • There are no posts matching your filters.
  • 638
    Xposed 2.4 beta1/beta2

    This is Xposed version 2.4 beta1. The main new features and fixes in this version are:
    • Support for Android 4.4 (KitKat)
    • Significant performance improvements of the framework
    • Viewer for the debug.log in the installer
    • Check in the installer whether Xposed is actually active and working

    First of all, I would like to thank the 45 people who donated to get me a Nexus 5, from a little "thanks" to huge amounts of money. I was really impressed and hope you like this update.

    In detail:
    Xposed should now fully support KitKat. As mentioned, that wouldn't have been possible at this time without your support.
    Modules should continue to work if they don't rely on AOSP internals that have changed in KitKat. One example: It seems that the battery icon is no longer an (animated) image, but a Java implementation. Obviously, any modules that try to replace the battery image will no longer work. The Xposed framework can't do anything here, the module needs to be rewritten. Therefore, if some of your modules don't work, please get in contact with the module author first. You will probably see an error in the new debug.log viewer in this case.
    Xposed isn't compatible with ART, I can't say yet whether it will be in the future (will require a major rewrite if possible at all). As you would get into a bootloop if you try to combine Xposed+ART, Xposed automatically resets the choice to "Dalvik". If you want to test ART, you must uninstall the framework.

    The performance improvements apply to the very core of Xposed, the method hooks, in all Android versions. In a test app developed by @exidler, the overhead per call used to be ~71 μs (= 0.071 ms) per call to a hooked method (with one empty callback handler) on my Galaxy S2. Now it's ~13 μs (= 0.013 ms). That's a relative improvement of factor ~5.5x. Thanks to @exidler for the research and several suggestions! I have sent a pre-beta to @kamso, who had reported lags with older versions. Now everything works fine for him. Anyway, I wouldn't say that Xposed had bad performance before. Keep in mind that we are talking about significantly less than a millisecond here.

    The debug.log viewer should give a quick impression whether Xposed and modules could be loaded fine. It also includes options to save the log to SD card (so it's easier to transfer it to a PC etc.) and send it via mail.

    The Xposed Installer now checks whether the latest version of the framework is active. If not (e.g. because it's not installed yet, you forgot to reboot or something in Xposed doesn't work), you will see a warning in the welcome screen and at the top of the module list.

    Finally, there were some other minor improvements and fixes and new/updated translations.


    Developers:
    As a reminder, please keep the debug.log clean. It's only helpful if it's not as spammed as logcat. You should only use XposedBridge.log() for error messages and other unexpected situations. If everything runs fine, it shouldn't write anything to the log. If you really need to keep some logging in published builds, please use either logcat or make it an opt-in options (i.e. disabled by default and the user enables it if he runs into problems).

    Apart from that, there was a little API change: https://github.com/rovo89/XposedBridge/commit/3c18f6f6bd4e0ec57898b3b3a79b5584d0396054
    I assume that very few modules use the "extra" field to transfer information between beforeHookedMethod() and afterHookedMethod(). If you do, simply replace it by getExtra().

    Layout inflation hooks now also work if the layout has been included in other layouts. That's actually a pretty tricky use-case for the "extra" parameter mentioned about (and other tricky technologies).

    If for some reason you need to determine the active XposedBridge version in your module, you can use XposedBridge.XPOSED_BRIDGE_VERSION.

    findMethodBestMatch() now also looks for protected and package-private methods in superclasses. That's mainly useful if you use the callMethod() or callStaticMethod() helper.

    UPDATE: (beta2)
    The new beta should fix the "read-only filesystem" errors. If you used to experience them, please try this version. Otherwise, there is no need (and no advantage) to update.

    UPDATE:
    The final version is out, please use it instead (see first post / in-app installer).
    479
    The ART of patience

    Regarding ART possibly becoming the default runtime engine: I think that's good news because it means that we will get a stable version of ART then. I'm reluctant to work further on ART support at the moment for mainly three reasons:

    1. Time. I used to spend every evening and every weekend for Xposed, either to give support here (often answering the same questions again and again), writing code or researching about bugs or new ideas. As you may have noticed, there are now days or even weeks where I don't even log on to XDA, and I'm actually glad about this.

    2. Experimental software is bound to contain bugs, even severe ones. There is a reason why Google didn't make this choice available for the typical user (and keep in mind, we are not typical users). I neither want people to blame Xposed if their phone starts acting up nor do I want to hunt bugs which are caused by a runtime engine that is explicitely labelled as not finished yet.

    3. As long as ART is experimental, it's much easier to make big changes to the code. Once a final version is out and used by the masses, quality engineers we be much more careful not to break things. That means that Xposed for ART on 4.5 (or whatever it will be called) might need to be completely different than for ART on 4.4. More variants means more time for maintenance. And I don't feel like pushing something out now just to drop support again in a later version. There is not enough benefit of using ART at the moment to justify that.

    You know, I had already worked on ART support and spent several dozens of hours reading the code, looking for ways to hijack it, implementing my ideas, doing trial and error and starting again from the beginning. I finally had my Nexus 5 boot with Xposed in early December and quickly tested the App Settings module. I'm happy about that, but I also know that this was just a very experimental version, less ready than ART itself. It is totally hacked together and only tested with the stock ROM. ART is quite complex and has several different modes. It's not worth giving the current development to someone else before I have tested these things on my phone, where I can debug much better than instructing someone else to do it. It also requires rewriting app_process to be a light executable again, which loads either the Dalvik or ART Xposed library, depending on your settings. That would require changes in the installer as well, etc. etc.

    So you see, there is still lots of work to do. At the moment, I'm not actively working on it, but trying to get some other things fixed (e.g. LG ROMs) or improved (installation via recovery, better installation feedback in case root access failed, static Busybox package). And as I said, I do have other things in my life as well. It's not about money, that's what I have my full-time job for. I work on Xposed for fun (and maybe a bit for the reputation ;)), so the best way to ensure that I keep on working on it is not taking away the fun part of it. Don't pressure me like it was my duty to implement something ASAP (!!!), be patient even if it takes a bit longer until I answer and join the volunteers who help answering basic questions here so I don't have to. Thanks!
    317
    General information on Xposed has been moved to this thread: http://xdaforums.com/xposed/xposed-installer-versions-changelog-t2714053
    The FAQ has been moved to this thread: http://xdaforums.com/xposed/-t2735540
    Questions, suggestions, bug reports and so on can be posted in the Xposed General forum (for the installer/framework/development only) and in the Xposed Framework modules forum (for anything module-related).
    222
    Xposed Framework Installer (Flashable Zip)

    Announcement: Xposed Framework v2.5+ comes with an option to flash its own install zip via recovery, making my package obsolete. I'll leave them up for posterity; could be useful should the need arise for downgrading on some devices. Cheers all! 10000 downloads is pretty cool. :)

    Xposed Framework v2.2+ has fixed JB4.3 installation and v2.4+ has added support for KK4.4, but for those that still want it, or cannot install via the APK due to /system write protection like HTC's S-ON, here is an updated zip frontend method for installing the framework; now for Xposed Framework v2.4.1.

    You MUST have the Xposed Installer APK installed FIRST. The zip will detect if you do not and stop.

    Flash this in recovery and my frontend script (the update-binary) will detect the correct architecture and SDK version to use the appropriate Xposed app_process and busybox builds (x86, armv5, v6 and v7 & sdk 15 and 16+ supported), and should detect the uid of the Xposed Installer APK on-the-fly and set up the required files with it.

    It leaves a log behind in /data/local/tmp/xposed-log.txt either way with more details about how it went. :cool:

    It also unpacks Xposed-Disabler-Recovery.zip to /sdcard/ (or /sdcard/0/ if it exists) to be as close to the APK install method as possible. For those wanting another method to reactivate after a ROM update or toggle Xposed disabled/enabled, @amishxda has also created a cool "Xposed toggler" zip here.

    Note: Xposed Framework files and the install.sh used are the work of @rovo89 and @Tungstwenty; I have only created a recovery flashable zip to function as an alternative frontend for the framework installation process. I take no credit for their fantastic work.


    P.S. If you found this handy then please check out my Odds and Ends thread for more flashable goodness. :D

    5351 downloads of v2.1.4 when removed. 1049 downloads of v2.2 when removed.
    193
    Xposed 2.5 final

    This is Xposed version 2.5 (final). The main new features and fixes in this version are:
    • Rewritten framework installation/uninstallation
      • Uses interactive su (via libsuperuser) to provide improved compatibility with different Superuser apps
      • Better feedback when root access fails (doesn't freeze the app anymore)
      • Offers installation via custom recovery (CWM/TWRP), either flashing the file automatically or manually
    • Safemode to disable Xposed with hardware keys to get out of (most) bootloops
    • Compatibility with Sony/LG ROMs (4.3 and 4.4), Meizu ROMs (4.4)
    • Debug setting to disable resource hooking as a temporary workaround for incompatibilities with some theming engines (not all modules can be used in this mode)
    There are also other improvements and fixes, especially many translations updates.
    In case you get a message "Segmentation fault" during installation, you can now download an additional app which provides statically compiled versions of BusyBox (a lot bigger, but should work with every ROM). It's not needed otherwise.

    Quick explanation of the safemode: It was developed by @Tungstwenty and makes it possible to disable Xposed by repeatedly pressing one of the hardware buttons during early startup. The phone will vibrate twice when the first key press has been detected. Then you have five seconds to press the same button four more times. Each key press will be confirmed with a short vibration; the final one with a long vibration. It creates /data/data/de.robv.android.xposed.installer/conf/disabled, which prevents most of Xposed's actions (e.g. no hooks are made and no modules are loaded). There's no 100% guarantee that this will get you out of a bootloop, but in most cases it should.

    As always, you can download it via the in-app updater or from http://dl.xposed.info/latest.apk.