22# kakathic
33
44# home
5- home (){ echo ' <group title="' $google_text ' ">
6- <action>
7- <title>' $mage_name_text ' </title>
8- <desc>' $merge_partition_text ' </desc>
9- <set>
10- slog silencekd "$silence"
11- slog dang_filehd "$dang_file"
12- ' $MPAT ' /bin/combine_img $silence $dang_file "$MUTIIMG" "$IMAGE"
13- checktime
14- </set>
15- <param name="silence" value-sh="glog silencekd" label="' $delete_text ' " type="checkbox" />
16- <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 '" ' "/>
17- <param name="MUTIIMG" label="' $select_text ' " options-sh="findfile 6 $PTSD" desc="' $merge_partition_3 ' " required="true" />
18- <param name="IMAGE" options-sh="findfile 3 $PTSD | sed ' " '/system\./d'" ' " desc="' $merge_partition_5 ' " required="true" multiple="true"/>
19- </action>
5+ home () {
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>
2021</group>
2122
2223<group>
23- <action warn="' $oat_text_1 ' ">
24- <title>' $oat_text_3 ' </title>
25- <desc>' $oat_text_4 ' </desc>
26- <param name="PTSH" title="' $config_text_1 ' " label="' $setting_text_3 ' " option-sh="findfile for $SDH" value-sh="glog PTSH"/>
27- <param name="framework_switch" value-sh="glog framework_switch 1" label="' $oat_text_5 ' " type="switch" />
28- <param name="services_switch" value-sh="glog services_switch 1" label="' $oat_text_6 ' " type="switch" />
29- <param name="features_oat" value-sh="glog features_oat default" label="' $oat_text_7 ' " placeholder="default" type="text"/>
30- <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" />
31- <param name="secontex" desc="' $oat_text_9 ' " value-sh="glog secontex" placeholder="PCL[]" type="text"/>
32- <set>
33- slog features_oat "$features_oat"
34- slog apps_apk_oat "$apps_apk_oat"
35- slog secontex "$secontex"
36- slog services_switch "$services_switch"
37- slog framework_switch "$framework_switch"
38- ' $MPAT ' /bin/dex2oat
39- </set>
40- </action></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>
4143
42- <group><action>
43- <title>Sign boot</title>
44- <desc>Sign AVB 1.0 boot, vendor_boot</desc>
45- <param name="NAME" label="' $name_text ' " value-sh="glog name_boot_key boot" type="text" placeholder="boot"/>
46- <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||'" ' "/>
47- <param name="FILE" desc="' $input_text ' .img, ' $folder_text ' ' $PTSD ' " options-sh="cd $PTSD; ls *.img | grep boot" label="' $select_text ' " required="true"/>
48- <set>
49- slog name_boot_key "$NAME"
50- slog sign_boot_key "$SIGN"
51- mkdir -p $PTSD/out
52- cp -rf "$PTSD/$FILE" "$PTSD/out/$FILE"
53- magiskboot sign "$PTSD/out/$FILE" "/$NAME" "$ETC/key/$SIGN.x509.pem" "$ETC/key/$SIGN.pk8" &>/dev/null
54- magiskboot verify "$PTSD/out/$FILE" "$ETC/key/$SIGN.x509.pem" 2>&1 || abort "failed to sign"
55- echo
56- echo "' $save_text ' : $PTSD/out/$FILE"
57- </set>
58- </action></group>
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>
5963
60- <group><action>
61- <title>Protoc</title>
62- <desc>' $protoc_text ' </desc>
63- <param name="LIST" label="' $select_text ' " options-sh="echo -e ' " 'Xml\nJson'" ' "/>
64- <param name="FILE" desc="' $input_text ' .pb .json .xml, ' $folder_text ' ' $PTSD ' " multiple="true" options-sh="findfile file $PTSD ' " '.pb|.json|.xml'" ' " required="true"/>
65- <set>
66- for vvc in $FILE; do
67- if [ $(file $PTSD/$vvc | grep -cm1 "data") == 1 ];then
68- if [ "$LIST" == "Xml" ];then
69- protoc_pb.py --xml -d "$PTSD/$vvc" > "$PTSD/${vvc%.*}.xml"
70- echo "' $save_text ' : $PTSD/${vvc%.*}.xml"
71- else
72- protoc_pb.py -d "$PTSD/$vvc" > "$PTSD/${vvc%.*}.json"
73- echo "' $save_text ' : $PTSD/${vvc%.*}.json"
74- fi
75- elif [ $(file $PTSD/$vvc | grep -cm1 "text") == 1 ];then
76- if [ "${vvc##*.}" == "xml" ];then
77- protoc_pb.py --xml -e "$PTSD/$vvc" -o "$PTSD/${vvc%.*}_new.pb"
78- else
79- protoc_pb.py -e "$PTSD/$vvc" -o "$PTSD/${vvc%.*}_new.pb"
80- fi
81- [ -f "$PTSD/${vvc%.*}_new.pb" ] && echo "' $save_text ' : $PTSD/${vvc%.*}_new.pb"
82- else
83- echo "' $error_text ' $vvc" >&2
84- fi
85- done
86- </set>
87- </action></group>
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>
8894
89- <group><action>
90- <title>Mi Thermal</title>
91- <desc>' $mi_thermal_text ' </desc>
92- <param name="FILE" desc="' $input_text ' .conf, .txt ' $folder_text ' ' $PTSD ' " multiple="true" options-sh="findfile file $PTSD ' " '.conf|.txt'" ' " required="true"/>
93- <set>
94- for vvc in $FILE; do
95- if [ $(file $PTSD/$vvc | grep -cm1 "data") == 1 ];then
96- thermal-crypt.py -i "$PTSD/$vvc" -o "$PTSD/${vvc%.*}.txt"
97- elif [ $(file $PTSD/$vvc | grep -cm1 "text") == 1 ];then
98- thermal-crypt.py -e -i "$PTSD/$vvc" -o "$PTSD/${vvc%.*}_new.conf"
99- else
100- echo "' $error_text ' $vvc" >&2
101- fi
102- done
103- </set>
104- </action></group>
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>
105113
106- <group><action>
107- <title>Unpack splitapp</title>
108- <desc>' $splitapp_desc_text ' </desc>
109- <param name="FILE" label="' $select_text ' " desc="' $input_text ' .APP, ' $folder_text ' ' $PTSD ' " options-sh="findfile file $PTSD ' " '.app|.APP'" ' " required="true"/>
110- <set>
111- if [ -f "$FILE" ];then
112- splitapp.py -f "$FILE" -o $PTSD/out
113- echo
114- echo "' $save_text ' : $PTSD/out"
115- else
116- echo "' $error_text ' $FILE" >&2
117- fi
118- </set>
119- </action>
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>
120129
121- <action>
122- <title>Unpack pac</title>
123- <desc>' $pac_desc_text ' </desc>
124- <param name="FILE" label="' $select_text ' " desc="' $input_text ' .pac, ' $folder_text ' ' $PTSD ' " options-sh="findfile file $PTSD .pac" required="true"/>
125- <set>
126- if [ -f "$FILE" ];then
127- unpac.py extract -d $PTSD/out "$FILE"
128- echo
129- echo "' $save_text ' : $PTSD/out"
130- else
131- echo "' $error_text ' $FILE" >&2
132- fi
133- </set>
134- </action>
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>
135144</group>'
136145}
137146
@@ -143,18 +152,19 @@ eval "$(grep '="' "$MPAT/addon.prop" | sed "/google_text=/d")"
143152[ -f " $MPAT /language.bash" ] && source " $MPAT /language.bash"
144153
145154# Google dịch
146- if [ " $( glog " auto_trans_text_${MPAT##*/ } " ) " == 1 ]; then
147- trans_add " $MPAT "
148- [ -f " $MPAT /auto.sh" ] && source " $MPAT /auto.sh"
155+ if [ " $( glog " auto_trans_text_${MPAT##*/ } " ) " == 1 ]; then
156+ trans_add " $MPAT "
157+ [ -f " $MPAT /auto.sh" ] && source " $MPAT /auto.sh"
149158fi
150159
151160# index
152161echo ' <?xml version="1.0" encoding="UTF-8" ?>
153162<group>'
154- # index
155- if [ " $( type -t " $1 " ) " = " function" ]; then
156- " $@ "
163+
164+ if [ " $( type -t " $1 " ) " = " function" ]; then
165+ " $@ "
157166else
158- cat " $ETC /error.xml"
167+ cat " $ETC /error.xml"
159168fi
160- echo ' </group>'
169+
170+ echo ' </group>'
0 commit comments