精华 | |
金钱 | BA |
威望 | 点 |
贡献值 | 点 |
爱心 | 点 |
经验 | 点 |
注册时间 | 2009-2-21 |
最后登录 | 1970-1-1 |
在线时间 | 小时 |
| |
| |
| |
|
立即注册,加入爱黑武论坛的大家庭!爱黑武,爱上搞机生活!
您需要 登录 才可以下载或查看,没有账号?注册
x
- #!/bin/sh
- # Copyright (c) 2009 , http://bbs.ihei5.com Inc
- # 程序介绍:
- #
- # 作者 时间机型 文件类型
- # ------------------------------------------------------
- # 鱼儿,Louis Luo 2009年4月12日 V8 512M程序管理器
- [ "$LX_ENV" != "true" ] && . /ezxlocal/LinXtend/etc/initenv
- $LL_BIN/ambak.sh
- dir=`busybox dirname "$0"`
- NAME=`grep -n "Name = " /ezxlocal/download/appwrite/am/InstalledDB /mmc/mmca1/.system/java/CardRegistry | sed s/"Name = "// | sed s/\\ /_/g| sed 's/[:]/\\ /g'`
- Name=`echo "$NAME" | awk '{print $NF}'`
- showRadio "程序列表" "请选择你要操作的程序:" $Name
- idx=$?
- [ $idx = 0 ] && exit
- export name=`echo "$Name" | sed -n $idx\\p`
- cd "$dir"
- showProgress "" "搜索注册表" "正在搜索:$name的注册信息"
- name_line=`echo "$NAME" | sed -n $idx\\p | awk '{printf $2}'`
- name_dir=`echo "$NAME" | sed -n $idx\\p | awk '{printf $1}'`
- let "start_line = $name_line - 20"
- let "end_line = $name_line + 10"
- [ $start_line -lt 1 ] &&start_line=1
- name_group=`sed -n "$start_line,$end_line"p "$name_dir"`
- AppID=`echo "$name_group" | sed'/AppID =/d' | egrep -n "\\[[0-9,a-f]{,8}-[0-9,a-f]{,4}-[0-9,a-f]{,4}-[0-9,a-f]{,4}-[0-9,a-f]{,12}\\]" | sed 's/:/\\ /g'`
- appid_start_line=`echo "$AppID" | sed -n 1p | awk '{printf $1}'`
- appid_end_line=`echo "$AppID" | sed -n 2p | awk '{printf $1}'`
- let "name_start_line = $start_line + $appid_start_line -1"
- let "name_end_line = $start_line + $appid_end_line -1"
- [ -z "$appid_end_line" ] && export name_end_line=$end_line
- appid=`echo "$AppID" | sed -n 1p | awk '{printf $NF}'`
- registry=`sed -n "$name_start_line,$name_end_line"p "$name_dir"`
- bigicon=`echo "$registry" | sed -n '/BigIcon =/p' | sed 's/BigIcon = //g'`
- directory=`echo "$registry" | sed -n '/Directory =/p' | sed 's/Directory = //g'`
- appid=`echo $appid | sed 's/[[]//g' | sed 's/[]]//g'`
- echo "$directory" | grep QTDownLoad && d=1
- change_name()
- {
- name_a=`showTextEntry 0 "提示" "\\`echo -e "程序原名为:$name\\n请输入新的名字:"\\`"`
- [ $? != 1 ] && exit
- if [ "$name_a" = "" ] ; then
- showMsg "提示" "输入的名字为空,不能修改:$name" 2
- else
- setconfig "$name_dir" "Name" "$name_a" "$appid"
- showNotify "" "$name成功修改为:$name_a" 0 3
- kill `pidof am`
- fi
- exit 0
- }
- change_icon()
- {
- showMsg "提示" "$name的图标是:`basename "$bigicon"`,请选择png格式的图标!" 0
- [ $? != 1 ] && exit
- bigicon_b=`showFilePicker`
- if [ "$bigicon_b" = "" ] ; then
- showMsg "警告" "你没有选择任何图标文件,不能修改:$name的图标" 2
- exit 0
- fi
- png=`basename "$bigicon_b" | sed 's/[.]/\\ /g' | awk '{printf $NF}'`
- if [ "$png" != "png" ] ; then
- showMsg "警告" "请选择png格式的图标! " 2
- exit 0
- fi
- cp -f "$bigicon_b" $bigicon
- showNotify "" "$name图标修改成功" 0 3
- kill `pidof am`
- exit 0
- }
- cd /ezxlocal/download/
- if [ ! -d $directory ] ; then
- showMsg "警告" "$name程序的文件夹:`basename $directory`已经不存在,是否清除$name的注册信息?" 1
- [ $? != 1 ] && exit
- sed -i "$name_start_line,$name_end_line"d "$name_dir"
- sed -i "s/$appid//g" /ezxlocal/download/appwrite/am/UserMenuTree
- showNotify "" "成功清除$name注册残留信息" 0 3
- kill `pidof am`
- exit 0
- fi
- cd "$directory"
- EXEC=`echo "$registry" | sed -n '/Exec =/p' | sed s/"Exec ="//g`
- if [ ! -e $EXEC ] ; then
- showMsg "警告" "$name程序的主程序:$EXEC已经不存在,是否清除$name在注册信息" 1
- [ $? != 1 ] && exit
- sed -i "$name_start_line,$name_end_line"d "$name_dir"
- sed -i "s/$appid//g" /ezxlocal/download/appwrite/am/UserMenuTree
- showNotify "" "成功清除$name注册残留信息" 0 3
- exit
- fi
- if [ "$d" = 1 ] ; then
- showRadio "mpkg程序" "对 $name 执行操作:" "修改名字" "修改图标" "卸载:$name"
- case $? in
- 0)
- exit 0
- ;;
- 1)
- change_name
- ;;
- 2)
- change_icon
- ;;
- 3)
- showMsg "确定卸载" "`echo -e "是否卸载:$name?\\n卸载路径:$directory"`" 1
- [ $? != 1 ] && exit
- [ "$directory" = '/' ] && exit
- cd /mmc/mmca1
- rm -r $directory
- sed -i "$name_start_line,$name_end_line"d "$name_dir"
- sed -i "s/$appid//g" /ezxlocal/download/appwrite/am/UserMenuTree
- kill `pidof am`
- showNotify "" "$name卸载成功" 0 3
- exit 0
- ;;
- esac
- fi
- if echo "$directory" | grep MIDlet ; then
- DIRECTORY=`echo "$directory" | sed s/[/]/\\ /g | awk '{print $NF}' | sed s/MIDlet//g`
- EXEC=`echo "$registry" | sed -n '/Exec =/p' | sed s/"Exec = java.sh"/java.sh/g | sed s/"Exec = "/Exec/g`
- IMEI=`busybox dirname /mmc/mmca1/.system/java_*/DownloadApps | sed s/[/]mmc[/]mmca1[/].system[/]java_//`
- echo "$EXEC" | grep Exec &&java_ID="授权:$name"
- echo "$EXEC" | grep java.sh && java_ID="降权:$name"
- if echo "$name_dir" | grep InstalledDB ; then
- PATHJAVA=/ezxlocal/download/mystuff/.system/java/DownloadApps/MIDlet$DIRECTORY
- else
- PATHJAVA=/mmc/mmca1/.system/java_$IMEI/DownloadApps/MIDlet$DIRECTORY
- fi
- showRadio "Java程序" "对 $name 执行操作:" "修改名字" "修改图标" "$java_ID"
- case $? in
- 0)
- exit 0
- ;;
- 1)
- change_name
- ;;
- 2)
- change_icon
- ;;
- 3)
- if echo "$EXEC" | grep Exec ; then
- showMsg "提高权限" "是否提高:$name的权限?" 1
- [ $? != 1 ] && exit 0
- setconfig "$name_dir" "Attribute" "1" "$appid"
- setconfig "$name_dir" "BigIcon" "$PATHJAVA/Files/java_usr.png" "$appid"
- setconfig "$name_dir" "Icon" "" "$appid"
- setconfig "$name_dir" "Exec" "java.sh" "$appid"
- JAD=`basename $PATHJAVA/Files/*.jar | sed s/.jar//`.jad
- if [ -e $PATHJAVA/Files/MIDlet-1.png ] ; then
- cp -f $PATHJAVA/Files/MIDlet-1.png $PATHJAVA/Files/java_usr.png
- else
- cp -f $PATHJAVA/Files/suiteicon.png $PATHJAVA/Files/java_usr.png
- fi
- JAVA_PT=/ezxlocal/download/mystuff/.system/LouisLaw/usr/java
- JAVANAME=`basename $PATHJAVA/Files/*.jar | sed s/.jar//`
- cp -f $JAVA_PT/java.sh $PATHJAVA/
- cp -f $JAVA_PT/java.rh $PATHJAVA/Files/$JAVANAME.rh
- cp -f $JAVA_PT/java.ss $PATHJAVA/Files/$JAVANAME.ss
- cp -f $JAVA_PT/java.ii $PATHJAVA/Files/$JAVANAME.ii
- kill `pidof am`
- showNotify "" "授权成功" 0 3
- exit 0
- elif echo "$EXEC" | grep java.sh ; then
- showMsg "降低权限" "是否降低:$name的权限?" 1
- [ $? = 0 ] && exit 0
- rm -f $PATHJAVA/java.sh
- rm -f $PATHJAVA/Files/java_usr.png
- setconfig "$name_dir" "Attribute" "5" "$appid"
- setconfig "$name_dir" "BigIcon" "Files/MIDlet-1.png" "$appid"
- setconfig "$name_dir" "Icon" "Files/MIDlet-1.png" "$appid"
- setconfig "$name_dir" "Exec" "" "$appid"
- kill `pidof am`
- showNotify "" "降权成功" 0 3
- exit 0
- fi
- ;;
- esac
- fi
- showMsg "温馨提示" "注册表未知错误!
- 注册表第$name_line行
- 注册位置:$name_dir
- 是否用vTextView打开注册表?" 1
- [ $? != 1 ] && exit
- export LD_PRELOAD=/ezxlocal/LinXtend/usr/lib/libezxapp.so
- /ezxlocal/download/mystuff/.system/LouisLaw/usr/zLauncher2.0/zTextViewer/vTextViewer $name_dir
- exit 0
复制代码 |
|