A33 Android4.4 pre-installed its own APK

Platform: A33 Android4.4 

Pre-installed apk name: Louhn.apk

step:

1. Add PRODUCT_PACKAGES in astar_y3.mk

--- a/android4.4/device/softwinner/astar-y3/astar_y3.mk
+++ b/android4.4/device/softwinner/astar-y3/astar_y3.mk
@@ -14,6 +14,12 @@ PRODUCT_PROPERTY_OVERRIDES += \
 # google pinyin
 PRODUCT_PACKAGES += GooglePinyin
 

+PRODUCT_PACKAGES += Louhn
 # init.rc, kernel
 ##	device/softwinner/astar-y3/media/bootanimation.zip:system/media/bootanimation.zip 
 ##	device/softwinner/astar-y3/media/boot.wav:system/media/boot.wav 

2. Put Louhn.apk in the /device/softwinner/polaris-common/prebuild/apk/ directory and modify Android.mk

Several key points of Android.mk

LOCAL_MODULE := Louhn                                        apk名字

LOCAL_MODULE_TAGS:= optional mode selection, user, eng, tests, optional, select optional here, which means that the apk can be packaged into system.img in any mode

LOCAL_MODULE_PATH := $(TARGET_OUT)/app Select the apk path, select $(TARGET_OUT)/app to indicate that the apk is placed in the /system/app directory, so that the user cannot delete the apk. If you want the user to be able to delete the apk, Just delete this section of configuration

LOCAL_REQUIRED_MODULES := libserial_port libserial_port is the added so library. Since my apk only uses one so library, only one name is added here. If the apk has multiple so libraries, multiple names must be added. The name of the specific so library, you can unzip your apk, view it in the lib->armeabi directory in the compressed file

--- a/android4.4/device/softwinner/polaris-common/prebuild/apk/Android.mk
+++ b/android4.4/device/softwinner/polaris-common/prebuild/apk/Android.mk
@@ -17,6 +17,19 @@
 
 LOCAL_PATH := $(call my-dir)
 
+######add by louhn#########
+include $(CLEAR_VARS)
+LOCAL_MODULE := Louhn
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_CLASS := APPS
+LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
+LOCAL_CERTIFICATE := PRESIGNED
+LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
+LOCAL_MODULE_PATH := $(TARGET_OUT)/app
+LOCAL_REQUIRED_MODULES := libserial_port
+include $(BUILD_PREBUILT)
+
+
 ################################################################################
 include $(CLEAR_VARS)
 LOCAL_MODULE := 4KPlayer

3. Put the so file extracted in 2 steps into the device/softwinner/polaris-common/prebuild/apklib/ directory, and modify the Android.mk file in the same level directory, and add the corresponding so library

diff --git a/android4.4/device/softwinner/polaris-common/prebuild/apklib/Android.mk b/android4.4/device/softwinner/polaris-common/prebuild/apklib/Android.mk
index 1378a7e81e..2932706762 100755
--- a/android4.4/device/softwinner/polaris-common/prebuild/apklib/Android.mk
+++ b/android4.4/device/softwinner/polaris-common/prebuild/apklib/Android.mk
@@ -31,5 +31,7 @@ LOCAL_PREBUILT_LIBS := libgnustl_shared.so \
                        libjni_googlepinyinime_latinime_5.so \
                        libjni_hmm_shared_engine.so \
                        libpinyin_data_bundle.so \
-					   libnoise_generator.so
+		       libnoise_generator.so \
+		       libserial_port.so
+
 include $(BUILD_MULTI_PREBUILT)
diff --git a/android4.4/device/softwinner/polaris-common/prebuild/apklib/libserial_port.so b/android4.4/device/softwinner/polaris-common/prebuild/apklib/libserial_port.so
new file mode 100644
index 0000000000..4eea035115
Binary files /dev/null and b/android4.4/device/softwinner/polaris-common/prebuild/apklib/libserial_port.so differ

 

Guess you like

Origin blog.csdn.net/Mrdeath/article/details/111034524