Built-in third-party app cases in the update upgrade package

Source: Internet
Author: User
Tags shebang

Built-in third-party app cases in the update upgrade package

      • Built-in third-party app cases in the update upgrade package
      • Introduced
      • Summary content
        • 1 Problem phenomena
        • 2 Cause Analysis
        • 3 Solutions
          • Androidmk
          • Preinstallsh
        • 4 attention to detail in follow-up work
      • Extended Reading

1. Introduction

Amlogic MX8726 5iHome Project, customer requests for pre-fabricated third-party apps in firmware
Please list development projects, project simple backgrounds, use of platforms, summary of content to be summarized

2. Summarize content 2.1 Problem phenomena:

Customers to provide third-party app directly using USB flash drive PM Install youku_cibn.apk, app uptime
The app is placed in the patch Preinstall/app directory and compiled system/app/youku_cibn.apk
Youku_cibn Flash Back

2.2 Cause Analysis:

Logcat-v Time View Print

load mono from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/system/app/5iHomeBadminton.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]]: findLibrary returned null

Missing library file, but PM INSATLL installation can run normally, consult colleague system/app/directory apk installation mode is not the PM install method, its specific mode of use .... Next time Pits

2.3 Solution:

Since youku_cibn.apk uses PM install mode to run normally, you can try to run the service installation once in the background after the first boot of the system after the brush youku.apk

youku.apk Place to directory Vendor\amlogic\prebuilt\preinstallation and modify android.mk and preinstall.sh

Android.mk
Local_path:=$(Call My-dir)include $(Clear_vars)Local_module := preinstall.shLocal_src_files := preinstall.shLocal_module_tags := OptionalLocal_module_class :=ETCLocal_module_path :=$(Target_out)/bininclude $(build_prebuilt)#manager_apk: = $ (Patsubst $ (Local_path)/%,%,$ (wildcard $ (local_path)/*.apk))manager_apk:= youku_cibn.apk$(foreach T,$(MANAGER_APK),$(Evalinclude $(Clear_vars))$(EvalLocal_module     :=$(Notdir$(T)))$(EvalLocal_module_tags := optional)$(EvalLocal_module_class :=ETC)$(EvalLocal_module_path :=$(Target_out)/preinstall)$(EvalLocal_src_files   :=$(T))$(Evallocal_certificate := shared)$(Evalinclude $(build_prebuilt)) )$(Local_installed_module): $(Notdir$(MANAGER_APK))
preinstall.sh
#!/system/bin/shTag file Symbol_preinstall_apks_installedmark=/data/local/symbol_preinstall_apks_installedpkgs=/system/preinstall Determine if the tag file symbol_preinstall_apks_installed existsif[ !- e $MARK]; ThenEcho "Booting the first time, so pre-install some APKs."apk_list=$ (BusyBox find$PKGS-name"*\.apk")Echo $apk _list     forapkinch $apk _list     Do         Echo "Install:" $apkMKDIR-P/data/app CP- F $apk/data/app/app_to_install.apk chmod644/DATA/APP/APP_TO_INSTALL.APK/SYSTEM/BIN/PM Install-r/data/app/app_to_install.apk Rm/data/app/app_to_inst all.apk Done# NO need to delete these APKs since we keep a mark under data partition.# and the mark would be wiped out after doing factory reset, so can install# These APKs again if files are still there.# busybox RM-RF $PKGSTouch$MARKEcho "OK, installation complete."fi
2.4 Follow-up work should pay attention to the details:
  • ANDROID.MK and PREINSTALL.SH encoding formats must use UNIX
  • Update.zip upgrade must be factory reset, reason, boot execution preinstal.sh will first determine whether the mark=/data/local/symbol_preinstall_apks_installed flag file exists, If the presence will exit execution, but the customer proposed Update.zip upgrade restore factory settings to users inconvenience, just modify mark=/data/local/(*)
3. Extended Reading

Boot execution preinstall.sh, need to be registered with start init.amlogic.board.rc

start preinstallservice preinstall /system/bin/preinstall.sh    user root       //改变用户归属    group root      //改变用户归属    disabled        //服务必须显式启动    oneshot         //指明不能重启服务

Compile the app in different directory differences

    • System/app built-in app placement directory
    • System/priv-app system core app placement directory with maximum permissions (Android 4.4 only)
    • System/preinstall Pre-install third-party apps

System/preinstall directory in the app, the default brush after the first boot installation, and USB drive directly installed the same effect, installed after the app location in Data/app

Built-in third-party app cases in the update upgrade package

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.