A simple and basic custom Android system allows you to install system applications and pre-installed applications at the first time of booting, load service tools and other files, boot up the startup screen, set default input method, screen brightness, etc.
How to simply customize the Android system? Here are two methods:
The first is to use the mushroom ROM assistant to edit the system ROM. Please use it on Baidu.
The second is to add compilation rules to the source code. Copy files from the device project to the compiled and generated system.
Here is the second method, which uses the android4.4 system source code of Quanzhi T3.
1. Add our own compiled items
Modify the compiled file /android/device/softwinner/t3-p1/t3_p1.mk, add the following sentence
$(call inherit-product-if-exists, device/softwinner/t3-p1/test/)
2. Edit device/softwinner/t3-p1/test/ file.
PRODUCT_COPY_FILES += \ $(call find-copy-subdir-files,*,$(LOCAL_PATH)/apk,system/preinstall) \ $(call find-copy-subdir-files,*,$(LOCAL_PATH)/systemapk,system/app) \ $(call find-copy-subdir-files,*,$(LOCAL_PATH)/music,data/test/music) \ $(call find-copy-subdir-files,*,$(LOCAL_PATH)/video,data/test/video) \ $(call find-copy-subdir-files,*,$(LOCAL_PATH)/pic,data/test/pic) PRODUCT_COPY_FILES += \ device/softwinner/t3-p1/test/test_init:system/bin/test_init \ device/softwinner/t3-p1/test/gocsdk:system/bin/gocsdk #Note: 1. The first time you start, copying files and installing applications is slow, so you need to wait after entering the system;# 2. The system folder user cannot write, so it cannot be deleted;# 3. The pre-installed application can be uninstalled and will no longer appear after uninstallation;# 4、If you need to install it again,Delete the target board /data/document,Then restart
1. Installation system applications and general applications
PRODUCT_COPY_FILES is to copy files to the system, with the storage path in front and the target path in the back. The writing method of $(call find-copy-subdir-files, ***) can realize the copying of folders.
Create apk, systemapk, music, video, pic and other folders under the test folder.
system/preinstall is a pre-installed software that places APK files and can be uninstalled.
system/app is a system application, and it can't be uninstalled.
Because in device/softwinner/t3-p1/fstab.sun8iw11p1 /dev/block/by-name/system /system ext4 ro wait indicates that the mount method of /system is ro read-only. ROOT is to remount and modify the read and write permissions of this folder. In the case of non-ROOT, the file can be copied into it and the file cannot be deleted.
Note that copying the file will check whether it is an APK file. You need to comment out this check in android/build/core/makefile.
#define check-product-copy-files #$(if $(filter %.apk, $(1)),$(error \ # Prebuilt apk found in PRODUCT_COPY_FILES: $(1), use BUILD_PREBUILT instead!)) #endef
2. Loading service tools and other files
Then analyze the file. The following three sentences are to copy music, video, and pic to the target Android system. It can also be other files. Implement file customization.
The following two sentences are added tools, one of which is the shell command that sets the default value, and the other is a tool given by the Bluetooth vendor.
3. Set the default input method
One way to set the default input method is to create the service console and enter the settings instruction when it is turned on to set the default input method. Then run the service once when the /android\/device/softwinner/t3-p1/ file is loaded.
Among them, the default input method instruction is added to test_init.
#!/system/bin/sh settings put secure default_input_method /.PinyinIME
Join the service
service test_init /system/bin/sh /system/bin/test_init class core user root group root system oneshot
The Google Pinyin input method app should be placed in the preinstalled software or system application folder.
The app is installed, but this is not working, because the permissions are not enough, you need to modify the test_init permission and add it to the file
chmod 777 /system/bin/test_init
Note: Another way to set the default input method is to modify the default parameters. Modify the file of /device/softwinner/t3-p1/overlay/frameworks/base/packages/SettingsProvider/res/values. For details, please Baidu.
Now the settings directive supports limited options. Although there are many options for viewing the setting database, it is not easy to use.
The point is to modify test_init and enter the shell instructions you need before the Android system gets up. The Android system adds a startup service and will specify how to add a startup tool or service.
4. Start up screen and music
Quanzhi T3's android4.4 system source code boot screen and boot music are placed in android/device/softwinner/t3-p1/media