11#! /data/data/com.tool.tree/files/home/bin/bash
2- # kakathic
2+ # Kakathic
33
4- # home
54home () {
6- echo ' <group title="' $google_text ' ">
7- <action>
8- <title>' $mage_name_text ' </title>
9- <desc>' $merge_partition_text ' </desc>
10- <set>
11- slog silencekd "$silence"
12- slog dang_filehd "$dang_file"
13- ' $MPAT ' /bin/combine_img $silence $dang_file "$MUTIIMG" "$IMAGE"
14- checktime
15- </set>
16- <param name="silence" value-sh="glog silencekd" label="' $delete_text ' " type="checkbox" />
17- <param name="dang_file" value-sh="glog dang_filehd" label="' $select_text ' " desc="' $merge_partition_1 ' " options-sh="echo -e ' " '0|$default_text \n1|erofs\n2|ext4\n3|$pack_img_text '" ' "/>
18- <param name="MUTIIMG" label="' $select_text ' " options-sh="findfile 6 $PTSD" desc="' $merge_partition_3 ' " required="true" />
19- <param name="IMAGE" options-sh="findfile 3 $PTSD | sed ' " '/system\./d'" ' " desc="' $merge_partition_5 ' " required="true" multiple="true"/>
20- </action>
21- </group>
22-
23- <group>
24- <action warn="' $oat_text_1 ' ">
25- <title>' $oat_text_3 ' </title>
26- <desc>' $oat_text_4 ' </desc>
27- <param name="PTSH" title="' $config_text_1 ' " label="' $setting_text_3 ' " option-sh="findfile for $SDH" value-sh="glog PTSH"/>
28- <param name="framework_switch" value-sh="glog framework_switch 1" label="' $oat_text_5 ' " type="switch" />
29- <param name="services_switch" value-sh="glog services_switch 1" label="' $oat_text_6 ' " type="switch" />
30- <param name="features_oat" value-sh="glog features_oat default" label="' $oat_text_7 ' " placeholder="default" type="text"/>
31- <param name="apps_apk_oat" label="' $oat_text_8 ' " desc="' $oat_text_10 ' " value-sh="glog apps_apk_oat" options-sh="' $MPAT ' /bin/listapk" multiple="multiple" />
32- <param name="secontex" desc="' $oat_text_9 ' " value-sh="glog secontex" placeholder="PCL[]" type="text"/>
33- <set>
34- slog features_oat "$features_oat"
35- slog apps_apk_oat "$apps_apk_oat"
36- slog secontex "$secontex"
37- slog services_switch "$services_switch"
38- slog framework_switch "$framework_switch"
39- ' $MPAT ' /bin/dex2oat
40- </set>
41- </action>
42- </group>
43-
44- <group>
45- <action>
46- <title>Sign boot</title>
47- <desc>Sign AVB 1.0 boot, vendor_boot</desc>
48- <param name="NAME" label="' $name_text ' " value-sh="glog name_boot_key boot" type="text" placeholder="boot"/>
49- <param name="SIGN" value-sh="glog sign_boot_key testkey" label="' $sign_text ' " options-sh="findfile file $ETC/key x509.pem | sed ' " 's|.x509.pem||'" ' "/>
50- <param name="FILE" desc="' $input_text ' .img, ' $folder_text ' ' $PTSD ' " options-sh="cd $PTSD; ls *.img | grep boot" label="' $select_text ' " required="true"/>
51- <set>
52- slog name_boot_key "$NAME"
53- slog sign_boot_key "$SIGN"
54- mkdir -p $PTSD/out
55- cp -rf "$PTSD/$FILE" "$PTSD/out/$FILE"
56- magiskboot sign "$PTSD/out/$FILE" "/$NAME" "$ETC/key/$SIGN.x509.pem" "$ETC/key/$SIGN.pk8" &>/dev/null
57- magiskboot verify "$PTSD/out/$FILE" "$ETC/key/$SIGN.x509.pem" 2>&1 || abort "failed to sign"
58- echo
59- echo "' $save_text ' : $PTSD/out/$FILE"
60- </set>
61- </action>
62- </group>
63-
64- <group>
65- <action>
66- <title>Protoc</title>
67- <desc>' $protoc_text ' </desc>
68- <param name="LIST" label="' $select_text ' " options-sh="echo -e ' " 'Xml\nJson'" ' "/>
69- <param name="FILE" desc="' $input_text ' .pb .json .xml, ' $folder_text ' ' $PTSD ' " multiple="true" options-sh="findfile file $PTSD ' " '.pb|.json|.xml'" ' " required="true"/>
70- <set>
71- for vvc in $FILE; do
72- if [ $(file $PTSD/$vvc | grep -cm1 "data") == 1 ]; then
73- if [ "$LIST" == "Xml" ]; then
74- protoc_pb.py --xml -d "$PTSD/$vvc" > "$PTSD/${vvc%.*}.xml"
75- echo "' $save_text ' : $PTSD/${vvc%.*}.xml"
76- else
77- protoc_pb.py -d "$PTSD/$vvc" > "$PTSD/${vvc%.*}.json"
78- echo "' $save_text ' : $PTSD/${vvc%.*}.json"
79- fi
80- elif [ $(file $PTSD/$vvc | grep -cm1 "text") == 1 ]; then
81- if [ "${vvc##*.}" == "xml" ]; then
82- protoc_pb.py --xml -e "$PTSD/$vvc" -o "$PTSD/${vvc%.*}_new.pb"
83- else
84- protoc_pb.py -e "$PTSD/$vvc" -o "$PTSD/${vvc%.*}_new.pb"
85- fi
86- [ -f "$PTSD/${vvc%.*}_new.pb" ] && echo "' $save_text ' : $PTSD/${vvc%.*}_new.pb"
87- else
88- echo "' $error_text ' $vvc" >&2
89- fi
90- done
91- </set>
92- </action>
93- </group>
94-
95- <group>
96- <action>
97- <title>Mi Thermal</title>
98- <desc>' $mi_thermal_text ' </desc>
99- <param name="FILE" desc="' $input_text ' .conf, .txt ' $folder_text ' ' $PTSD ' " multiple="true" options-sh="findfile file $PTSD ' " '.conf|.txt'" ' " required="true"/>
100- <set>
101- for vvc in $FILE; do
102- if [ $(file $PTSD/$vvc | grep -cm1 "data") == 1 ]; then
103- thermal-crypt.py -i "$PTSD/$vvc" -o "$PTSD/${vvc%.*}.txt"
104- elif [ $(file $PTSD/$vvc | grep -cm1 "text") == 1 ]; then
105- thermal-crypt.py -e -i "$PTSD/$vvc" -o "$PTSD/${vvc%.*}_new.conf"
106- else
107- echo "' $error_text ' $vvc" >&2
108- fi
109- done
110- </set>
111- </action>
112- </group>
113-
114- <group>
115- <action>
116- <title>Unpack splitapp</title>
117- <desc>' $splitapp_desc_text ' </desc>
118- <param name="FILE" label="' $select_text ' " desc="' $input_text ' .APP, ' $folder_text ' ' $PTSD ' " options-sh="findfile file $PTSD ' " '.app|.APP'" ' " required="true"/>
119- <set>
120- if [ -f "$FILE" ]; then
121- splitapp.py -f "$FILE" -o $PTSD/out
122- echo
123- echo "' $save_text ' : $PTSD/out"
124- else
125- echo "' $error_text ' $FILE" >&2
126- fi
127- </set>
128- </action>
129-
130- <action>
131- <title>Unpack pac</title>
132- <desc>' $pac_desc_text ' </desc>
133- <param name="FILE" label="' $select_text ' " desc="' $input_text ' .pac, ' $folder_text ' ' $PTSD ' " options-sh="findfile file $PTSD .pac" required="true"/>
134- <set>
135- if [ -f "$FILE" ]; then
136- unpac.py extract -d $PTSD/out "$FILE"
137- echo
138- echo "' $save_text ' : $PTSD/out"
139- else
140- echo "' $error_text ' $FILE" >&2
141- fi
142- </set>
143- </action>
144- </group>'
5+ echo '
6+ [[group]]
7+ title = "' $google_text ' "
8+ [[group.action]]
9+ title = "' $mage_name_text ' "
10+ desc = "' $merge_partition_text ' "
11+ script = """
12+ slog silencekd "$silence"
13+ slog dang_filehd "$dang_file"
14+ ' $MPAT ' /bin/combine_img $silence $dang_file "$MUTIIMG" "$IMAGE"
15+ checktime
16+ """
17+ [[group.action.params]]
18+ name = "silence"
19+ label = "' $delete_text ' "
20+ type = "checkbox"
21+ value-sh = "glog silencekd"
22+ [[group.action.params]]
23+ name = "dang_file"
24+ title = "' $merge_partition_1 ' "
25+ label = "' $select_text ' "
26+ value-sh = "glog dang_filehd"
27+ options-sh = """
28+ echo -e "0|' $default_text ' \n1|erofs\n2|ext4\n3|' $pack_img_text ' "
29+ """
30+ [[group.action.params]]
31+ name = "MUTIIMG"
32+ desc = "' $merge_partition_3 ' "
33+ label = "' $select_text ' "
34+ options-sh = "findfile 6 $PTSD"
35+ required = "true"
36+ [[group.action.params]]
37+ name = "IMAGE"
38+ desc = "' $merge_partition_5 ' "
39+ label = "' $select_text ' "
40+ multiple = "true"
41+ options-sh = """
42+ findfile 3 $PTSD | sed "/^system./d"
43+ """
44+ [[group]]
45+ [[group.action]]
46+ warn = "' $oat_text_1 ' "
47+ title = "' $oat_text_3 ' "
48+ desc = "' $oat_text_4 ' "
49+ script = """
50+ slog features_oat "$features_oat"
51+ slog apps_apk_oat "$apps_apk_oat"
52+ slog secontex "$secontex"
53+ slog services_switch "$services_switch"
54+ slog framework_switch "$framework_switch"
55+ ' $MPAT ' /bin/dex2oat
56+ """
57+ [[group.action.params]]
58+ name = "PTSH"
59+ title = "' $config_text_1 ' "
60+ label = "' $setting_text_3 ' "
61+ options-sh = "findfile for $SDH"
62+ value-sh = "glog PTSH"
63+ [[group.action.params]]
64+ name = "framework_switch"
65+ label = "' $oat_text_5 ' "
66+ type = "switch"
67+ value-sh = "glog framework_switch 1"
68+ [[group.action.params]]
69+ name = "services_switch"
70+ label = "' $oat_text_6 ' "
71+ type = "switch"
72+ value-sh = "glog services_switch 1"
73+ [[group.action.params]]
74+ name = "features_oat"
75+ label = "' $oat_text_7 ' "
76+ placeholder = "default"
77+ type = "text"
78+ value-sh = "glog features_oat default"
79+ [[group.action.params]]
80+ name = "apps_apk_oat"
81+ desc = "' $oat_text_10 ' "
82+ label = "' $oat_text_8 ' "
83+ placeholder = "default"
84+ type = "text"
85+ options-sh = "' $MPAT ' /bin/listapk"
86+ value-sh = "glog apps_apk_oat"
87+ multiple = "true"
88+ [[group.action.params]]
89+ name = "secontex"
90+ desc = "' $oat_text_9 ' "
91+ placeholder = "PCL[]"
92+ type = "text"
93+ value-sh = "glog secontex"
94+ [[group]]
95+ [[group.action]]
96+ title = "Sign boot"
97+ desc = "Sign AVB 1.0 boot, vendor_boot"
98+ script = """
99+ slog name_boot_key "$NAME"
100+ slog sign_boot_key "$SIGN"
101+ mkdir -p $PTSD/out
102+ cp -rf "$PTSD/$FILE" "$PTSD/out/$FILE"
103+ magiskboot sign "$PTSD/out/$FILE" "/$NAME" "$ETC/key/$SIGN.x509.pem" "$ETC/key/$SIGN.pk8" &>/dev/null
104+ magiskboot verify "$PTSD/out/$FILE" "$ETC/key/$SIGN.x509.pem" 2>&1 || abort "failed to sign"
105+ echo
106+ echo "' $save_text ' : $PTSD/out/$FILE"
107+ """
108+ [[group.action.params]]
109+ name = "NAME"
110+ label = "' $name_text ' "
111+ value-sh = "glog name_boot_key boot"
112+ type = "text"
113+ placeholder = "boot"
114+ [[group.action.params]]
115+ name = "SIGN"
116+ value-sh = "glog sign_boot_key testkey"
117+ label = "' $sign_text ' "
118+ options-sh = "findfile file $ETC/key x509.pem | sed \"s|.x509.pem||\""
119+ [[group.action.params]]
120+ name = "FILE"
121+ desc = "' $input_text ' .img, ' $folder_text ' ' $PTSD ' "
122+ options-sh = "cd $PTSD; ls *.img | grep boot"
123+ label = "' $select_text ' "
124+ required = "true"
125+ [[group]]
126+ [[group.action]]
127+ title = "Protoc"
128+ desc = "' $protoc_text ' "
129+ script = """
130+ for vvc in $FILE; do
131+ if [ $(file $PTSD/$vvc | grep -cm1 "data") == 1 ]; then
132+ if [ "$LIST" == "Xml" ]; then
133+ protoc_pb.py --xml -d "$PTSD/$vvc" > "$PTSD/${vvc%.*}.xml"
134+ echo "' $save_text ' : $PTSD/${vvc%.*}.xml"
135+ else
136+ protoc_pb.py -d "$PTSD/$vvc" > "$PTSD/${vvc%.*}.json"
137+ echo "' $save_text ' : $PTSD/${vvc%.*}.json"
138+ fi
139+ elif [ $(file $PTSD/$vvc | grep -cm1 "text") == 1 ]; then
140+ if [ "${vvc##*.}" == "xml" ]; then
141+ protoc_pb.py --xml -e "$PTSD/$vvc" -o "$PTSD/${vvc%.*}_new.pb"
142+ else
143+ protoc_pb.py -e "$PTSD/$vvc" -o "$PTSD/${vvc%.*}_new.pb"
144+ fi
145+ [ -f "$PTSD/${vvc%.*}_new.pb" ] && echo "' $save_text ' : $PTSD/${vvc%.*}_new.pb"
146+ else
147+ echo "' $error_text ' $vvc" >&2
148+ fi
149+ done
150+ """
151+ [[group.action.params]]
152+ name = "LIST"
153+ label = "' $select_text ' "
154+ options-sh = "echo -e \"Xml\nJson\""
155+ [[group.action.params]]
156+ name = "FILE"
157+ desc = "' $input_text ' .pb .json .xml, ' $folder_text ' ' $PTSD ' "
158+ multiple = "true"
159+ options-sh = "findfile file $PTSD \".pb|.json|.xml\""
160+ required = "true"
161+ [[group]]
162+ [[group.action]]
163+ title = "Mi Thermal"
164+ desc = "' $mi_thermal_text ' "
165+ script = """
166+ for vvc in $FILE; do
167+ if [ $(file $PTSD/$vvc | grep -cm1 "data") == 1 ]; then
168+ thermal-crypt.py -i "$PTSD/$vvc" -o "$PTSD/${vvc%.*}.txt"
169+ elif [ $(file $PTSD/$vvc | grep -cm1 "text") == 1 ]; then
170+ thermal-crypt.py -e -i "$PTSD/$vvc" -o "$PTSD/${vvc%.*}_new.conf"
171+ else
172+ echo "' $error_text ' $vvc" >&2
173+ fi
174+ done
175+ """
176+ [[group.action.params]]
177+ name = "FILE"
178+ desc = "' $input_text ' .conf, .txt ' $folder_text ' ' $PTSD ' "
179+ multiple = "true"
180+ options-sh = "findfile file $PTSD \".conf|.txt\""
181+ required = "true"
182+ [[group]]
183+ [[group.action]]
184+ title = "Unpack splitapp"
185+ desc = "' $splitapp_desc_text ' "
186+ script = """
187+ if [ -f "$FILE" ]; then
188+ splitapp.py -f "$FILE" -o $PTSD/out
189+ echo
190+ echo "' $save_text ' : $PTSD/out"
191+ else
192+ echo "' $error_text ' $FILE" >&2
193+ fi
194+ """
195+ [[group.action.params]]
196+ name = "FILE"
197+ label = "' $select_text ' "
198+ desc = "' $input_text ' .APP, ' $folder_text ' ' $PTSD ' "
199+ options-sh = "findfile file $PTSD \".app|.APP\""
200+ required = "true"
201+ [[group.action]]
202+ title = "Unpack pac"
203+ desc = "' $pac_desc_text ' "
204+ script = """
205+ if [ -f "$FILE" ]; then
206+ unpac.py extract -d $PTSD/out "$FILE"
207+ echo
208+ echo "' $save_text ' : $PTSD/out"
209+ else
210+ echo "' $error_text ' $FILE" >&2
211+ fi
212+ """
213+ [[group.action.params]]
214+ name = "FILE"
215+ label = "' $select_text ' "
216+ desc = "' $input_text ' .pac, ' $folder_text ' ' $PTSD ' "
217+ options-sh = "findfile file $PTSD .pac"
218+ required = "true"
219+ '
145220}
146221
147222# Thư mục hiện tại
@@ -157,14 +232,5 @@ if [ "$(glog "auto_trans_text_${MPAT##*/}")" == 1 ]; then
157232 [ -f " $MPAT /auto.sh" ] && source " $MPAT /auto.sh"
158233fi
159234
160- # index
161- echo ' <?xml version="1.0" encoding="UTF-8" ?>
162- <group>'
163-
164- if [ " $( type -t " $1 " ) " = " function" ]; then
165- " $@ "
166- else
167- cat " $ETC /error.xml"
168- fi
169-
170- echo ' </group>'
235+ # home
236+ " $@ "
0 commit comments