Search the Community
Showing results for tags 'rk3568'.
-
Application porting on Android devices is an important part of system development. Especially on embedded platforms like RK3568, pre-installing APK, system compilation, and permission management all require specific configurations and optimizations. This guide will provide a detailed introduction on how to complete Android application porting on the RK3568 platform, including key steps such as pre-installing and uninstalling APK and obtaining Root privileges, to help developers quickly adapt and customize the Android system. Pre-installing Apps on the Android System 1. Adding an APK file: Take dogdog.apk as an example: Add an Android.mk file under the "dogdog" folder and write the relevant content for the dogdog.apk file. Add the Android. mk under the dogdog folder and write the dogdog. apk films. Android.mk writing method: LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := dogdog LOCAL_SRC_FILES := dogdog.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 := ture include $(BUILD_PREBUILT) 2. Adding an installation configuration Modify/OK3568-android11-source/device/rockchip/rk356x/ok3568_r/ok3568_r.mk Add dogdog \ Compile again to generate update. img files, which can be flahsed and pre-installed apk normally. Pre-installing Apps on the Android System 1. Delete the apk file Delete the doggo file under/OK3568-android11-source/packages/apps/ 2.Delete installation configuration Mod/OK3568-android11-source/device/rockchip/rk356x/ok3568_r/ok3568_r.mk file Delete dogdog \ 3.Delete the intermediate files generated by compilation Delete /Ok3568-android11-source/out/target/product/ok3568_r/system/priv-app/ corresponding files Compile again to generate the update. img file. Android Getting Root Privileges Location of references and test procedures: 1.The user debug version needs to be compiled. 2.Close selinux Modify the configuration according to the red prompt: Source code/device/rockchip/common/BoardConfig.mk BOARD_MKBOOTIMG_ARGS := BOARD_PREBUILT_DTBOIMAGE ?= $(TARGET_DEVICE_DIR)/dtbo.img BOARD_ROCKCHIP_VIRTUAL_AB_ENABLE ?= false BOARD_SELINUX_ENFORCING ?= false false is Close, true is Open. 3. Annotation User Group Permission Detection Comment the following two lines. Source code/system/extras/su/su.cpp int main(int argc, char** argv) { //uid_t current_uid = getuid(); //if (current_uid != AID_ROOT && current_uid != AID_SHELL) error(1, 0, "not allowed"); // Handle -h and --help. ++argv; 4. Grant root privileges to su files by default (1)Source code/system/core/libcutils/fs_config.cpp static const struct fs_path_config android_files[] = { …… // the following two files are INTENTIONALLY set-uid, but they // are NOT included on user builds. { 06755, AID_ROOT, AID_ROOT, 0, "system/xbin/procmem" }, { 06755, AID_ROOT, AID_ROOT, 0, "system/xbin/procmem" }, // the following files have enhanced capabilities and ARE included // in user builds. (2)Source code/frameworks/base/core/jni/com_android_internal_os_Zygote.cpp static void DropCapabilitiesBoundingSet(fail_fn_t fail_fn) { /* for (int i = 0; prctl(PR_CAPBSET_READ, i, 0, 0, 0) >= 0; i++) {; if (prctl(PR_CAPBSET_DROP, i, 0, 0, 0) == -1) { if (errno == EINVAL) { ALOGE("prctl(PR_CAPBSET_DROP) failed with EINVAL. Please verify " ''your kernel is compiled with file capabilities support"); } else { fail_fn(CREATE_ERROR("prctl(PR_CAPBSET_DROP, %d) failed: %s", i, strerror(errno))); } } } */ } (3)Source code/kernel/security/commoncap.c static int cap_prctl_drop(unsigned long cap) { struct cred *new; /* if (!ns_capable(current_user_ns(), CAP_SETPCAP)) return -EPERM; if (!cap_valid(cap)) return -EINVAL; */ new = prepare_creds(); if (!new) return -ENOMEM; cap_lower(new->cap_bset, cap); return commit_creds(new); } 5.Complete compilation and flashing. After compiling and flashing, you can install the RootChecker. apk to detect whether android has obtained root permission. If the prompt is "Root check pass", it indicates that root privileges have been obtained.
-
On November 7th, 2023, Forlinx Embedded launched the Debian 11 system for the first time on their development board, OK3568-C/OK3568J-C, which is based on the RK3568 chipset. Forlinx Embedded officially supports the Debian 11 system on the OK3568-C/OK3568J-C platform. In the field of embedded development, stability and richness are crucial factors. The RK3568, as Forlinx's flagship embedded product, has high performance, low power consumption, and rich interface functions, making it appreciated by industry users. Debian 11 is a stable, reliable, and open-source operating system, which provides a powerful foundation for the OK3568-C. Debian 11 has undergone rigorous testing and validation to ensure system stability, so there is no need to worry about unexpected crashes or data loss. Moreover, Debian 11 has a vast software library, which enables developers to easily install and update required software packages. By combining the advantages of the OK3568-C hardware with Debian 11, developers can fully leverage the diversity of the 3568 hardware interfaces while enjoying the stability and open-source nature of Debian 11. Indeed, this strong combination provides an ideal environment for various embedded projects. When it comes to stability, free and open source, versatility, and vast software libraries, no operating system can rival Debian. Debian is a truly free operating system, and its strength is not only reflected in technology, but also in its active community. Stable Value: Debian stands out for its world-renowned stability. Whether you are building critical business systems or looking for reliable daily desktops, Debian is always the best choice. Debian 11 has undergone rigorous testing and validation to ensure system stability, so there is no need to worry about unexpected crashes or data loss. Free and Open Source: Debian adheres to the concept of free and open source, allowing you to freely use, modify, and share it. This is a truly free operating system. Not only can Debian be obtained for free, but you can also freely view, edit, and distribute its source code. Huge Software Library: Debian has a vast and diverse software library that covers almost any application and tool you can imagine. From office software to entertainment applications, server services to programming tools, Debian has everything in its software library. Not only that, it also provides an easy-to-use package management system, allowing you to easily install and update software. Multi-architecture Support: Debian supports multiple hardware architectures, including x86, ARM, PowerPC, MIPS, etc., making it suitable for various devices and systems. Whether you use a desktop, laptop, server, or embedded device, Debian can provide the ideal solution. Active Community Support: The Debian community is a vibrant place where you can find help, advice, and resources. Both novice and experienced users can participate in the community and receive support. Originally published at www.forlinx.net.