zoukankan      html  css  js  c++  java
  • [Android] Android4.0第一次进入系统后自动配置;

    #!/system/bin/sh
    # Version: 0.3
    # Author:linkscue
    # E-mail:linkscue@gmail.com
    # Funtion: init the first boot
    # Filename: /system/etc/init.d/99firstboot
    if [[ -e /data/system/first_boot ]]; then
        echo "this is not first boot."
        exit 1
    fi
    
    mount -o remount,rw /dev/block/mmcblk0p17 /system
    #1. VIM(init)
    if [[ -f /data/local/bin/vim ]];then
        if [[ ! -e /system/xbin/vim ]];then
           ln -s /data/local/bin/vim /system/xbin/vim
        else
        echo "/system/xbin/vim is existed!"
        fi
    else
        echo "can't find vim-android"
    fi
    echo ">> vim is ok!"
    #2. BTEP(bash)
    dir_data=/data/data/com.magicandroidapps.bettertermpro/downloader
    dir_syst=/system/etc/enhance/BTEP_DL
    if [[ -d $dir_syst ]];then
        if [[ ! -d $dir_data ]];then
        mkdir -p $dir_data
        cp -av $dir_syst/* $dir_data/ #注:博客园的注释有问题..
        chmod 777 $dir_data
        else
        echo "[$dir_data] is existed!"
        fi
    else
        echo "[$dir_syst] is not exist!"
    fi
    echo ">> BTEP is ok!"
    #3. Apex(75% transparent background)
    Apex_pre=/data/data/com.anddoes.launcher/shared_prefs/com.anddoes.launcher_preferences.xml
    detect=`grep drawer_background_alpha /data/data/com.anddoes.launcher/shared_prefs/com.anddoes.launcher_preferences.xml`
    while [[ ! -e $Apex_pre ]]; do
        sleep 1;
    done
    if [[ -z $detect ]]; then 
        sed -i '5 i\<int name="drawer_background_alpha" value="60" />' $Apex_pre
        killall com.anddoes.launcher
        am start -a android.intent.action.MAIN -c android.intent.category.LAUNCHE -n com.anddoes.launcher/com.anddoes.launcher.Launcher
    fi
    echo ">> Apex is ok!"
    #4. Root Explorer
    RE_Pre=/data/data/com.speedsoftware.rootexplorer/shared_prefs/com.speedsoftware.rootexplorer_preferences.xml
    detect0=`grep folders_first /data/data/com.speedsoftware.rootexplorer/shared_prefs/com.speedsoftware.rootexplorer_preferences.xml`
    detect1=`grep home /data/data/com.speedsoftware.rootexplorer/shared_prefs/com.speedsoftware.rootexplorer_preferences.xml`
    while [[ ! -e $RE_Pre ]]; do
        sleep 1;
    done
    if [[ -z $detect0 ]]; then
        sed -i '3 i\<boolean name="folders_first" value="true" />' $RE_Pre
        sed -i '4 i\<string name="home">/sdcard</string>' $RE_Pre
        killall com.speedsoftware.rootexplorer
        am start -a android.intent.action.MAIN -c android.intent.category.LAUNCHE -n com.speedsoftware.rootexplorer/com.speedsoftware.rootexplorer.RootExplorer
    fi
    echo ">> Root Explorer is ok!"
    
    echo "first_boot_OK!" > /data/system/first_booted
    mount -o remount,ro /dev/block/mmcblk0p17 /system
    ------------
    微博:http://weibo.com/scue
    Github:http://github.com/scue
  • 相关阅读:
    Luogu P1462 通往奥格瑞玛的道路
    数据结构学习笔记——图的应用(最短路径和关键路径)
    数据结构学习笔记——特殊矩阵的压缩存储
    数据结构学习笔记——线性表
    图像分类综述—A survey on Semi-, Self- and Unsupervsed Techniques in Image Classification Similarities, Differences & Combinations
    目标检测综述
    操作系统学习
    Git官网下载太慢解决方法
    阿里云2020上云采购季,你最pick哪个产品组合?
    任务不再等待!玩转DataWorks资源组
  • 原文地址:https://www.cnblogs.com/scue/p/2916455.html
Copyright © 2011-2022 走看看