UnsatisfiedLinkError : Android 6+ compatibility for legacy apk ? (dlopen failed) - Android Q&A, Help & Troubleshooting

Hello XDA World
I have a third-party legacy app that works on Android up to 5.1, that is no longer maintained and I only have the apk and not the source code.
On Android 6+ the following error occurs : java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZN7android6Parcel13writeString16EPKtj"
It seems to be the same error that was investigated and solved by mickybart on the post https://forum.xda-developers.com/showpost.php?p=63288490&postcount=2863 for another app.
Unfortunately I don't really have the background and skills to understand and solve this error myself.
My questions are :
- Is there a way to solve this missing symbol issue for a third-party app without having the source code of the app ?
- would this require disassembling and reverse engineering the app ?
- or would it be possible to add some library to Android 6+ that would restore the missing symbol ?
- or using some kind of wrapper around the app to provide the missing link ?
- if one of the above solutions is possible, would it be possible to install / run the app without rooting the phone ?
- or would this require to be root or to build a custom AOSP / LineageOS rom to insert the missing symbol / library ?
Any help, idea, hint are welcome
Thank you !

Additional questions
The missing function / symbol seems to be inside libbinder.so
Do you have more information about this library ? How critical is it for the whole system ?
Do you think there is any chance of success replacing the Android 6+ library in /system/lib with an older lib version from Android 5.1 if I got root access to the phone or using TWRP file manager ?
Would this risk to totally brick the phone ? If replacing the lib doesn't work, would I be able to revert to the old config ?
Also, is there a way in Android to force an app to use another lib than the regular one stored in /system/lib ?
something like changing the path or the name of the lib, or like in windows, copying the dll inside the folder of the app ... :silly:
Thank you !

Hello again,
so of course, as expected replacing Android 6 libbinder.so with an Android 5 libbinder.so doesn't work
the phone stayed stuck at boot logo, but it was possible to replace back the old library with twrp file manager
Yet, the issue is still there ... how can I get a libbinder.so library on Android 6+ without the missing symbol issue ?
I suppose that my best option, would be to get the source code of the libbinder.so for my targeted android version and compile it with the modifications committed by mickybart on github : [github.com/mickybart/android_frameworks_native/commit/8e9d34326128ec2b39e543e016ec21342d1c3deb] (sorry can't post external links as new user)
But I'm totally noob at compiling android, I would really appreciate someone's help : I know there are tutorials to compile a full Lineage or CyanogenMod rom ... but it takes dozens of GB to download and lot of hours to install and then to build the full rom
I only need to download / modify / compile a single library and eventually its dependencies ?
Do you know a way to do it ?
Or a better way to fix the missing symbol issue described in first post ?
Thank you.

Related

[Q] How to make a recovery-flashable Firefox OS rom?

Hi,
I'm actually trying to port Firefox OS 2.1 on the Nexus 7 2013 (aka "flo"), and after managed to download and compile the sources, I am facing a problem at the last step. Instead of flashing Firefox OS on my Nexus via the conventional method (using flash.sh), I would like to create a recovery-flashable zip file (as is often seen with custom ROMs). However, I have no idea how to build one, and the analysis of some zip files does not really helped me to understand which files to include and which script to write.
Here are the files generated by the build: http :// i.imgur.com / MgobUsp.png
If anyone could help me and explain me how to create that famous zip file ^^.
In advance,
thank you
Nobody? :-/
@cmbaughman was working on this in this thread: http://forum.xda-developers.com/showthread.php?t=2479192&page=6
ImCoKeMaN said:
@cmbaughman was working on this in this thread: http://forum.xda-developers.com/showthread.php?t=2479192&page=6
Click to expand...
Click to collapse
Due to a large project that came my way at work, I've been unable to work on this however I hope to in a few weeks after we demo our new apps. If you want to check mine out it's here http://goo.gl/gioiDv however the only real issue with mine which is quite fixable was that I used the wrong version of the Gaia, and webapps. You can use mine as a template really, here is how:
1. Build FF OS
2. Now when building ( I am going from memory here so ask if you ha e questions), pass the argument otapackage and you'll get a "flashable" update.zip in your out dir.
3. Find either a fully built version of ff for any device but make sure its the same version, OR build Gaia yourself, see the official docs for how to do that as they explain it very well.
4. From that you go through the output and find the webapps dir.
5. Copy webapps to your built otapckage at /system/b2g/webapps.
6. Now I'd use either my update script from the link I gave you (after looking through and updating anything that needs updated because mine is a few months old.) Make sure there is nothing in there about formatting data or anything (cause you don't want to lose that!) And after repackaging (use a kitchen or whatever method you prefer), you'll have a flashable Firefox zip.
Its a process so use a little trial and error and you'll overcome any issues you find. Any questions let me know.
ImCoKeMaN said:
@cmbaughman was working on this in this thread: http://forum.xda-developers.com/showthread.php?t=2479192&page=6
Click to expand...
Click to collapse
Due to a large project that came my way at work, I've been unable to work on this however I hope to in a few weeks after we demo our new apps. If you want to check mine out it's here http://goo.gl/gioiDv however the only real issue with mine which is quite fixable was that I used the wrong version of the Gaia, and webapps. You can use mine as a template really, here is how:
1. Build FF OS
2. Now
any progress on this im intrested in doing this
Don't waste your time creating such a zip file, just use fastboot to flash the various IMG compiled files.

[Q] Modifying (android ROM || AOSP source code) to run a tablet with only one app

I'm using Lenovo Ideatab A3000-h,
I want to make it to be set to run only one app after booting, not even the home page could run then, it will open at the app and still at it forever, I know it's a common need and this has been asked a lot of times before, So, after searching I discovered that there is three options :
1- Creating my own Custom ROM.
2- Making my application a launcher application using android manifest.
3- run a kiosk mode like surlock.
4- Modifying AOSP source code.
So, after a lot of search, I found that the third option can be easily broken be entering the tablet in safe mode and try to remove app then, or by removing it from accessing the tab by PC, and the second option can be broken by the same way.
So, all I got now is to use either the first option or the forth option, and when taking about the first option, thanks to NeroYoung I already know how to:
setting up android kitchen.
modifying ROM img files and jar files.
modifying build.prop.
generating the resulted Custom ROM.
but I don't know the way to reach my needs by customizing a ROM, so, all I want to know is how to modify the custom/stock ROM to achieve my requirement of booting to only a specific app. also if there is another way by making (System Backup ----> Modify ----> Restore Modified System) it will be great.
and when taking about the forth option, I already downloaded the source code and did know how to access it's resources, but don't know where is the source code that controls the start-up process and how to modify it. thanks in advance for all future contributors.

[Q] Signing as a system app - failed to install - CyanogenMod

Hi!
I'm preparing a plugin for a vendor of ROM (a small phone manufacturer) and I need this plugin to have system permission. I've tested this on a rooted Cyanogenmod install by putting the app into /system/priv-app directory and it works.
Taking this a step further, I signed the application with Cyanogenmod platform keys from the source repository (platform.pk8 and platform.x509.pem). I've successfully verified that the key used to sign release build is indeed the one from platform.x509.pem.
When I try to install this application via "adb install" I get the following error: Failure [INSTALL_FAILED_INVALID_INSTALL_LOCATION]
Investigating further, it seems that installation of applications signed with platform key is not allowed (anymore): http://stackoverflow.com/questions/...o-install-a-platform-signed-app-to-user-space
Looking in the source of PackageManagerService.java in the current Android source[1], I don't see this restriction, but I doo see it in CyanogenMod source tree[2] with this commit[3].
The question is: is this the correct approach for non-CM ROMs? What is the preferred way to work around this for CM (apart from building a custom ROM and removing this piece of code, that is)?
Regards,
Miha.
[1]: http://grepcode.com/file/repository...android/server/pm/PackageManagerService.java/
[2]: https://github.com/CyanogenMod/andr...id/server/pm/PackageManagerService.java#L4592
[3]: https://github.com/CyanogenMod/andr...mmit/6b6ca8c8b2c11de5aed6d3df00729e69f34297f6

[Q] Editing Android Kernel - looking for NFC/HCE Code

Hi,
I'm currently in the process of developing a project for my University course wherein I will be hopefully editing the functionality of the HCE Feature of Android to allow me to set my own UID when emulating a card.
Now, i've downloaded the AOSP source, and built a custom image with no edited code and installed that to my Nexus 7 (This includes downloading and including the Vendor specific hardware drivers), and i'm stuck on the next part.
I physically cannot find the device code that governs the NFC features of Android, and i'm unsure how to go about a) Looking for it, and b) How I should be editing this code.
Is the code for NFC in Android in the base Kernel? and if so how would I edit that before I run "make" again and hope it builds? or is it elsewhere? I've noticed that the files in the Vendor folder i've downloaded and extracted are in a .ncd format, which I don't think is editable.
Any help I can get on this would be greatly appreciated.

AOSP Development - Android 10 - Creating System Service

Hello Everyone,
This is regarding modifying AOSP and trying to add my own system service as part of the system for customized application. I have tried all the places I could from documentation on source.android.com to trying to post a query on their official Google Groups and also tried out reading out books on AOSP. Unfortunately the OS code is changing so rapidly the documentation is rather old and not up to date. And now this seems to be my last hope to find a lead on how to achieve this.
(This is the first time I am posting so please guide me in case of discrepancies)
So, I am trying to create a system service from scratch and bake it inside the AOSP build. The steps I figured out and followed are as following:
1. Create an AIDL file inside frameworks/base/core/java/android/os/IFooService.aidl
2. Create the implementation in frameworks/base/services/core/java/com/android/server/FooService.java
3. Modify SystemServer.java at frameworks/base/services/java/com/android/server/SystemServer.java and use the ServiceManager to start the service.
4. I need to specify SELinux permissions which I wasn't able to figure out even after checking out whatsoever documentation I can find online. So I went to device/google/bonito/BoardConfig-common.mk file and added BOARD_KERNEL_CMDLINE += androidboot.selinux=permissive text to ensure I get through the SELinux enforcement (though I know its a temporary solution).
5. I modified Android.bp file under frameworks/base to include IFooService.aidl file during compilation.
Unfortunately, after I successfully built the project and try to flash it on the Pixel 3a, the system is stuck at boot with Android logo.
I could see the service was successfully started after checking logcat and logcat -b but dies soon after. I can see that's the case with all the other services too. So probably its the boot time issue. Secondly, I can see the SEPolicy warning but the permissive parameter is set to 1 so that shouldn't be the issue. But still the Android doesn't boots up.
So my question is, is this the right way to define a new system service? I also read that it is not recommended to make changes to original files and try to create new service in the vendor directory. In this article https://devarea.com/aosp-creating-a-system-service/ it does just that by creating a persistent app inside the vendor directory and hosting the service inside. I tried even that but the build fails. And I could see the SELinux implementation has changed a lot with a need to include version compatibility changes which has to be incorporated manually but there is very limited and too confusing documentation regarding that!
Please guide me on what I might be doing wrong and how to resolve it? I have tried AOSP books, documentation and browsing the source code in last 30 days but with no luck.
I am also planning to share a comprehensive sample with the community post this because I feel it could help many people trying incorporate new system services and the documentation is also few and far between.
I'll add the actual code and logs if anyone can help me finding a way.
Thanks,
Gaurav

Categories

Resources