Android Pre-installing NDK Application -
we trying pre-install ndk application /system/app
directory. if open apk file in zip file manager, .so
file inside lib directory. however, when preinstall apk
file, apk's .so
file not copied system/lib
directory, causing application fail when launched in device.
can please tell me should set in android.mk
apk file .so
file extracted apk file , copied system/lib
directory? need include application in system image.
any feedback appreciated.
thanks, artsylar
i had same need , after 2 days of heavy research, came solution problem. not simple , requires able modify android system code well.
basically packagemanagerservice prevents system applications unpack native binaries (.so files), unless have been updated. way fix modifying pms.java (aptly named since trying solve problem put me in terrible mood).
on system's first boot, check every system package native binaries writing ispackagenative(packageparser.package pkg) function:
private boolean ispackagenative(packageparser.package pkg) throws ioexception { final zipfile zipfile = new zipfile(pkg.mpath); final enumeration<? extends zipentry> privatezipentries = zipfile.entries(); while (privatezipentries.hasmoreelements()) { final zipentry zipentry = privatezipentries.nextelement(); final string zipentryname = zipentry.getname(); if(true) log.e(tag, " zipfile entry:"+zipentryname); if (zipentryname.endswith(".so")) { zipfile.close(); return true; } } zipfile.close(); return false; }
this function checks every package native library , if has one, unpack it. pms check in scanpackageli(....). search following code in method:
if (issystemapp(pkg) && !isupdatedsystemapp(pkg))
and add ispackagenative(pkg) check. there other small modifications required you'll figure out once have direction. hope helps!
Comments
Post a Comment