last24 / smali

Automatically exported from code.google.com/p/smali
0 stars 0 forks source link

Strange unavailable API references after dodexing Browser.odex #88

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I did not have any issues while odexing 2.3.3 Browser.odex.
However, while using ASM against it, I am experiencing some strange issues.
The dex file is referring to following classes that are not available in any of 
the Android.jar or even in the SDK documentation:
    android.webkit.WebBackForwardListClient
    android.webkit.WebView$DragTracker
    com.android.internal.preference.YesNoPreference

What is even strange is that, if I look in the browser code, it does have 
references to these classes.
https://github.com/android/platform_packages_apps_browser/blob/master/src/com/an
droid/browser/Tab.java

The fact that, browser code does have reference to these classes tells me that, 
this is probably not an smali issue, but I figured to start here and hopefully 
get some pointers.

Thanks,
Smith

Original issue reported on code.google.com by pnp.smit...@gmail.com on 8 Nov 2011 at 2:54

GoogleCodeExporter commented 9 years ago
Hmm. By "android.jar" - do you mean the android.jar that's released for each 
api level with the android SDK?

Assuming that's what you mean, you have to keep in mind that the sdk only 
contains classes/methods that are included in the public API. However, there 
are many more APIs that are present on an android device that aren't made 
publicly available for applications to use via the SDK. These "internal" APIs 
are not private in the sense of a private java member, but private in the sense 
that they aren't made available in the SDK.

If you look at the source for android.webkit.WebBackForwardListClient, or the 
other classes you mentioned, you should find a @hide annotation on the class - 
which indicates that it is an internal API and won't be present in the SDK.

Original comment by jesusfreke@jesusfreke.com on 8 Nov 2011 at 3:34

GoogleCodeExporter commented 9 years ago
Yes, I was referring to android SDK API.

Thanks for the quick response!
I wish, I asked this question sooner :)
I am new to this stuff and hence spent quite some time to try and figure this 
out today...

Now, I need to figure out, how to keep ASM happy, since it needs all the class 
files referred in the .class file...

Thanks,
Smith

Original comment by pnp.smit...@gmail.com on 8 Nov 2011 at 7:37

GoogleCodeExporter commented 9 years ago
What are you trying to do with ASM, out of curiosity?

Original comment by jesusfreke@jesusfreke.com on 8 Nov 2011 at 7:44

GoogleCodeExporter commented 9 years ago
Trying to tweak some browser behavior for experimentation purpose.

Thanks,
Smith

Original comment by pnp.smit...@gmail.com on 8 Nov 2011 at 8:47

GoogleCodeExporter commented 9 years ago
Why are you using ASM though? Why not tweak the smali bytecode directly? Or 
better yet, why not download the android source, and build the browser from 
scratch? :)

Original comment by jesusfreke@jesusfreke.com on 8 Nov 2011 at 4:02

GoogleCodeExporter commented 9 years ago
Doing programmatic binary instrumentation was the goal of my experiment.
Being new to this area, I felt that ASM provides a structured way to do
programmatic instrumentation and hence trying to use it.
But may be I will have to tweak smali bytecode directly.

Original comment by pnp.smit...@gmail.com on 9 Nov 2011 at 7:28