Home>

Simple basic custom android system, so that system applications and pre-installed applications are installed at the first boot,Load service tools and other files,Startup splash screen,Set the default input method, screen brightness, and more.

How to easily customize the android system?There are two ways:

The first is to use the mushroom ROM assistant to edit the system ROM. Please use Baidu.

The second is to add compilation rules to the source code.Copy the files in the device project to the compiled system.

Here is the second method,Using the Android4.4 system source code of Quanzhi t3.

1. Add our own compilation item

Modify the compiled file /android/device/softwinner/t3-p1/t3_p1.mk and add the following sentence

$(call inherit-product-if-exists, device/softwinner/t3-p1/test/test.mk)

2. Edit the device/softwinner/t3-p1/test/test.mk 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. First start,Copying files and installing apps is slow.
Wait after entering the system;
#2. The system folder user cannot write.
So it cannot be deleted;
#3, pre-installed applications can be uninstalled,No longer appears after uninstallation;
#4. If you need to install again,Delete the /data/system.notfristrun file of the target board and restart

One installation system application and general application

product_copy_files is copying files to the system,The front is the storage path,Followed by the target path,$(Call find-copy-subdir-files, ***) can be used to copy folders.

Create apk, systemapk, music, video, pic and other folders under the test folder.

system/preinstall is pre-installed software,Place the apk file to uninstall.

system/app is a system application,Place the apk file. It cannot 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.If the file is not rooted, it can be deleted.

Note that copying the file will check if 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

Load service tools and other files

Then analyze the test.mk file, the following three sentences are copied music, video, pic to the target android system. It can also be another file.Customize files.

The next two sentences are added tools,One of them is a shell command that sets default values, and the other is a tool provided by the Bluetooth vendor.

Set the default input method

One way to set the default input method is to create a service console and enter the settings command at startup to set the default input method.Then the /android\/device/softwinner/t3-p1/init.rc file is loaded to run the service once.

Among them, add the default input method instruction in test_init.

#!/system/bin/sh
settings put secure default_input_method com.google.android.inputmethod.pinyin/.pinyinime

init.rc join service

service test_init/system/bin/sh/system/bin/test_init
class core
user root
group root system
oneshot

Google pinyin input method app should be placed in the pre-installed software or system application folder.

The app is also installed,This doesn't work,Because of insufficient authority,Need to modify test_init permissions, add in init.rc file

chmod 777/system/bin/test_init

Note:Another way to set the default input method is to modify the default parameters.Modify the/device/softwinner/t3-p1/overlay/frameworks/base/packages/settingsprovider/res/values ​​defaults.xml file. For details, please Baidu.

The options supported by the settings directive are limited,Although there are many options for viewing the setting database,But not easy to use.

The point is, modify test_init, you can enter the shell instructions you need before the android system gets up. Adding a startup service to the android system will specifically explain how to add a startup tool or service.

Four startup splash screen and music

Quanzhi t3's Android4.4 system source boot screen and boot music are placed in android/device/softwinner/t3-p1/media

  • Previous Talking about Angular6 services and dependency injection
  • Next Spring boot implements file upload function
  • Trends