chore:移动包脚本:新增随机包名+md5取反(尽量避免与之前一致)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
package_array=("" "app.yinm.chat.a1." "app.yinm.chat.b2." "app.yinm.room.aa." "app.yinm.room.aa.bd." "app.yinm.room.aa.db." "app.yinm.room.bb." "app.yinm.room.bb.ww." "app.yinm.room.bb.mm.")
|
||||
same_name_files=$(cat same_name_file.txt)
|
||||
touch move_dir_map.txt
|
||||
cat /dev/null > move_dir_map.txt
|
||||
@@ -35,17 +36,19 @@ do
|
||||
fi
|
||||
|
||||
file_md5=$(echo "$file" | md5 | sed 's/[0-9]//g')
|
||||
|
||||
echo '新包名 - '"$file_md5"
|
||||
random_index=$((RANDOM % ${#package_array[@]}))
|
||||
random_package=${package_array[$random_index]}
|
||||
new_name=${random_package}$(echo "$file_md5" | rev)
|
||||
echo '新包名 - '"$new_name"
|
||||
|
||||
for endStr in ${end_with[*]}
|
||||
do
|
||||
sed_format_package_path=$(echo "$package_path""$endStr" | sed 's/\./\\\./g')
|
||||
replace_str=$(echo "$file_md5""$endStr" | sed 's/\./\\\./g')
|
||||
replace_str=$(echo "$new_name""$endStr" | sed 's/\./\\\./g')
|
||||
sed -i "" "s/${sed_format_package_path}/${replace_str}/g" proguard_rules_after_move_dir.txt
|
||||
done
|
||||
|
||||
echo '"'"$package_path"'" : "'"$file_md5"'",' >> move_dir_map.txt
|
||||
echo '"'"$package_path"'" : "'"$new_name"'",' >> move_dir_map.txt
|
||||
|
||||
echo "\n**********"
|
||||
done
|
||||
|
Reference in New Issue
Block a user