-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathdo_debug_folder
executable file
·113 lines (87 loc) · 1.98 KB
/
do_debug_folder
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
############################################################################
#
# Copyright (c) 2014 - by 越狱 (http://weibo.com/206021119)
#
# Android 厨房是100%免费。此脚本文件仅供个人或学习使用
#
############################################################################
#
# 此脚本有两个参数:
#
# $1 = 对 /system 下的文件夹进行 Deodex 操作(强制)
# 例如 framework
# 例如 "framework app"
#
dir_list=$1
if [ "$dir_list" == "" ]
then
echo "没有指定文件夹!"
exit 0
fi
base_dir=`pwd`
api_level=`scripts/get_api_level`
cd WORKING_*
num_apk_app=`find system/app | grep -c "\.apk$"`
if [ -d system/priv-app ]
then
if [ ! -d system/priv-app ]
then
echo
else
num_apk_priv=`find system/priv-app | grep -c "\.apk$"`
echo
fi
fi
cd ..
version=`scripts/get_smali_version`
cd WORKING_*
for folder in ${dir_list[@]}
do
if [ $folder == app ]
then
num_debug_folder=$num_apk_app
elif [ $folder == priv-app ]
then
num_debug_folder=$num_apk_priv
else
echo
echo "错误: $folder 文件夹不可用!"
continue
fi
count=0
found_error=0
path=system/$folder
echo
echo
echo "跳转到 $path ..."
echo
cd $path
grep_cmd=`find . | grep "\.apk$" | sed 's/.\///g' | sort -f`
if [ "$grep_cmd" == "" ]
then
echo "在 $path 中未发现任何东西!"
else
cp -f ../../../tools/deodex_files/baksmali-$version.jar baksmali.jar
cp -f ../../../tools/deodex_files/smali-$version.jar smali.jar
for debug_file in $grep_cmd
do
count=$(($count+1))
echo
echo "一共$num_debug_folder文件在$path文件夹,正在操作第$count个$debug_file"
while [ -e $debug_file ]
do
../../../scripts/do_debug_file $api_level $debug_file
if [ -e $odex_file ]
then
break
fi
done
done
rm -f baksmali.jar
rm -f smali.jar
echo
echo "完成 $path"
fi
cd ../..
done
cd $base_dir