目錄
1、編譯
2染苛、修改logo
3鹊漠、添加luancher,添加mei_vod
4茶行、修改heapsize
5躯概、去掉 無用系統(tǒng)APK
6、去掉屏保
7畔师、去掉我知道了
8娶靡、修改setting
9、支持雙HDMI顯示
1看锉、編譯:
解壓源碼:
1姿锭、合并源碼 cat OK3399-android7-source.7z.00* > OK3399-android7-
source.7z
2、解壓源碼 有7za x OK3399-android7-source.7z
docker鏡像已安裝編譯:
1伯铣、docker安裝(略)
2呻此、docker鏡像還原(略)
3、su到root權(quán)限
4腔寡、docker start ec7e510963fb f4c2180bbbe3 f4c2180bbbe3(docker容器)
雙屏版本 容器 ec7e510963fb
5焚鲜、docker exec -it ec7e510963fb bin/bash
編譯:
1、cd /root/meiktvandroid/OK3399-android 進(jìn)入對(duì)應(yīng)目錄
2放前、export USER=$(whoami)
3忿磅、source build/envsetup.sh
4、lunch rk3399_all-userdebug
5凭语、./build-rk3399-all.sh -u
安卓編譯--USER: unbound variable
由于docker沒有設(shè)置USER環(huán)境變量導(dǎo)致葱她,手動(dòng)添加后繼續(xù)編譯即可
手動(dòng)添加:export USER=$(whoami)
編譯時(shí)可能遇到j(luò)ack server未啟動(dòng) jack server 內(nèi)存不足的問題
2、更改開機(jī)logo和動(dòng)畫:
logo: kernel/logo_kernel.bmp
動(dòng)畫:device/rockchip/rk3399/rk3399_all/bootanimation.zip
3似扔、添加luancher
系統(tǒng)權(quán)限簽名:
Android 平臺(tái)中 SELinux 將 App 劃分為三種,包括沒有 platform 簽名和系統(tǒng)權(quán)限的 untrusted_app吨些,
擁有 platform 簽名沒有系統(tǒng)權(quán)限的 platform_app,和擁有 platform 簽名和系統(tǒng)權(quán)限的 system_app搓谆。本節(jié),
將介紹如何給 apk 簽名獲得 system 權(quán)限锤灿。
- 制作簽名文件
Android_7.1.2_UM
FET3399-C挽拔、OK3399-C
- 88 - www.fo+rlinx.com
將 Android 系統(tǒng)中 build/target/product/security/platform.x509.pem 以及
build/target/product/security/platform.pk8 拷貝到 windows 中。
打開命令行窗口執(zhí)行:
openssl pkcs8 -in platform.pk8 -inform DER -outform PEM -out shared.priv.pem -nocrypt
openssl pkcs12 -export -in platform.x509.pem -inkey shared.priv.pem -out shared.pk12 -name
androiddebugkey
輸入密碼:android
keytool -importkeystore -deststorepass android -destkeypass android -destkeystore
debug.keystore -srckeystore shared.pk12 -srcstoretype PKCS12 -srcstorepass android -alias
androiddebugkey
其中 key-alias 以及 password 您可以根據(jù)需求修改為其它內(nèi)容但校。將簽名文件 debug.keystore 文
件保存到您的常用目錄中螃诅。
注意:如果您的 windows 系統(tǒng)中沒有 openssl 命令,請(qǐng)前往 http://slproweb.com/products/Win32O
penSSL.html 下載安裝状囱,并設(shè)置環(huán)境變量术裸。
- 設(shè)置 andorid studio
打開任意 android studio 工程,在 AndroidManifest.xml 中添加共享 UID 例如:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.forlinx.serialporttest"
android:sharedUserId="android.uid.system" >
點(diǎn)擊“File”->“project structure”:
系統(tǒng)預(yù)裝 Apk 的方法
- 在 android 系統(tǒng)中新建目錄:
mkdir packages/apps/serialporttest
將需要預(yù)裝的 apk(無需簽名)拷貝到目錄中以 serialporttest.apk 為例:
cp serialporttest.apk packages/apps/serialporttest - 在 packages/apps/serialporttest 新建 Android.mk
Android_7.1.2_UM
FET3399-C亭枷、OK3399-C
- 91 - www.forlinx.com
LOCAL_PATH := (CLEAR_VARS)
LOCAL_MODULE := serialporttest
LOCAL_SRC_FILES := serialporttest.apk
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_SUFFIX := .apk
LOCAL_BUILT_MODULE_STEM := package.apk
LOCAL_CERTIFICATE := platform
LOCAL_DEX_PREOPT := false
LOCAL_PRIVILEGED_MODULE := true
include $(BUILD_PREBUILT)
- 同時(shí)修改 device/rockchip/rk3399/device.mk 添加
PRODUCT_PACKAGES += \
serialporttest - 重新編譯鏡像袭艺。
4、修改heapsize
frameworks/native/build/tablet-10in-xhdpi-2048-dalvik-heap.mk
查看heapsize
adb shell getprop dalvik.vm.heapsize
6叨粘、去屏保
ok3399:do not lock screen default
diff --git a/frameworks/base/packages/SettingsProvider/res/values/defaults.xml b/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
index f4cefc2..7734cfd 100644
--- a/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
+++ b/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
@@ -80,7 +80,7 @@
<string name="def_trusted_sound" translatable="false">/system/media/audio/ui/Trusted.ogg</string>
<string name="def_wireless_charging_started_sound" translatable="false">/system/media/audio/ui/WirelessChargingStarted.ogg</string>
- <bool name="def_lockscreen_disabled">false</bool>
-
<bool name="def_lockscreen_disabled">true</bool>
<bool name="def_device_provisioned">false</bool>
<integer name="def_dock_audio_media_enabled">1</integer>
7猾编、去掉我知道了:
源碼路徑:/frameworks/base/services/core/java/com/android/server/policy/ImmersiveModeConfirmation.java
修改代碼去掉handleShow即可:
@Override
public void handleMessage(Message msg) {
switch(msg.what) {
case SHOW:
- handleShow();
+ //handleShow();
break;
case HIDE:
handleHide();
break;
}
}
}
9、支持雙HDMI顯示:
kernel/arch/arm64/boot/dts/rockchip/ok3399.dts 文件第626行:
修改為:
forlinx_control {
status = "okay";
primary-display = "DSI0-lvds@l";
secondary-display = "HDMI@b";
};
10升敲、清理編譯
1答倡、在源碼目錄的根目錄下,make clean;
2驴党、進(jìn)到源碼的\linux\kernel\目錄下瘪撇,執(zhí)行make mrproper;
3港庄、再退回到根目錄倔既,執(zhí)行sourcebuild/envsetup.sh,lunch,make.
11、修改龍訊口分辨率為1920x1080 以及時(shí)鐘頻率鹏氧,30hz不黑屏
kernel/arch/arm64/boot/dts/rockchip/ok3399.dts 文件第749-757行:
clock-frequency = <83764800>;
hactive = <1280>;
vactive = <800>;
hback-porch = <200>;
hfront-porch = <72>;
vback-porch = <22>;
vfront-porch = <3>;
hsync-len = <128>;
vsync-len = <6>;
改成
clock-frequency = <74250000>;
hactive = <1920>;
vactive = <1080>;
hback-porch = <148>;
hfront-porch = <88>;
vback-porch = <36>;
vfront-porch = <4>;
hsync-len = <44>;
vsync-len = <5>;
11渤涌、修改北京雙音頻空板子 音頻取反(2023-2-23修改,不用取反把还,取反后音頻輸出只走HDMI)
kernel/arch/arm64/boot/dts/rockchip/ok3399.dts 文件第551行:
headset_gpio = <&gpio2 RK_PD3 GPIO_ACTIVE_HIGH>;
改成
headset_gpio = <&gpio2 RK_PD3 GPIO_ACTIVE_LOW>;
硬件上R200電阻短路
12歼捏、去除調(diào)節(jié)到最大音量有彈框問題
/frameworks/base/core/res/values/config.xml
<bool name="config_safe_media_volume_enabled">true</bool>
改成
<bool name="config_safe_media_volume_enabled">false</bool>
13、修改HDMI原生口超時(shí)時(shí)間
kernel/drivers/iommu/rockchip-iommu.c
read_wa:
rk_iommu_command(iommu, RK_MMU_CMD_ENABLE_STALL);
if (iommu->skip_read)
return 0;
/* modify by xingchun 1 modify 5 2022-9-30 */
ret = rk_wait_for(rk_iommu_is_stall_active(iommu), 1);
if (ret)
for (i = 0; i < iommu->num_mmu; i++)
dev_err(iommu->dev, "Enable stall request timed out, status: %#08x\n",
rk_iommu_read(iommu->bases[i], RK_MMU_STATUS));
return ret;
}
改成
read_wa:
rk_iommu_command(iommu, RK_MMU_CMD_ENABLE_STALL);
if (iommu->skip_read)
return 0;
/* modify by xingchun 1 modify 5 2022-9-30 */
ret = rk_wait_for(rk_iommu_is_stall_active(iommu), 5);
if (ret)
for (i = 0; i < iommu->num_mmu; i++)
dev_err(iommu->dev, "Enable stall request timed out, status: %#08x\n",
rk_iommu_read(iommu->bases[i], RK_MMU_STATUS));
return ret;
}
12笨篷、修改型號(hào)
/device/rockchip/rk3399/rk3399.mk
device/rockchip/rk3399/rk3399_all/buildspec.mk
修改gpu 版本號(hào)
device/rockchip/rk3399/rk3399_all.mk
修改
persist.sys.framebuffer.aux=5760x1080@60
改成
persist.sys.framebuffer.aux=5760x2160@60 \
PRODUCT_NAME := rk3399_all
PRODUCT_DEVICE := rk3399_all
PRODUCT_MODEL := rk3399-all
改成
PRODUCT_NAME := AM-001A
PRODUCT_DEVICE := AM-001A
PRODUCT_MODEL := AM-001A
device/rockchip/common/common.mk:PRODUCT_BRAND := AM010
device/rockchip/common/common.mk:PRODUCT_MANUFACTURER := AM010
device/rockchip/rk3399/BoardConfig.mk:PRODUCT_DEVICE := AM010
device/rockchip/rk3399/BoardConfig.mk:PRODUCT_NAME := AM010
device/rockchip/rk3399/BoardConfig.mk:PRODUCT_MODEL := AM010
device/rockchip/common/common.mk:PRODUCT_DEVICE := meisdk
device/rockchip/common/common.mk:PRODUCT_NAME := meisdk
device/rockchip/common/common.mk:PRODUCT_MODEL := meisdk
13、修改版本號(hào)
14瓣履、unbutu啟動(dòng)不了率翅,磁盤空間不夠 解決方案
參考:https://blog.csdn.net/xiaotaiyangzuishuai/article/details/118143508
15、修改uboot 修復(fù)龍訊口概率黑屏問題 uboot飛凌未開源 2023-2-23
賬號(hào) root 密碼ktvmei
16袖迎、
想要多個(gè)網(wǎng)卡同時(shí)使用冕臭,首先就要解決多網(wǎng)卡共存問題腺晾。Android系統(tǒng)默認(rèn)會(huì)將不需要的網(wǎng)絡(luò)給關(guān)閉的,以降低功耗辜贵。所以要解決以太網(wǎng)與Wi-Fi共存問題悯蝉,需要做如下改動(dòng):
--- a/frameworks/opt/net/ethernet/java/com/android/server/ethernet/EthernetNetworkFactory.java
+++ b/frameworks/opt/net/ethernet/java/com/android/server/ethernet/EthernetNetworkFactory.java
@@ -146,7 +146,8 @@ class EthernetNetworkFactory {
*/
private void updateInterfaceState(String iface, boolean up) {
if (!mIface.equals(iface)) {
- //return;
+ if(iface.equals("eth1")){ //增加一個(gè)判斷優(yōu)化影響wifi問題
+ mIface = iface; //更新mIface后面dhcp IP用
+ }else{
+ return;
+ }
}
Log.d(TAG, "updateInterface: " + iface + " link " + (up ? "up" : "down"));
17、修改聲卡驅(qū)動(dòng)
聲卡驅(qū)動(dòng)所在目錄:
/hardware/rockchip/audio/tinyalsa_hal/codec_config/wm8960_config_h
18.去掉USB彈框權(quán)限
https://blog.csdn.net/weixin_32658257/article/details/117348616