Support bootanimation.mp4 and bootanimation.zip two file formats
The two files exist at the same time to play mp4 with a higher priority than zip. For the specific priority, see frameworks/base/cmds/bootanimation/BootAnimation.cpp
The boot animation started for the first time after burning the mirror is native Android, and a restart is required to display the replacement boot animation.
/*
* Read the persistent locale. Inspects the following system properties
* (in order) and returns the first non-empty property in the list :
*
* (1) persist.sys.locale
* (2) persist.sys.language/country/localevar (country and localevar are
* inspected iff. language is non-empty.
* (3) ro.product.locale
* (4) ro.product.locale.language/region
*
* Note that we need to inspect persist.sys.language/country/localevar to
* preserve language settings for devices that are upgrading from Lollipop
* to M. The same goes for ro.product.locale.language/region as well.
*/
const std::string readLocale()
{
const std::string locale = GetProperty("persist.sys.locale", "");
if (!locale.empty()) {
return locale;
}
const std::string language = GetProperty("persist.sys.language", "");
if (!language.empty()) {
const std::string country = GetProperty("persist.sys.country", "");
const std::string variant = GetProperty("persist.sys.localevar", "");
std::string out = language;
if (!country.empty()) {
out = out + "-" + country;
}
if (!variant.empty()) {
out = out + "-" + variant;
}
return out;
}
const std::string productLocale = GetProperty("ro.product.locale", "");
if (!productLocale.empty()) {
return productLocale;
}
// If persist.sys.locale and ro.product.locale are missing,
// construct a locale value from the individual locale components.
const std::string productLanguage = GetProperty("ro.product.locale.language", "en");
const std::string productRegion = GetProperty("ro.product.locale.region", "US");
return productLanguage + "-" + productRegion;
}
Built-in third-party APP
Such as new test.apk
h618-android12.0\vendor\aw\public\prebuild\apk Put your apk and Android.bp
H618 is pre-installed into private-app. Due to permission restrictions, there will be APP problems. For adding permissions, please refer to the APP special permission problem.
4、Due to the relatively cumbersome permission issues, providing mirroring support wakes up the app under the /system/app/path
h618_android12_p2_uart0-bootup-test-20241022.img
First confirm whether adb install can open apk normally
Uninstall apk
Install as system app through adb push
adb root; adb remount;
// adb push (Apk path to push) Path on main board
adb push ./app /system/priv-app/
adb reboot
After booting, the APP is called in the background.
APK private-app push replacement
adb root; adb remount; // Rooting can modify the read-only partition
adb push (The path to your APK) /system/priv-app/
adb reboot //restart, android will retrieve /system/priv-app/apk to install
At present, the desktop APP is a special application. If special permissions are added, there may be a problem that the system cannot get up. It is necessary to grab the APP-related log logs.
# logcat | grep com.example.myapplication3(package name of Androidapk)
09-14 10:36:06.662 3826 3826 W PackageManager: Privileged permission android.permission.INSTALL_PACKAGES for package com.example.myapplication3 (/system/priv-app/LauncherJingWei) not in privapp-permissions allowlist
09-14 10:36:08.437 3826 3826 W PackageManager: Privileged permission android.permission.INSTALL_PACKAGES for package com.example.myapplication3 (/system/priv-app/LauncherJingWei) not in privapp-permissions allowlist
Add permissions based on log information
SDK
modify frameworks/base/data/etc/privapp-permissions-platform.xml
recompile and burn
On the main board
/etc/permissions/privapp-permissions-platform.xml
According to the log modification android.permission. INSTALL_PACKAGES content is as follows, other errors are similar to the following:
--- a/frameworks/base/data/etc/privapp-permissions-platform.xml
+++ b/frameworks/base/data/etc/privapp-permissions-platform.xml
@@ -550,4 +550,8 @@ applications that come with the platform
<privapp-permissions package="com.android.calllogbackup">
<permission name="com.android.voicemail.permission.READ_VOICEMAIL"/>
</privapp-permissions>
+
+ <privapp-permissions package="com.example.myapplication3">
+ <permission name="android.permission.INSTALL_PACKAGES"/>
+ </privapp-permissions>
Full replacement does not take effect
Due to lazy compilation, some compilation targets or relying on direct replacement files will not be copied during compilation. They need to be manually cleared before compilation
source build/envsetup.sh
lunch apollo_p2-userdebug
make installclean -j32
./build.sh