[Q] Can we hook class loaders? - Xposed Framework Development

Hello fellow devs!
I've got an idea for a module that involves reinstrumentation of classes at runtime and also preventing classes from being loaded too.
The problem is, I don't know where to start hooking. I don't really understand the way class loading works in Android.
I tried searching deep into the source code of the OS, found PathClassLoader, which resides in 'dalvik.system' package. I imagine it's not hookable...
So my question is:
Is what I'm trying to do even possible? Maybe I'm looking in the wrong place?
Also take note, modifying packages outside of memory is out of question here.

Guess I was wrong. I successfully hooked PathClassLoader's findClass method with no problems.
Now, how can I make my class respond to non-existent methods' calls? One solution would be to just hook all methods in the existing class, but I'd prefer something like this (link)...

Yew, interesting idea. @rovo89?
Can we "create/redirect" methods/classes? Let's say app calls X method from Y class, but Y class is not available (e.g. GP Services), so can we redirect original Y class to our class and redirect original X method to our method from our class?

Xiaomi Poco F1 [ROM] [8.1.0] ResurrectionRemix v6.2.1
I installed xposed v90beta3, I can not start the module, it gives an error.
Help solve the problem
zygote64(3278): ClassLoaderContext size mismatch. expected=1, actual=2 (PCL[] | PCL[];PCL[/data/dalvik-cache/xposed_XResourcesSuperClass.dex*2802528989:/data/dalvik-cache/xposed_XTypedArraySuperClass.dex*708326108])

Related

android

hello,
their seems to be a few posts on this being ported to BA recently. ow ive got linux running on my BA fairly well (havent got round to setting up gprs etc yet though but thats a different matter) and id be willing to try and get a port of android working, if someone can extract the 3 img files in the android sdk as ive not managed to do that yet ? anyone want to try and help or am i talking of a lost cause
ok, ill post this incase anyone is watching. i made some progress getting andriod running but i keep getting seg fault tryingto run it, any1 who could provide insight let me know pelase
Unfortunately I can't help you but I'll be keeping a VERY close eye on this thread!
Good luck, I'm sure there are a whole load of people who'd buy you a beer if you succeed.
Steve
glad to see someones watching . ill have another play around over weekend see what i can come up with
it will be interesting to see how android works on BA keep up with the good work
Nice.
I like my BA and I don't wont to change it until an open linux mobile is avaible (an open Iphone could be great).
Maybe a sub-forum called "Blue angel linux" could help.
I'm bored or a problem with the actual BA linux is the acces to the wifi chipset?
And this seems noise. And I don't want to pay for having linux on my BA!
http://www.a-la-mobile.com/news/press/pr080114.html
aperles said:
I'm bored or a problem with the actual BA linux is the acces to the wifi chipset?
Click to expand...
Click to collapse
Not the access, but a nice gui/setup.
remember linux is designed primarily for people who know what their doing. yes theirs guis now which help but you stil need command line to use linux properly. except on the iPhone and android from what ive seen
actually there was an earlier thread regarding android. and with 921+ adding 200+ views here, We bet there are people that are REALLY interested porting this.
hope we get it up and running.
anything for our BA.
even alternatives to WM6 are welcome.
well im not having a lot of look, it seems to be segfaulting pretty much constantly. think its down to the busybox shell though so im going to find a newer one and try that later, does anyone know what version of the arm feature set the BA uses. (because from reading http://benno.id.au/blog/2007/11/21/android-neo1973) android only seems to work on devices using ARMv5 featureset. whatever that means)
UPDATE: thats not a problem, the pxa263 in the BA is ARMv5TE so thats ok - gotta love wikipedia (http://en.wikipedia.org/wiki/XScale)
Further update: ok been reading up a bit more and im doing the risky thing of building my own kernel for android see if i can get round these damn segfaults
ok just thought id post up so people done think ive given up here . still havign issues compiling the linux kernel with the android addidtions. mainly because i ahvent got a proper linux machine at home (only virtual pc on this computer)...dont suppose anyone uses linux and has a decent knownledge of compiling kernels on here ??
DJ_Steve said:
ok just thought id post up so people done think ive given up here . still havign issues compiling the linux kernel with the android addidtions. mainly because i ahvent got a proper linux machine at home (only virtual pc on this computer)...dont suppose anyone uses linux and has a decent knownledge of compiling kernels on here ??
Click to expand...
Click to collapse
I've compiled kernels under Linux before, but not for an embedded system like the angel's.
Where did you get the tarballs for everything? And what distro of Linux did you install?
Really, real machine vs virtual machine, in this case, shouldn't matter. It might, but shouldn't.
not so much the fact im using a virtual machine, its the fact im only on a 2mb connection so downloading linux cd images takes ages and since debian is the only distro ive seen which has arm crosscompile tools that work that means 2 dvds or 9+cd images. most of the tarballs ive had to rip direct from the android sdk emulator. i could host them somewhere if someone wants to try and help me out getting a kernel running - after that i think most of android should fall into place on its own, but getting openbinder support in the kernels proving difficult
EDIT/UPDATE: ok just tried installing the arm crosscompiliers on my development dedicated server and it seems to be compiling a kernel as i type (hopefully) so looks to be some progress happening here
Been following your thread with interest.
I should be getting a new PDA from work, so then I could take the risk of bricking my trusty and battered Blue Angel.
Any chance you could post some links to the various bits you are using? Not a step by step (unless you have the time) but the starting points so others can attempt to duplicate your efforts in parallel?
Good luck - I'm rooting for you!
ok, im just tarballing up the files on my webserver now, didnt have any success with kernel, looks like im going to have to take the blueangel drivers etc from the kernel posted on handhelds.org and manually merge the config files into the android kernel image to get it to compile. unless anyone can suggest a way to do that easily (windows or linux routine i dont mind)
the main sites ive used to help out ive listed below
http://benno.id.au/blog/ << somewhere on their theirs a link to the android root filesystem image. (http://benno.id.au/android/system.tar.gz and http://benno.id.au/android/data.tar.gz)
http://nemustech.blogspot.com/2007/12/android-porting-to-real-target-hw.html
http://euedge.com/blog/2007/12/06/google-android-runs-on-sharp-zaurus-sl-c760/
http://handhelds.org/moin/moin.cgi/BlueAngelKernel
the three above above links help even though their not scriptly related to android on blueangel
the rest of the files are in http://radiodmp.net/android-files/ - the 365mb file contains the 2 arm cross compilers and also both the newest blueangel linux kernel and the android kernel - as said above these need merging (android kernel needs to be the one that is the final kernel as its newer i believe
edit: ive just put the system and data tars linked above into the folder on my server also to save people time.
hope that helps
if anyone wants any help drop me a message and ill try and help out. will of course keep trying to sort it myself too
Any update on this?
Actively watching this thread and just wanted to know. I'd love to be able to play with Android.
good to see ppl interested. ive not had time to try and merge the kernels yet, hopefulyl might get chance this week
DJ_Steve said:
good to see ppl interested.
Click to expand...
Click to collapse
Still watching, still interested!
Keep it up.
Steve
ok managed to hack together the two kernels, compiling it as i type - hopefully it'll workon my BA

[Q] Installing KangBang 3.0

Hello XDA,
I've been following you for years. I started following you with my first Android phone, an HTC Hero. I've been very happy to be able to use a community ROM that made a far better experience than the stock ROM.
I recently got a brand new HTC One V PrimoU, and I'd like to make it my new polyvalent tool.
I'm not a noob in computers, kernel/linux related stuff, electronics, networking. I already tried some ROMs. In fact, I started with KangBang 3.0 (the same version as now I think), but both WiFi and BlueTooth were not working. Android could not even detected the WiFi MAC address, so I guess it was a driver or wireless chip firmware related problem. I think I was the only one affected, so it was maybe a bad flash or I used the wrong kernel. I did'nt investigate more at the time, but if it happens again to me, I'll send some system/kernel logs.
I then tried AOKP, had a great (really) experience with it, except that the Jack plug sound quality was awful. No bass, only mid/high tones. I even thought my speakers were dead at first, but then tried with headphones. Now, I want to try KangBang again, because that ROM was good, and fast, just missing WiFi.
TL;DR
I'd like to ask some precise questions about KangBang and the HTC One V.
I initially wanted to ask in the ROM dev thread, but can't since I'm a new user, so I ask here. Sorry if the questions are stupid/simple/answered, but let's make a clear base, with precise interrogations and answers, so that they will never be asked again
The kernel is included in the .zip file. Still, do we need to flash manually ? Or will the Aroma installer handle that ?
What about ROM Manager ? Is it recommended to use or is it a good way to brick a phone as I heard ?
Does this ROM change the base Android system and file structure ? Would it be compatible with a side-by-side installation of a Linux system such as Debian ? (To see what I mean by side by side installation of Linux, search Debian Kit for Android on Google, as I can't post links)
Also, I'd like to tell ROM makers these advices (don't take them bad, I you think I'm wrong about them there's no problem, just tell me why) :
It would not be a bad idea to give a simple statistic about the ROM : the load average with the ROM installed on an idle and clean phone. That would give a good indication of idle power consumption and ressource wasting.
I see that users reporting problems with their devices NEVER include any kind of debug information. Maybe you should ask for them, just because by searching for this debug information they might solve the problem themselves. Most Android systems and kernels report a LOT of information, that we can access with simple commands such as dmesg.
Last but not least, I would like to thank you, ROM developers and XDA users for allowing me to play this way with my phone, and to make it work exactly the way I want.
Hugo G.,
ummm this device has kangbang?? (btw questions go into q&a )
so i'll move onto the TL;DR which i was grateful for
1) The rom thread should say what kernel but yes, we don't have s-off so flashed manually
2) Ignore rom manager don't touch it
3) think of it as the differences say with debian vs ubuntu vs mint all basically debian but all with they're own differences (pros and cons)
also about the "suggestions" to the devs, that will NEVER go down well, why should YOU suggest to use what to put in the threads also i know in my threads i ASK for logcats time and time again...
hope this helps
if you need more info i'll be welcome to add more, but 1st i need sleep BADLY

[Need Help] Hook and override system method

Hello! i'm only today start read documentation by Xposed modules. And i have question.
For example in class android.os.UserManager has method getMaxSupportedUsers that return int.
Can i with xposed module hook calling of this method and override return value ? For simple, I want that method always returns 6.
Or is it impossible with Xposed?
P.s. sorry for my bad english
Yes, its possible.
PBombNZ said:
Yes, its possible.
Click to expand...
Click to collapse
Can you show the link where I can read about it or some small sample?
Firstly I recommend going to https://github.com/rovo89/XposedBridge/wiki . its made by rovo89 himself. Enough to help you get started and understand how xposed works. You could also look up some other developer's xposed module source code on github. It will help you understand how the to hook methods and stuff by looking at other people's code.
This guy's code is pretty basic but could be useful to understand how it works. https://github.com/veeti/DisableFla...isableflagsecure/DisableFlagSecureModule.java. This guy hooks the setFlag and setSecure methods of the Window class and SurfaceView class respectively and overrides the outcome. this will probably be system wide though, but you can change it so it only is enabled for certain applications. Also look at his "AndroidManifest.xml" and "assets/xposed_init" files. The Android Manifest contains xposed information and the the xposed_init file contains the full class name of the class which contains all the hooks (which tells xposed where to find your hook methods).
Hope that helps.

Kali Asus TF300T Native

Hey guys! I am pretty new to a lot of this rooting and custom ROM installs. I recently picked up an Asus TF300T from a friend at work which i have root(the easy part). The reason why i was looking into this or even a laptop was because i wanted to start tinkering with pen testing with Kali Linux. After a lot of research, trying to retain what information i could, i have found there is an image for Kali for armel. This brings 2 questions to mind that i cannot find the answers to. 1 - Even though the CPU on my Asus tablet is ARMv7 will armel images work? From what i have found, i would want to use an armhf image to flash to the device due to the version of the CPU. And 2 - Is there a distro(i have been unsuccessful finding one) that has the drivers required to make a smoothing working environment? During the course of my research into this issue, i have found there are some distributions of Ubuntu that currently work with my tablet. More specifically Ubuntu Touch(i think?). This got me thinking, since both Kali and Ubuntu are both Debian based distros(i could be wrong, please correct me if i am) could i take the section of the file system from Ubuntu Touch that has the drivers for my tablet that allow it to work correctly and replace it with the section of the file system for the ARM image of Kali? I should mention that i have been able to get Kali to install and run with Linux Deploy. However, i feel it is slower than i was anticipating. And all the tools are there, they just do not open for some reason. Which is a whole different issue that i haven't figured out yet. I was hoping that perhaps one of you may have an idea if the two questions i have posed will work, or could maybe shed some light on how to go about accomplishing what i am trying to do. Or if any of you know of a version of Kali that will work on my tablet or maybe even one someone has already built for this particular model. Any guidance, tips, or knowledge on this subject will be very much appreciated. I understand going out and buying a laptop or a tablet with an image supported on Kalis website would be the ideal and most efficient solution, but i have a bad habit taking the hard way to gain some more information and knowledge haha. Thank you all for taking the time to read this and thanks in advanced for any responses .
Kyle

[Q] Init.d support for 32.4.A.0.160

Hey everyone.
Can someone please tell me how to enable init.d support without magisk on 32.4.A.0.160 firmware, xperia z5 premium e6833. I am using ta poc+SuperSu arrangement and want to use some init scripts.
Regards
Adil
Isn't there anyone using init.d with SuperSU?
Well then can someone then please tell me how to use service.d or post-fs-data.d scripts. I have tried to use it but
1) In service.d, mounting scripts don't work or may be i am doing something wrong, do point out the error. I am just creating scripts and putting them in magisk/.core/service.d folder with permission 0755.
2) I have no idea how to use post-fs-data.d. I read somewhere that magisk runs those post-fs-data scripts that are included in the modules only and not the individual scripts themselves.
Please tell me how to run my scripts through any of these ways.
Regards
Adil
P.S: Don't just view the thread, try to help others, I mean that's why we all are here right! To learn...
I'm not sure why no one is answering or helping around here. Personally, I don't know how to help you. so I'm sorry. I may suggest asking in the Android general chat, not specifically this phone series. as even my own question has fallen on deaf ears. I found answers on other sites instead and am following on with those sites.
the Z5p seems to have become a bit of a graveyard now since anyone able or willing to develop for it has moved on to other devices, I've even looked into building myself but I need a more powerful computer so i'm stuck with what i'm able to find online.
I hope you figure out what you need to, to sort your problems. but my advice would be to not limit yourself to just one device forum. the question you ask is an android related question, not just for the model of phone you use. at least this is how I think it is. I could be wrong.
but if there is no one here to answer your question, i don't see any issue with the question being brought up in a forum with a wider reach.
Patrick Morgan said:
I'm not sure why no one is answering or helping around here. Personally, I don't know how to help you. so I'm sorry. I may suggest asking in the Android general chat, not specifically this phone series. as even my own question has fallen on deaf ears. I found answers on other sites instead and am following on with those sites.
the Z5p seems to have become a bit of a graveyard now since anyone able or willing to develop for it has moved on to other devices, I've even looked into building myself but I need a more powerful computer so i'm stuck with what i'm able to find online.
I hope you figure out what you need to, to sort your problems. but my advice would be to not limit yourself to just one device forum. the question you ask is an android related question, not just for the model of phone you use. at least this is how I think it is. I could be wrong.
but if there is no one here to answer your question, i don't see any issue with the question being brought up in a forum with a wider reach.
Click to expand...
Click to collapse
Thanks bro, I will try it in general forums. I just asked here so someone can just find a workaround for the device specific kernel....
Hello there im using init.d wirh magisk module thats called simple init.d enabler also if u have not magisk, init.d flashable zip available

Categories

Resources