Commit 84748a27 by sikang

update script

parent f917d71a
echo "1、同盾列表添加最少选择数量" echo "1、同盾列表添加最少选择数量"
echo "2、gradle.properties 添加同盾开关" echo "2、gradle.properties 添加同盾开关"
echo "3、注释 app module中所有权限" echo "3、注释 app module中所有权限"
echo "4、替换引用到的同盾R资源"
echo -n "请输入指令编号:" echo -n "请输入指令编号:"
read commod read commod
...@@ -20,4 +21,10 @@ then ...@@ -20,4 +21,10 @@ then
chmod a+x remove_permission.py chmod a+x remove_permission.py
./remove_permission.py ./remove_permission.py
elif (($commod == '4'))
then
chmod a+x remove_td_res.py
./remove_td_res.py
fi fi
\ No newline at end of file
#!/usr/bin/env python3
import json
import string
import random
import glob, os
import sys
def remove_res(path):
# print("processing content: %s..." % path)
with open(path, "r", encoding="utf-8") as f:
# readlines以列表的形式将文件读出
lines = f.readlines()
with open(path, "w", encoding="utf-8") as f_w:
for line in lines:
if "R.color.color_line_gray" in line:
line = line.replace("R.color.color_line_gray","R.color.qmui_config_color_gray_5")
f_w.write(line)
print ("code_MessageID updated !")
return
for root, dirs, files in os.walk("../../../app/src/main"):
directory = os.path.join(os.getcwd(), root)
for file in files:
if file.endswith("LoginActivity.java"):
# get the path of the java file
path = os.path.join(directory, file)
remove_res(path)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment