• [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
  • 相关阅读:
    多测师讲解python _函数的传递_高级讲师肖sir
    多测师讲解pthon _函数__return_高级讲师肖sir
    多测师讲解python _函数中参数__高级讲师肖sir
    前端 HTML body标签相关内容 常用标签 图片标签 <img/>
    mysql 操作sql语句 操作数据库
    python web框架 MVC MTV
    linux dmesg 查看系统故障信息
    linux uniq 命令
    linux md5sum命令
    Python 字典 items() 方法
  • 原文地址:https://www.cnblogs.com/scue/p/2916455.html
Copyright © 2020-2023  润新知