I have an APK file with the bundled native libs. When I install them using adb the libraries are correctly created at <path-to_package>/lib/, But I have to integrate my apk to the build system along with the Android.mk file. What I need to add in the make to get the libs extracted on to the target
Extract native libs from prebuilt apk file using Android.mk
3.2k Views Asked by Vimalakshi Adiga At
2
There are 2 best solutions below
2
semw
On
If you have libraries then copy libraries and create a folder in aosp_source/external/yourlibfolder and paste your libraries there.
Go to build/target/product and write this code in your relevant make file(e.g handhel_system.mk) for each of library. Replace yourlibname with each library name
external/yourlibfolder/yourlibname.so:system/lib/yourlibname.so \
external/yourlibfolder/yourlibname.so:system/lib64/yourlibname.so \
- It will add app dependent libraries in AOSP. Now when you add your Pre-built apk in AOSP it will work
Create a folder in packages/app/yourappfolder and paste APK and make file there
This should be your make file
# Adding Apk as system app in AOSP
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := Appname # It should be your apk name, and folder name should also be same
LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_SUFFIX := .apk
LOCAL_MODULE_CLASS := APPS
LOCAL_CERTIFICATE := platform
include $(BUILD_PREBUILT)
Related Questions in ANDROID
- Creating global Class holder
- Flutter + Dart: Editing name of a tab shows up a black screen
- android-pdf-viewer Received status code 401 from server: Unauthorized
- Sdk 34 WRITE_EXTERNAL_STORAGE not working
- ussd reader in Recket Native module
- Incorrect display of LinearGradientBrush in IOS
- The Binary Version Of its metadata is 1.8.0, expected Version is 1.6.0 build error
- I can't make TextInput to auto expand properly in Android
- Creating multiple instances of a class with different initializing values in Flutter
- How to create a lottie animation
- making android analyze with coverity sast tool
- Flutter plugin development android src not opening after opening example
- I initialize my ViewModel in the Activity with several fragments as tabs, but the fragments(tabs) return null for the updated livedata
- Node.js Server + Socket.IO + Android Mobile Applicatoin XHR Polling Error...?
- How I can use the shared preferences class?
Related Questions in ANDROID-NDK
- android ndk application can not run macrobenchmark?
- How to enable echo-cancellation on Android Voip App?
- libcrypto.so: error adding symbols: File in wrong format clang++: error: linker command failed with exit code 1
- Andriod phone accelerometer reading: native code vs. Android API
- python - embed python into android - using c++ to call python source files
- Troubles with linking Rust lib when compiling as shared lib for Android using NDK
- Android ANR when calling OnPause in libc.so
- Android NDK: Linker Script .ld: OVERLAY : gives ld:4: malformed number: :
- I don't know how to solve "local reference table overflow" error in android JNI
- C++: Text was not handled properly, first \r\n was not parsed
- Error when using ndk-build in android studio
- ld.exe cannot find "-ldl, -lm, -landroid, etc" on Delphi
- Android AGDE Visual Studio plug-in breakpoints not working in other threads
- Why arm64 pass params throught register x8-x17?
- What is the exactly time that JNI release the LocalReference automatically?
Related Questions in ANDROID-INSTALL-APK
- Deploying an Android app on devices without Play Store account
- Android app running fine on emulator but gives error parsing package when made to run on real device
- Android - Bypassing install permission programmatically for enterprise apps from third-party sources
- Building Android application inside android OS
- which apk runs on the Android device ionic
- Error encountered installing apk to device : INSTALL_FAILED_NO_MATCHING_ABIS
- Intent to install APK file - Android Nougat
- How to install/update/remove APK using "PackageInstaller" class in Android L?
- Identifying an Android application even between builds
- Strange apk sizes android studio 2.3.3
- Android Studio : Error while Installing APKs (Path confusion from Windows to Linux)
- Dismiss android dialog "installing app"
- Parse Error Installing custom built .apk
- apk not listed in app installer in phone
- How to connect a mobile device and install android application in that device?
Related Questions in ANDROID-NATIVE-LIBRARY
- Paging 3 Library with Jetpack Compose Not calling the load method after initial load
- Lock an AhardwareBuffer with multiple layers
- Accessing native libraries files
- "Android Resource Linking Failure: Style Not Found in .aar Library"
- Native library not found when loading
- Android App bundle install not placing native libs in the lib/$ABI folder
- Flutter plugin as a binary or library
- Is native library being built into incorrect folder? Android
- Android app crashes on load library, cannot find entry point getThreadLocalsEv, how to fix? [example added]
- How to execute programs of different languages in android app
- Native Library working correctly for install-time module but doesn't work as expected for on-demand module
- How to acquire Wake lock in Android native service in AAOS?
- Native Android code executes even if I don't package libc++_shared.so
- Line Chart Using MPChartAandroid
- One Plus Nord - MediaStore.EXTRA_DURATION_LIMIT - not working., Unable to set the time limit
Related Questions in ANDROID-MAKE
- How to build Windows binaries such as adb.exe when building AOSP in Linux
- AOSP - how to get final contents of PRODUCT_PACKAGES while building
- AOSP 13 build variable PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD not working
- Unable to compile ramdisk with libcryptsetup in AOSP
- How to list all possible packages / modules in AOSP via command line?
- How to shrink resources and remove unused language resources with Android.mk
- Does Android.mk require AndroidManifest.xml?
- APK built using Android.mk mm command not running in device after install
- Share single copy of structure/data defined in shared library to different objects defined in multiple shared libraries
- Extract native libs from prebuilt apk file using Android.mk
- How to add an app with Android Room as a system app compiled with the makefile?
- Android Java with Native C undefined reference to `__android_log_print'
- Getting SystemProperties.java class using android:sharedUserId="android.uid.system" attributes
- android project build on Linux but not on windows
- How to add .so file in Android.mk file?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You can find an example in AOSP, e.g. in
external/chromium-webviewproject:Android.mk(outdated): https://android.googlesource.com/platform/external/chromium-webview/+/refs/heads/android10-d4-release/Android.mkAndroid.bp: https://android.googlesource.com/platform/external/chromium-webview/+/refs/heads/master/Android.bp.Also some related topics were already discussed on SO: