1

I'm digging into Android's kernel to find out the way Binder is done in the Kernel level as well as how it is used in implementing Java's APIs.

Currently I'm looking at android/os/Parcel.java, there's a lot of native functions declared as prototypes like these:

public final native int dataSize();
public final native int dataAvail();
...

but there is no System.loadLibrary so I don't know where the implementations of those prototypes are written.

My question is different from these:

Community
  • 1
  • 1
Max
  • 3,824
  • 8
  • 41
  • 62

1 Answers1

1

The library doesn't have to be loaded by the class that uses the native libraries. Someplace, in some library, there needs to be a C function Java_android_os_Parcel_dataSize(). It doesn't matter where it is, it just needs to be somewhere. You should be able to use grep to find it.

Ernest Friedman-Hill
  • 80,601
  • 10
  • 150
  • 186
  • I couldn't, there is no results for "Java_android_os_Parcel_dataSize()" – Max Mar 18 '13 at 04:05
  • 1
    @crazyfffan There doesn't even have to be that, just a function somewhere with the correct signature that is registered with JNI by that name. Try searching for "Java_android_os_Parcel_dataSize". – user207421 Mar 18 '13 at 04:16
  • @EJP Hi there, thank you for your reply. There is no results for "Java_android_os_Parcel_dataSize" as well... – Max Mar 18 '13 at 04:24