Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

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

OP tuxboy

14th May 2014, 11:24 PM   |  #21  
Recognized Contributor
Thanks Meter: 2,514
 
3,546 posts
Join Date:Joined: Oct 2012
More
Quote:
Originally Posted by oracle01642

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 2 Users Say Thank You to _that For This Useful Post: [ View ]
14th May 2014, 11:48 PM   |  #22  
Krizthian's Avatar
Member
Flag Portovelo
Thanks Meter: 11
 
35 posts
Join Date:Joined: Sep 2013
Donate to Me
More
Awesome
Your tutorial it's THE BEST!
15th May 2014, 12:07 AM   |  #23  
oracle01642's Avatar
Senior Member
Thanks Meter: 175
 
945 posts
Join Date:Joined: Nov 2012
More
Quote:
Originally Posted by _that

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.
15th May 2014, 12:38 AM   |  #24  
Recognized Contributor
Thanks Meter: 2,514
 
3,546 posts
Join Date:Joined: Oct 2012
More
Quote:
Originally Posted by oracle01642

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

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).
The Following User Says Thank You to _that For This Useful Post: [ View ]
28th May 2014, 03:47 PM   |  #25  
startracker's Avatar
Senior Member
Flag MUMBAI
Thanks Meter: 262
 
650 posts
Join Date:Joined: Mar 2014
More
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
9th July 2014, 09:00 AM   |  #26  
youngchaos's Avatar
Senior Member
Flag Rome
Thanks Meter: 6
 
176 posts
Join Date:Joined: Jul 2013
More
Quote:
Originally Posted by _that

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?
9th July 2014, 09:08 AM   |  #27  
Recognized Contributor
Thanks Meter: 2,514
 
3,546 posts
Join Date:Joined: Oct 2012
More
Quote:
Originally Posted by youngchaos

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 2 Users Say Thank You to _that For This Useful Post: [ View ]
27th July 2014, 07:17 PM   |  #28  
filchi756's Avatar
Senior Member
Flag Zhuhai
Thanks Meter: 823
 
1,354 posts
Join Date:Joined: Sep 2010
Donate to Me
Quote:
Originally Posted by _that

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.

With this method I fixed my FC's problem with the photo editor I'm trying to port to my tablet.

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes