【RK3399 android10 nanopc 自定义第三方apk安装,权限弹窗解决】
feat-add-preinstall_del-app.patch
将预装apk的目录变更从device/rockchip/rk3399/preinstall_del 变成 device/rockchip/rk3399/nanopc-t4/preinstall_del
From 1acc0e4f3cbe59ac206a6ac3030ce82c5e1ced39 Mon Sep 17 00:00:00 2001
From: liangji <liangji@keenon.com>
Date: Tue, 14 Feb 2023 09:42:24 +0800
Subject: [PATCH] feat: add preinstall_del app
Signed-off-by: liangji <liangji@keenon.com>
---
device/rockchip/common/device.mk | 16 ++++++++--------
device/rockchip/rk3399/nanopc-t4/.gitignore | 5 +++++
device/rockchip/rk3399/preinstall_del/Android.mk | 2 --
device/rockchip/rk3399/preinstall_del/README.txt | 1 -
device/rockchip/rk3399/preinstall_del/preinstall.mk | 0
5 files changed, 13 insertions(+), 11 deletions(-)
create mode 100644 device/rockchip/rk3399/nanopc-t4/.gitignore
delete mode 100644 device/rockchip/rk3399/preinstall_del/Android.mk
delete mode 100644 device/rockchip/rk3399/preinstall_del/README.txt
delete mode 100644 device/rockchip/rk3399/preinstall_del/preinstall.mk
diff --git a/device/rockchip/common/device.mk b/device/rockchip/common/device.mk
index 47fe75c..c258fe5 100644
--- a/device/rockchip/common/device.mk
+++ b/device/rockchip/common/device.mk
@@ -19,17 +19,17 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
endif
# Prebuild apps
-#ifneq ($(strip $(TARGET_PRODUCT)), )
+ifneq ($(strip $(TARGET_PRODUCT)), )
# TARGET_DEVICE_DIR=$(shell test -d device && find device -maxdepth 4 -path '*/$(TARGET_PRODUCT)/BoardConfig.mk')
# TARGET_DEVICE_DIR := $(patsubst %/,%,$(dir $(TARGET_DEVICE_DIR)))
# $(info device-rockchip-common TARGET_DEVICE_DIR: $(TARGET_DEVICE_DIR))
-# $(shell python $(LOCAL_PATH)/auto_generator.py $(TARGET_DEVICE_DIR) preinstall bundled_persist-app)
-# $(shell python $(LOCAL_PATH)/auto_generator.py $(TARGET_DEVICE_DIR) preinstall_del bundled_uninstall_back-app)
-# $(shell python $(LOCAL_PATH)/auto_generator.py $(TARGET_DEVICE_DIR) preinstall_del_forever bundled_uninstall_gone-app)
-# -include $(TARGET_DEVICE_DIR)/preinstall/preinstall.mk
-# -include $(TARGET_DEVICE_DIR)/preinstall_del/preinstall.mk
-# -include $(TARGET_DEVICE_DIR)/preinstall_del_forever/preinstall.mk
-#endif
+ $(shell python $(LOCAL_PATH)/auto_generator.py $(TARGET_DEVICE_DIR) preinstall bundled_persist-app)
+ $(shell python $(LOCAL_PATH)/auto_generator.py $(TARGET_DEVICE_DIR) preinstall_del bundled_uninstall_back-app)
+ $(shell python $(LOCAL_PATH)/auto_generator.py $(TARGET_DEVICE_DIR) preinstall_del_forever bundled_uninstall_gone-app)
+ -include $(TARGET_DEVICE_DIR)/preinstall/preinstall.mk
+ -include $(TARGET_DEVICE_DIR)/preinstall_del/preinstall.mk
+ -include $(TARGET_DEVICE_DIR)/preinstall_del_forever/preinstall.mk
+endif
# Inherit product config
ifeq ($(strip $(TARGET_BOARD_PLATFORM_PRODUCT)), atv)
diff --git a/device/rockchip/rk3399/nanopc-t4/.gitignore b/device/rockchip/rk3399/nanopc-t4/.gitignore
new file mode 100644
index 0000000..0a99b0d
--- /dev/null
+++ b/device/rockchip/rk3399/nanopc-t4/.gitignore
@@ -0,0 +1,5 @@
+preinstall_del
+!preinstall_del/Android.mk
+!preinstall_del/preinstall.mk
+!preinstall_del/README.txt
+
diff --git a/device/rockchip/rk3399/preinstall_del/Android.mk b/device/rockchip/rk3399/preinstall_del/Android.mk
deleted file mode 100644
index 8338432..0000000
--- a/device/rockchip/rk3399/preinstall_del/Android.mk
+++ /dev/null
@@ -1,2 +0,0 @@
-include $(call all-subdir-makefiles)
-
diff --git a/device/rockchip/rk3399/preinstall_del/README.txt b/device/rockchip/rk3399/preinstall_del/README.txt
deleted file mode 100644
index 3817064..0000000
--- a/device/rockchip/rk3399/preinstall_del/README.txt
+++ /dev/null
@@ -1 +0,0 @@
-预置可卸载apk (恢复出厂设置可恢复) 将apk文件放置该目录即可 apk最好不带中文
diff --git a/device/rockchip/rk3399/preinstall_del/preinstall.mk b/device/rockchip/rk3399/preinstall_del/preinstall.mk
deleted file mode 100644
index e69de29..0000000
--
2.7.4
以上目录变更完了之后
可卸载的apk,直接将apk放置在preinstall_del 目录下,然后修改preinstall.mk,加入你的apk就行了
feat-add-Krlog.apk-into-package-apps.patch
把Krlog作为预装不可卸载的app
From 6fdacd46d8be59c5b00d04ad385722818fdaad1f Mon Sep 17 00:00:00 2001
From: liangji <liangji@keenon.com>
Date: Tue, 14 Feb 2023 09:43:59 +0800
Subject: [PATCH] feat: add Krlog.apk into package/apps
Signed-off-by: liangji <liangji@keenon.com>
---
device/rockchip/rk3399/rk3399.mk | 1 +
packages/apps/Krlog/Android.mk | 17 +++++++++++++++++
packages/apps/Krlog/Krlog.apk | Bin 0 -> 2210065 bytes
3 files changed, 18 insertions(+)
create mode 100644 packages/apps/Krlog/Android.mk
create mode 100644 packages/apps/Krlog/Krlog.apk
diff --git a/device/rockchip/rk3399/rk3399.mk b/device/rockchip/rk3399/rk3399.mk
index 62139d3..fe1fbf6 100644
--- a/device/rockchip/rk3399/rk3399.mk
+++ b/device/rockchip/rk3399/rk3399.mk
@@ -38,4 +38,5 @@ PRODUCT_PROPERTY_OVERRIDES += \
ro.product.ota.host = www.rockchip.com:2300 \
ro.sf.lcd_density=280
+PRODUCT_PACKAGES += Krlog
#PRODUCT_HAVE_OPTEE := true
diff --git a/packages/apps/Krlog/Android.mk b/packages/apps/Krlog/Android.mk
new file mode 100644
index 0000000..4625041
--- /dev/null
+++ b/packages/apps/Krlog/Android.mk
@@ -0,0 +1,17 @@
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := Krlog
+LOCAL_MODULE_TAGS := optional
+LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
+LOCAL_MODULE_CLASS := APPS
+LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
+LOCAL_CERTIFICATE := PRESIGNED
+
+
+# priv-app
+LOCAL_PRIVILEGED_MODULE := true
+
+include $(BUILD_PREBUILT)
+
diff --git a/packages/apps/Krlog/Krlog.apk b/packages/apps/Krlog/Krlog.apk
4.18号补充,发现将Krlog设置为内置apk的bug,还需要修改build目录下将包名加入,否则不会编译
From 9c67bedde03b619bddee9ccd7a62aed9abbf44da Mon Sep 17 00:00:00 2001
From: liangji <liangji@keenon.com>
Date: Tue, 18 Apr 2023 15:40:57 +0800
Subject: [PATCH] fix: add Krlog(cant be del) add package
Signed-off-by: liangji <liangji@keenon.com>
---
build/make/target/product/handheld_product.mk | 1 +
1 file changed, 1 insertion(+)
diff --git a/build/make/target/product/handheld_product.mk b/build/make/target/product/handheld_product.mk
index ee7916c..ea14370 100644
--- a/build/make/target/product/handheld_product.mk
+++ b/build/make/target/product/handheld_product.mk
@@ -33,6 +33,7 @@ PRODUCT_PACKAGES += \
StorageManager \
SystemUI \
WallpaperCropper \
+ Krlog \
frameworks-base-overlays
PRODUCT_PACKAGES_DEBUG += \
--
2.7.4
feat-give-app-sepolicy-and-GRANT_INSTALL.patch
给app权限,安装
From 41d32312cee031faed4e957fc943f08b1b298eee Mon Sep 17 00:00:00 2001
From: liangji <liangji@keenon.com>
Date: Tue, 14 Feb 2023 11:01:46 +0800
Subject: [PATCH 02/12] feat: give app sepolicy and GRANT_INSTALL
Signed-off-by: liangji <liangji@keenon.com>
---
device/rockchip/common/sepolicy/vendor/file_contexts | 1 +
.../com/android/server/pm/permission/PermissionManagerService.java | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/device/rockchip/common/sepolicy/vendor/file_contexts b/device/rockchip/common/sepolicy/vendor/file_contexts
index 763cddb..890ee87 100644
--- a/device/rockchip/common/sepolicy/vendor/file_contexts
+++ b/device/rockchip/common/sepolicy/vendor/file_contexts
@@ -201,6 +201,7 @@
#rockchip audiosetting
/odm/media(/.*)? u:object_r:oemfs:s0
+/(odm|vendor/odm)/bundled_(.*)(/.*)? u:object_r:vendor_app_file:s0
#flash_img
/system/bin/flash_img.sh u:object_r:install_recovery_exec:s0
diff --git a/frameworks/base/services/core/java/com/android/server/pm/permission/PermissionManagerService.java b/frameworks/base/services/core/java/com/android/server/pm/permission/PermissionManagerService.java
index b844362..b374850 100644
--- a/frameworks/base/services/core/java/com/android/server/pm/permission/PermissionManagerService.java
+++ b/frameworks/base/services/core/java/com/android/server/pm/permission/PermissionManagerService.java
@@ -1042,6 +1042,10 @@ public class PermissionManagerService {
+ pkg.packageName);
}
+ //keenon liangji add
+ grant = GRANT_INSTALL;
+ //keenon liangji end
+
if (grant != GRANT_DENIED) {
if (!ps.isSystem() && ps.areInstallPermissionsFixed() && !bp.isRuntime()) {
// If this is an existing, non-system package, then
--
2.7.4
feat-disabled-app-pop-up-windows-for-old-version.patch
关闭app弹窗(因为app版本不够新)
From 97e8c41eb8f766a34517223c1901129ac03d1a01 Mon Sep 17 00:00:00 2001
From: liangji <liangji@keenon.com>
Date: Tue, 14 Feb 2023 11:22:51 +0800
Subject: [PATCH 03/12] feat: disabled app pop up windows for old version
Signed-off-by: liangji <liangji@keenon.com>
---
.../base/services/core/java/com/android/server/wm/AppWarnings.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/frameworks/base/services/core/java/com/android/server/wm/AppWarnings.java b/frameworks/base/services/core/java/com/android/server/wm/AppWarnings.java
index 6c3fbc1..d7c4ed9 100644
--- a/frameworks/base/services/core/java/com/android/server/wm/AppWarnings.java
+++ b/frameworks/base/services/core/java/com/android/server/wm/AppWarnings.java
@@ -166,7 +166,8 @@ class AppWarnings {
public void onStartActivity(ActivityRecord r) {
showUnsupportedCompileSdkDialogIfNeeded(r);
showUnsupportedDisplaySizeDialogIfNeeded(r);
- showDeprecatedTargetDialogIfNeeded(r);
+ //showDeprecatedTargetDialogIfNeeded(r);
+ //keenon liangji disabled pop up windows for old apps
}
/**
--
2.7.4