爱黑武论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 3034|回复: 17

V8 512M/2G 程序管理器 脚本源代码!那个要的朋友自己进来看吧!

[复制链接]
发表于 2010-4-20 19:57 | 显示全部楼层 |阅读模式

立即注册,加入爱黑武论坛的大家庭!爱黑武,爱上搞机生活!

您需要 登录 才可以下载或查看,没有账号?注册

x
  1. #!/bin/sh
  2. # Copyright (c) 2009 , http://bbs.ihei5.com Inc
  3. # 程序介绍:
  4. #
  5. # 作者 时间机型 文件类型
  6. # ------------------------------------------------------
  7. # 鱼儿,Louis Luo 2009年4月12日 V8 512M程序管理器
  8. [ "$LX_ENV" != "true" ] && . /ezxlocal/LinXtend/etc/initenv
  9. $LL_BIN/ambak.sh
  10. dir=`busybox dirname "$0"`
  11. NAME=`grep -n "Name = " /ezxlocal/download/appwrite/am/InstalledDB /mmc/mmca1/.system/java/CardRegistry | sed s/"Name = "// | sed s/\\ /_/g| sed 's/[:]/\\ /g'`
  12. Name=`echo "$NAME" | awk '{print $NF}'`
  13. showRadio "程序列表" "请选择你要操作的程序:" $Name
  14. idx=$?
  15. [ $idx = 0 ] && exit
  16. export name=`echo "$Name" | sed -n $idx\\p`
  17. cd "$dir"
  18. showProgress "" "搜索注册表" "正在搜索:$name的注册信息"
  19. name_line=`echo "$NAME" | sed -n $idx\\p | awk '{printf $2}'`
  20. name_dir=`echo "$NAME" | sed -n $idx\\p | awk '{printf $1}'`
  21. let "start_line = $name_line - 20"
  22. let "end_line = $name_line + 10"
  23. [ $start_line -lt 1 ] &&start_line=1
  24. name_group=`sed -n "$start_line,$end_line"p "$name_dir"`
  25. 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'`
  26. appid_start_line=`echo "$AppID" | sed -n 1p | awk '{printf $1}'`
  27. appid_end_line=`echo "$AppID" | sed -n 2p | awk '{printf $1}'`
  28. let "name_start_line = $start_line + $appid_start_line -1"
  29. let "name_end_line = $start_line + $appid_end_line -1"
  30. [ -z "$appid_end_line" ] && export name_end_line=$end_line
  31. appid=`echo "$AppID" | sed -n 1p | awk '{printf $NF}'`
  32. registry=`sed -n "$name_start_line,$name_end_line"p "$name_dir"`
  33. bigicon=`echo "$registry" | sed -n '/BigIcon =/p' | sed 's/BigIcon = //g'`
  34. directory=`echo "$registry" | sed -n '/Directory =/p' | sed 's/Directory = //g'`
  35. appid=`echo $appid | sed 's/[[]//g' | sed 's/[]]//g'`
  36. echo "$directory" | grep QTDownLoad && d=1
  37. change_name()
  38. {
  39. name_a=`showTextEntry 0 "提示" "\\`echo -e "程序原名为:$name\\n请输入新的名字:"\\`"`
  40. [ $? != 1 ] && exit
  41. if [ "$name_a" = "" ] ; then
  42. showMsg "提示" "输入的名字为空,不能修改:$name" 2
  43. else
  44. setconfig "$name_dir" "Name" "$name_a" "$appid"
  45. showNotify "" "$name成功修改为:$name_a" 0 3
  46. kill `pidof am`
  47. fi
  48. exit 0
  49. }
  50. change_icon()
  51. {
  52. showMsg "提示" "$name的图标是:`basename "$bigicon"`,请选择png格式的图标!" 0
  53. [ $? != 1 ] && exit
  54. bigicon_b=`showFilePicker`
  55. if [ "$bigicon_b" = "" ] ; then
  56. showMsg "警告" "你没有选择任何图标文件,不能修改:$name的图标" 2
  57. exit 0
  58. fi
  59. png=`basename "$bigicon_b" | sed 's/[.]/\\ /g' | awk '{printf $NF}'`
  60. if [ "$png" != "png" ] ; then
  61. showMsg "警告" "请选择png格式的图标! " 2
  62. exit 0
  63. fi
  64. cp -f "$bigicon_b" $bigicon
  65. showNotify "" "$name图标修改成功" 0 3
  66. kill `pidof am`
  67. exit 0
  68. }
  69. cd /ezxlocal/download/
  70. if [ ! -d $directory ] ; then
  71. showMsg "警告" "$name程序的文件夹:`basename $directory`已经不存在,是否清除$name的注册信息?" 1
  72. [ $? != 1 ] && exit
  73. sed -i "$name_start_line,$name_end_line"d "$name_dir"
  74. sed -i "s/$appid//g" /ezxlocal/download/appwrite/am/UserMenuTree
  75. showNotify "" "成功清除$name注册残留信息" 0 3
  76. kill `pidof am`
  77. exit 0
  78. fi
  79. cd "$directory"
  80. EXEC=`echo "$registry" | sed -n '/Exec =/p' | sed s/"Exec ="//g`
  81. if [ ! -e $EXEC ] ; then
  82. showMsg "警告" "$name程序的主程序:$EXEC已经不存在,是否清除$name在注册信息" 1
  83. [ $? != 1 ] && exit
  84. sed -i "$name_start_line,$name_end_line"d "$name_dir"
  85. sed -i "s/$appid//g" /ezxlocal/download/appwrite/am/UserMenuTree
  86. showNotify "" "成功清除$name注册残留信息" 0 3
  87. exit
  88. fi
  89. if [ "$d" = 1 ] ; then
  90. showRadio "mpkg程序" "对 $name 执行操作:" "修改名字" "修改图标" "卸载:$name"
  91. case $? in
  92. 0)
  93. exit 0
  94. ;;
  95. 1)
  96. change_name
  97. ;;
  98. 2)
  99. change_icon
  100. ;;
  101. 3)
  102. showMsg "确定卸载" "`echo -e "是否卸载:$name?\\n卸载路径:$directory"`" 1
  103. [ $? != 1 ] && exit
  104. [ "$directory" = '/' ] && exit
  105. cd /mmc/mmca1
  106. rm -r $directory
  107. sed -i "$name_start_line,$name_end_line"d "$name_dir"
  108. sed -i "s/$appid//g" /ezxlocal/download/appwrite/am/UserMenuTree
  109. kill `pidof am`
  110. showNotify "" "$name卸载成功" 0 3
  111. exit 0
  112. ;;
  113. esac
  114. fi
  115. if echo "$directory" | grep MIDlet ; then
  116. DIRECTORY=`echo "$directory" | sed s/[/]/\\ /g | awk '{print $NF}' | sed s/MIDlet//g`
  117. EXEC=`echo "$registry" | sed -n '/Exec =/p' | sed s/"Exec = java.sh"/java.sh/g | sed s/"Exec = "/Exec/g`
  118. IMEI=`busybox dirname /mmc/mmca1/.system/java_*/DownloadApps | sed s/[/]mmc[/]mmca1[/].system[/]java_//`
  119. echo "$EXEC" | grep Exec &&java_ID="授权:$name"
  120. echo "$EXEC" | grep java.sh && java_ID="降权:$name"
  121. if echo "$name_dir" | grep InstalledDB ; then
  122. PATHJAVA=/ezxlocal/download/mystuff/.system/java/DownloadApps/MIDlet$DIRECTORY
  123. else
  124. PATHJAVA=/mmc/mmca1/.system/java_$IMEI/DownloadApps/MIDlet$DIRECTORY
  125. fi
  126. showRadio "Java程序" "对 $name 执行操作:" "修改名字" "修改图标" "$java_ID"
  127. case $? in
  128. 0)
  129. exit 0
  130. ;;
  131. 1)
  132. change_name
  133. ;;
  134. 2)
  135. change_icon
  136. ;;
  137. 3)
  138. if echo "$EXEC" | grep Exec ; then
  139. showMsg "提高权限" "是否提高:$name的权限?" 1
  140. [ $? != 1 ] && exit 0
  141. setconfig "$name_dir" "Attribute" "1" "$appid"
  142. setconfig "$name_dir" "BigIcon" "$PATHJAVA/Files/java_usr.png" "$appid"
  143. setconfig "$name_dir" "Icon" "" "$appid"
  144. setconfig "$name_dir" "Exec" "java.sh" "$appid"
  145. JAD=`basename $PATHJAVA/Files/*.jar | sed s/.jar//`.jad
  146. if [ -e $PATHJAVA/Files/MIDlet-1.png ] ; then
  147. cp -f $PATHJAVA/Files/MIDlet-1.png $PATHJAVA/Files/java_usr.png
  148. else
  149. cp -f $PATHJAVA/Files/suiteicon.png $PATHJAVA/Files/java_usr.png
  150. fi
  151. JAVA_PT=/ezxlocal/download/mystuff/.system/LouisLaw/usr/java
  152. JAVANAME=`basename $PATHJAVA/Files/*.jar | sed s/.jar//`
  153. cp -f $JAVA_PT/java.sh $PATHJAVA/
  154. cp -f $JAVA_PT/java.rh $PATHJAVA/Files/$JAVANAME.rh
  155. cp -f $JAVA_PT/java.ss $PATHJAVA/Files/$JAVANAME.ss
  156. cp -f $JAVA_PT/java.ii $PATHJAVA/Files/$JAVANAME.ii
  157. kill `pidof am`
  158. showNotify "" "授权成功" 0 3
  159. exit 0
  160. elif echo "$EXEC" | grep java.sh ; then
  161. showMsg "降低权限" "是否降低:$name的权限?" 1
  162. [ $? = 0 ] && exit 0
  163. rm -f $PATHJAVA/java.sh
  164. rm -f $PATHJAVA/Files/java_usr.png
  165. setconfig "$name_dir" "Attribute" "5" "$appid"
  166. setconfig "$name_dir" "BigIcon" "Files/MIDlet-1.png" "$appid"
  167. setconfig "$name_dir" "Icon" "Files/MIDlet-1.png" "$appid"
  168. setconfig "$name_dir" "Exec" "" "$appid"
  169. kill `pidof am`
  170. showNotify "" "降权成功" 0 3
  171. exit 0
  172. fi
  173. ;;
  174. esac
  175. fi
  176. showMsg "温馨提示" "注册表未知错误!
  177. 注册表第$name_line行
  178. 注册位置:$name_dir
  179. 是否用vTextView打开注册表?" 1
  180. [ $? != 1 ] && exit
  181. export LD_PRELOAD=/ezxlocal/LinXtend/usr/lib/libezxapp.so
  182. /ezxlocal/download/mystuff/.system/LouisLaw/usr/zLauncher2.0/zTextViewer/vTextViewer $name_dir
  183. exit 0
复制代码
发表于 2010-4-20 19:59 | 显示全部楼层
看不懂 但一定支持 [s:25]
发表于 2010-4-20 20:00 | 显示全部楼层
板凳 了。。。。。。。
发表于 2010-4-20 20:03 | 显示全部楼层
不懂 帮 夏 大 顶顶了。。。。
发表于 2010-4-20 20:03 | 显示全部楼层
十分感谢你要是只显示Java的怎么办
发表于 2010-4-20 20:05 | 显示全部楼层
夏太牛了[s:55]看不懂,帮顶
发表于 2010-4-20 20:08 | 显示全部楼层
汗,峰都看不懂[s:47][s:47][s:47]
发表于 2010-4-20 20:46 | 显示全部楼层
强烈插入首页!牛贴!回头让我招聘来的程序员看看,能不能给我也开发个什么哈
发表于 2010-4-20 20:55 | 显示全部楼层
貌似好像大概看不懂哦…夏大牛人啊
发表于 2010-4-20 20:56 | 显示全部楼层
哈哈。谢谢夏大。收下了。好好研究。
 Hello,黑武的好机友!回复想偷个懒?点这里: 
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

QQ|小黑屋|Archiver|手机版|爱黑武论坛 ( 京ICP备2023028323号 | 京公网安备11011202000270号 )

GMT+8, 2024-11-17 01:54 , Processed in 0.066945 second(s), 20 queries .

Powered by Discuz! X3.4

Copyright © 2001-2024, ihei5.com

快速回复 返回顶部 返回列表