Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,728,180 Members 47,191 Now Online
XDA Developers Android and Mobile Development Forum

[TUTORIAL] Find out which shared libs (.so) are missing

Tip us?
 
_that
Old
#21  
Recognized Contributor
Thanks Meter 2309
Posts: 3,292
Join Date: Oct 2012
Quote:
Originally Posted by oracle01642 View Post
Can this be used to port apps? I am wanting to install some S5 apps on my Galaxy S4, but don't know what libs etc are needed. Could this be used to find out?
Read this, it may help:

http://forum.xda-developers.com/show...7&postcount=12
The Following User Says Thank You to _that For This Useful Post: [ Click to Expand ]
 
Krizthian
Old
#22  
Krizthian's Avatar
Junior Member
Thanks Meter 0
Posts: 4
Join Date: Sep 2013
Location: Portovelo

 
DONATE TO ME
Default Awesome

Your tutorial it's THE BEST!
 
oracle01642
Old
#23  
oracle01642's Avatar
Senior Member
Thanks Meter 80
Posts: 654
Join Date: Nov 2012
Quote:
Originally Posted by _that View Post
Why a binary? Rename the script to libdepv and you can call it already exactly like that.



For finding native library dependencies of apks, you need to decompile them, search the smali files for invokes of "loadLibrary" and trace the argument back to the string constant (usually it's just a few lines above the loadLibrary call). Prepend "lib" to the string constant and append ".so", that's the name of the required native library.

An example could look like this:

Code:
    const-string v0, "defcontainer_jni"
    invoke-static {v0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V
So we know that this app requires libdefcontainer_jni.so.
Are you saying we need to look for smali files with loadLibrary in the text? I have just looked at all of the smali files from an app I have just decompiled, and there isn't a single smali file with loadLibrary in the text. Sorry if I have misunderstood you.
 
_that
Old
#24  
Recognized Contributor
Thanks Meter 2309
Posts: 3,292
Join Date: Oct 2012
Quote:
Originally Posted by oracle01642 View Post
Are you saying we need to look for smali files with loadLibrary in the text?
Yes. Search *.smali for "loadLibrary" in lines that look similar to the second line in my example.

Quote:
Originally Posted by oracle01642 View Post
I have just looked at all of the smali files from an app I have just decompiled, and there isn't a single smali file with loadLibrary in the text. Sorry if I have misunderstood you.
Then this app doesn't load any native libraries and depends only on the framework (or it uses another method to load a library that is unknown to me).
 
startracker
Old
#25  
startracker's Avatar
Senior Member
Thanks Meter 186
Posts: 408
Join Date: Mar 2014
Location: MUMBAI
1>Copy all libs of port ROM

2>Paste in base ROM

3>Mark don't copy files which are already existing

4>To cross check see the number of items selected in status bar and number of marked √ libs.

5>Then say don't copy its over !

6>U get all the missing libs

That's what I do to get missing libs and it works!!


HIT THNX IF I HELPED U



Sent from my XT1022 using XDA Free mobile app
OWNER OF OPEN HOME PORT PROJECT
 
youngchaos
Old
#26  
youngchaos's Avatar
Senior Member
Thanks Meter 4
Posts: 143
Join Date: Jul 2013
Location: Rome
Quote:
Originally Posted by _that View Post
Why a binary? Rename the script to libdepv and you can call it already exactly like that.



For finding native library dependencies of apks, you need to decompile them, search the smali files for invokes of "loadLibrary" and trace the argument back to the string constant (usually it's just a few lines above the loadLibrary call). Prepend "lib" to the string constant and append ".so", that's the name of the required native library.

An example could look like this:

Code:
    const-string v0, "defcontainer_jni"
    invoke-static {v0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V
So we know that this app requires libdefcontainer_jni.so.

What smali to search for? Or do we need to check all the smali?
 
_that
Old
#27  
Recognized Contributor
Thanks Meter 2309
Posts: 3,292
Join Date: Oct 2012
Quote:
Originally Posted by youngchaos View Post
What smali to search for? Or do we need to check all the smali?
All smali files that contain the string "loadLibrary". Use grep or similar.

The Following User Says Thank You to _that For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes