How to pre-install the passive Google Play APK into the system (there is a little difference between source code and passive code, and there is no source code in the downloaded Google online after decompression)?
(Note that the Test below is the name we want to preset into the source code!! Google Play Store 4.6 downloaded online, the name contains spaces, remove the spaces or rename it directly)
1. Create a folder under packages/apps using the APK name that needs to be preset, and take prefabricating an APK named Test as an example.
2. Put it under packages/apps/Test
3. Create a file under packages/apps/Test, with the file contents as follows:
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) # Module name should match apk name to be installed LOCAL_MODULE := Test LOCAL_MODULE_TAGS := optional LOCAL_SRC_FILES := $(LOCAL_MODULE).apk LOCAL_MODULE_CLASS := APPS LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX) LOCAL_CERTIFICATE := PRESIGNED include $(BUILD_PREBUILT)
4. Open the file build/target/product/${Project}.mk (where ${Project} represents the project name)
Add Test to PRODUCT_PACKAGES.
PRODUCT_PACKAGES := \ DeskClock \ Calculator \ Calendar \ Camera2 \ Email \ Test
Note: Preset Google Play does not require step 5! (No so library)
5. Copy the unzipped so library to the alps/vendor/mediatek/${Project}/artifacts/out/target/product/${Project}/system/lib/ directory. If there is no so library, remove this step;
6. Compilation
Compile preset apk module separately
1. First, there is a script file in the build directory under the Android source code directory. After executing this script file, you can obtain some useful tools:
USER-NAME@MACHINE-NAME:~/Android$ . ./build/
Note that this is a source command. After execution, there will be some additional commands available:
2. Specify the compilation mode
lunch 20 (Take 20 eng as an example.)
3. Use the mmmm command to compile the specified module.
Execute in the source root directory
.....Android # mmm packages/apps/Test
After compilation is completed, you can see the file in the out/target/product/generic/system/app directory. All apps that come with Android are placed in this directory.
4. After compiling the module, you must repackage the file.
Execute the following command in the root directory of the Android source code:
USER-NAME@MACHINE-NAME:~/Android$ make snod
Once finished, it can be burned onto the board! ! ! !
Summarize
The above is the entire content of this article. I hope that the content of this article has certain reference value for your study or work. Thank you for your support. If you want to know more about it, please see the relevant links below