jiangmingwei 1 vuosi sitten
commit
17cdf6dac2
10 muutettua tiedostoa jossa 1832 lisäystä ja 0 poistoa
  1. 139 0
      .gitignore
  2. 35 0
      README.md
  3. 0 0
      __init__.py
  4. 138 0
      custom_day_night.py
  5. 111 0
      file_processer.py
  6. 0 0
      utils/__init__.py
  7. 816 0
      utils/color_set.py
  8. 147 0
      utils/include_utils.py
  9. 18 0
      utils/module_utils.py
  10. 428 0
      utils/other_utils.py

+ 139 - 0
.gitignore

@@ -0,0 +1,139 @@
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+wheels/
+share/python-wheels/
+*.egg-info/
+.installed.cfg
+*.egg
+MANIFEST
+
+# PyInstaller
+#  Usually these files are written by a python script from a template
+#  before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.nox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*.cover
+*.py,cover
+.hypothesis/
+.pytest_cache/
+cover/
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+local_settings.py
+db.sqlite3
+db.sqlite3-journal
+
+# Flask stuff:
+instance/
+.webassets-cache
+
+# Scrapy stuff:
+.scrapy
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+.pybuilder/
+target/
+
+# Jupyter Notebook
+.ipynb_checkpoints
+
+# IPython
+profile_default/
+ipython_config.py
+
+# pyenv
+#   For a library or package, you might want to ignore these files since the code is
+#   intended to run in multiple environments; otherwise, check them in:
+# .python-version
+
+# pipenv
+#   According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
+#   However, in case of collaboration, if having platform-specific dependencies or dependencies
+#   having no cross-platform support, pipenv may install dependencies that don't work, or not
+#   install all needed dependencies.
+#Pipfile.lock
+
+# PEP 582; used by e.g. github.com/David-OConnor/pyflow
+__pypackages__/
+
+# Celery stuff
+celerybeat-schedule
+celerybeat.pid
+
+# SageMath parsed files
+*.sage.py
+
+# Environments
+.env
+.venv
+env/
+venv/
+ENV/
+env.bak/
+venv.bak/
+
+# Spyder project settings
+.spyderproject
+.spyproject
+
+# Rope project settings
+.ropeproject
+
+# mkdocs documentation
+/site
+
+# mypy
+.mypy_cache/
+.dmypy.json
+dmypy.json
+
+# Pyre type checker
+.pyre/
+
+# pytype static type analyzer
+.pytype/
+
+# Cython debug symbols
+cython_debug/
+.idea

+ 35 - 0
README.md

@@ -0,0 +1,35 @@
+# day_night
+
+#### 介绍
+demo
+
+#### 软件架构
+软件架构说明
+
+
+#### 安装教程
+
+1.  xxxx
+2.  xxxx
+3.  xxxx
+
+#### 使用说明
+
+1.  xxxx
+2.  xxxx
+3.  xxxx
+
+#### 参与贡献
+
+1.  Fork 本仓库
+2.  新建 Feat_xxx 分支
+3.  提交代码
+4.  新建 Pull Request
+#### 特技
+
+1.  使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
+2.  Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
+3.  你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
+4.  [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
+5.  Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
+6.  Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

+ 0 - 0
__init__.py


+ 138 - 0
custom_day_night.py

@@ -0,0 +1,138 @@
+import os
+import re
+
+from file_processer import replace_file_by_path
+from utils.module_utils import get_modules_from_settings_file
+from utils.other_utils import unify_path_separator, get_excluded_dirs
+
+parse_included_files = set()
+
+
+def replace_action(project_dir: str, included_files: set, included_pattern: set, included_keywords: set):
+    print("任务开始执行-------------------------------------------\n")
+    modules = get_modules_from_settings_file(project_dir)
+    result_paths = set()
+
+    for module in modules:
+        print("-------------------------------------------\n")
+        module_dir = project_dir + os.path.sep + module.replace(":", os.path.sep)
+        print(f"检测{module}模块:{module_dir}")
+        for root, dirs, files in os.walk(module_dir):
+            excluded_dirs = get_excluded_dirs()
+            dirs[:] = [d for d in dirs if d not in excluded_dirs]
+            for file in files:
+                path = os.path.join(root, file)
+                file_path = unify_path_separator(path)
+                # 是否指定文件名称
+                file_name = os.path.basename(file_path)
+                if file_name in included_files:
+                    result_paths.add(file_path)
+                # 是否指定正则表达式
+                for keyword in included_pattern:
+                    pattern = re.compile(keyword)
+                    if pattern.search(file_path):
+                        result_paths.add(file_path)
+                # 指定关键字
+                for keyword in included_keywords:
+                    tmp = unify_path_separator(keyword)
+                    if tmp in file_path:
+                        result_paths.add(file_path)
+    for path in result_paths:
+        # 处理文件
+        print(f"处理文件{path}")
+        replace_file_by_path(path, lambda layout_name: {
+            parse_included_files.add(layout_name)
+        })
+    if parse_included_files.__len__() != 0:
+        print(f"处理遍历进来的布局文件{parse_included_files}")
+        temp = parse_included_files.copy()
+        parse_included_files.clear()
+        replace_action(project_dir, temp, set(), set())
+
+
+if __name__ == '__main__':
+    project_dir = 'D:\\workspace/android/hykb'
+
+    included_files = set()
+    included_pattern = set()
+    included_keywords = set()
+
+    # 首页
+    # included_files.add("GameRecommendFragment.java")
+    # included_files.add("fragment_game_recommend.xml")
+    # included_files.add("item_jingxuan_gaosu.xml")
+    # included_keywords.add('/com/xmcy/hykb/app/ui/gamerecommend/')
+    # 首页精选
+    # included_files.add("HomeIndexFragment.java")
+    # included_pattern.add(r"item_homeindex_.*\.xml")
+    # included_pattern.add(r"item_home_.*\.xml")
+    # included_keywords.add('/com/xmcy/hykb/app/ui/homeindex/')
+
+    # 首页精选负二楼
+    # included_pattern.add(r"item_two_.*\.xml")
+    # included_keywords.add('/com/xmcy/hykb/app/ui/gamerecommend/twoleveladapter/')
+
+    # 分类-分类tab
+    # included_files.add("XinQiFragment.java")
+    # included_pattern.add(r"item_xinqi_.*\.xml")
+
+    included_files.add("SettingActivity.java")
+    included_files.add("TestActivity.java")
+    included_files.add("DownloadInstallActivity.java")
+    included_files.add("AccountSafeActivity.java")
+
+    included_files.add("activity_account_safe.xml")
+    included_files.add("account_safe_root_view.xml")
+    included_files.add("activity_close_account.xml")
+    included_files.add("activity_close_account_result.xml")
+    included_files.add("activity_game_time_bind.xml")
+    included_files.add("game_time_bind_root_view.xml")
+    included_files.add("activity_phone_and_third_bind.xml")
+    included_files.add("activity_download_install.xml")
+    included_files.add("activity_net_permission_check.xml")
+    included_files.add("activity_teen_mode_setting.xml")
+    included_files.add("activity_modify_area.xml")
+    included_files.add("item_modify_area.xml")
+    included_files.add("activity_bind_phone.xml")
+    included_files.add("activity_clip_image.xml")
+    included_files.add("activity_clip_image.xml")
+    included_files.add("dialog_modify_nick_name.xml")
+    included_files.add("dialog_modify_signature.xml")
+    included_files.add("activity_clip_square_image.xml")
+    included_files.add("activity_clip_rectangle_image.xml")
+    included_files.add("activity_clip_image.xml")
+    included_files.add("activity_h5_webview.xml")
+    included_files.add("activity_privacy_manager.xml")
+    included_files.add("activity_person_info.xml")
+    included_files.add("include_person_info_base.xml")
+    included_files.add("include_person_info_form.xml")
+    included_files.add("PersonInfoView.java")
+    included_files.add("PersonInfoItemView.java")
+    included_files.add("view_person_info.xml")
+    included_files.add("include_navigate_back_and_title_white.xml")
+
+    included_files.add("common_toolbar_2.xml")
+    included_files.add("layout_teen_mode_setting.xml")
+    included_files.add("layout_teen_mode_password.xml")
+    included_files.add("layout_teen_mode_forget_pws.xml")
+    included_files.add("btn_disable_22dp.xml")
+    included_files.add("btn_enable_22dp.xml")
+
+    included_files.add("bg_default_item_click_eb23c268.xml")
+
+    included_files.add("SelectImageBottomDialog.java")
+    included_files.add("dialog_select_image.xml")
+
+    included_files.add("SplashActivity.java")
+    included_files.add("SplashButton.java")
+    included_files.add("GuideActivity.java")
+
+    included_keywords.add('/com/xmcy/hykb/app/ui/setting/')
+    included_keywords.add('/com/xmcy/hykb/app/ui/userinfo/')
+    included_keywords.add('/com/xmcy/hykb/app/ui/accountsafe/')
+    included_keywords.add('/com/xmcy/hykb/app/ui/teen_mode/')
+    included_keywords.add('/com/xmcy/hykb/app/ui/netpermissioncheck/')
+
+    # 开始处理
+    replace_action(project_dir, included_files, included_pattern, included_keywords)
+    print("任务结束-------------------------------------------\n")

+ 111 - 0
file_processer.py

@@ -0,0 +1,111 @@
+#!/usr/bin/python
+# -*- coding: UTF-8 -*-
+import os
+
+from utils.include_utils import auto_parse_include
+from utils.other_utils import get_file_suffix, extract_codes_colors, replace_old_color, update_themes, \
+    replace_res_utils, bg_white_radius10, bg_btn_ffffff_10dp, add_xml_res_auto, \
+    add_import_R, bg_homeindex_item_10, unify_path_separator, \
+    get_included_suffix, get_excluded_files, update_deprecated, bg_btn_white_topr10, \
+    bg_btn_white_topr12, bg_btn_white_topr16, replace_xml_imageview, replace_xml_textview, \
+    replace_system_bar, delete_xml_remark, replace_icon, replace_background, hykb_dimens
+
+
+# 替换java/kotlin/xml文件中的颜色硬编码
+def replace_file_by_path(file_path: str, auto_include_callback=None):
+    # 整理文件路径
+    file_path = unify_path_separator(file_path)
+    if not os.path.isfile(file_path):
+        print(f"{file_path} 不是一个文件")
+        return
+    # 获取文件后缀
+    suffix = get_file_suffix(file_path)
+    if suffix not in get_included_suffix():
+        print(f"忽略{suffix}格式文件")
+        return
+    # 获取文件名
+    file_name = os.path.basename(file_path)
+    if file_name in get_excluded_files():
+        print(f"{file_name} 是忽略文件")
+        return
+    print(f"处理文件:{file_path}")
+
+    with open(file_path, 'r', encoding='utf-8') as f:
+        text = f.read()
+
+    text = text.replace("\"#ffffffff\"", "\"#ffffff\"")
+    text = text.replace("\"#FFFFFFFF\"", "\"#ffffff\"")
+
+    # 自动解析include
+    auto_parse_include(text, suffix, auto_include_callback)
+    # fix过时方法
+    text = update_deprecated(text)
+    # 提取文件中的颜色硬编码
+    text = extract_codes_colors(text, suffix)
+    # 替换旧的颜色
+    text = replace_old_color(text)
+    # 更新主题
+    text = update_themes(text)
+    # 删除xml注释
+    text = delete_xml_remark(text)
+    # 替换旧的dimen
+    text = hykb_dimens(text)
+
+    text = bg_white_radius10(text)
+    text = bg_homeindex_item_10(text)
+    text = bg_btn_ffffff_10dp(text)
+    # text = MoreButtonStyle(text)
+    # text = BaseTextOneLineStyle(text)
+
+    text = bg_btn_white_topr10(text)
+    text = bg_btn_white_topr12(text)
+    text = bg_btn_white_topr16(text)
+
+    text = replace_xml_imageview(text)
+    text = replace_xml_textview(text)
+    text = replace_icon(text)
+    text = replace_background(text)
+
+    # 错误校正,非必须
+    text = text.replace("green_brandDark", "green_brand")
+    text = text.replace("green_brand_brand", "green_brand")
+    text = text.replace("green_brand_brandDark", "green_brand")
+    text = text.replace("green_brandDark", "green_brand")
+    text = text.replace("green_brand_08", "green_brand_7")
+    text = text.replace("green_brand_brand_word", "green_word")
+    text = text.replace("green_brand_word", "green_word")
+    text = text.replace("green_brand_hover", "green_hover")
+    text = text.replace("green_brand_line", "green_line")
+    text = text.replace("green_brand_e0fce7", "green_e0fce7")
+    text = text.replace("bg_light_00", "transparent")
+    text = text.replace("font_color_ff131715", "black_h1")
+    text = text.replace("green_brand_bg", "green_bg")
+    text = text.replace("color_ff131715", "black_h1")
+    text = text.replace("color_green_", "green_brand_")
+
+    # text = text.replace("Color.parseColor(\"#ffffff\")", "ResUtils.getColor(R.color.white)")
+    # text = text.replace("Color.parseColor(\"#ffffffff\")", "ResUtils.getColor(R.color.white)")
+    # text = text.replace("android:textColor=\"#ffffffff\"", "android:textColor=\"@color/white\"")
+    # text = text.replace("android:background=\"#ffffffff\"", "android:background=\"@color/bg_white\"")
+    # text = text.replace("setImageDrawable(ContextCompat.getDrawable(mActivity, ", "setImageResource((")
+
+    # 添加xml头信息
+    text = add_xml_res_auto(text)
+    # 替换旧方法
+    text = replace_res_utils(text, suffix)
+    # 添加R文件引入
+    text = add_import_R(text, suffix)
+    # 删除Java多余空白行
+    # text = delete_java_blank_line(text)
+    # 删除xml多余空白行
+    # text = delete_xml_blank_line(text, suffix)
+
+    text = text.replace("color_333333", "black_h2")
+    text = text.replace("color_999999", "black_h4")
+
+    # 处理状态栏
+    text = replace_system_bar(text)
+
+    # 替换旧文件中的内容
+    with open(file_path, 'w', encoding='utf-8') as f:
+        f.write(text)

+ 0 - 0
utils/__init__.py


+ 816 - 0
utils/color_set.py

@@ -0,0 +1,816 @@
+#!/usr/bin/python
+# -*- coding: UTF-8 -*-
+# 新的颜色集
+def get_new_colors():
+    colors = [('transparent', '#00000000', '#00000000'),
+              ('black', '#000000', '#000000'),
+              ('black_h1', '#131715', '#DFE5E5'),
+              ('black_h2', '#3E403F', '#B0B5B5'),
+              ('black_h3', '#7A7D7A', '#7C8080'),
+              ('black_h4', '#A7A8A7', '#6F7373'),
+              ('black_h5', '#CFD1D0', '#575959'),
+              ('button_line', '#99CFD1D0', '#99575959'),
+              ('line', '#EEEEEE', '#363838'),
+              ('bg_light', '#F6F5F5', '#303232'),
+              ('bg_lighter', '#FBFAFA', '#2D2E2E'),
+              ('bg_white', '#FFFFFF', '#252626'),
+              ('bg_deep', '#F2F3F5', '#191919'),
+              ('white', '#FFFFFF', '#FFFFFF'),
+              ('green_brand', '#23C268', '#21A65B'),
+              ('green_word', '#0AAC3C', '#2E994D'),
+              ('green_bg', '#1423C268', '#1E85B299'),
+              ('green_hover', '#26E089', '#26BF78'),
+              ('change_green_start', '#3AD470', '#3DCC6F'),
+              ('change_green_end', '#28C36B', '#24B262'),
+              ('red', '#F16456', '#D9584C'),
+              ('red_bg', '#EBF16456', '#1FCC6F66'),
+              ('change_red_start', '#FF6A86', '#D94B63'),
+              ('change_red_end', '#FF4938', '#D94B43'),
+              ('yellow', '#FFA224', '#E89323'),
+              ('yellow_bg', '#14FFA224', '#14B27E24'),
+              ('yellow_word', '#EE8E1A', '#D9831A'),
+              ('change_yellow_start', '#FFB415', '#EBA613'),
+              ('change_yellow_end', '#FC9215', '#E58513'),
+              ('coffee', '#C27636', '#B87B49'),
+              ('change_coffee_start', '#D9A353', '#CC9466'),
+              ('change_coffee_end', '#C27636', '#AD7240'),
+              ('coffee_bg', '#FCF3E1', '#1FCC8F70'),
+              ('brown', '#8C6A28', '#CCA366'),
+              ('brown_bg', '#148C6A28', '#14BF9F73'),
+              ('bg_toast', '#A6000000', '#F5303232'),
+              ('green_line', '#9923C268', '#9921A65B')]
+    return sorted(colors, key=ascii, reverse=True)
+
+
+# 旧的颜色集
+def get_old_colors():
+    old_colors = [
+        ('colorPrimary', '#23c268'),
+        ('colorPrimaryDark', '#23c268'),
+        ('colorAccent', '#23c268'),
+        ('color_14ffa224', '#14ffa224'),
+        ('color_35ad64', '#35ad64'),
+        ('color_e0f6ea', '#E0F6EA'),
+        ('color_fbfafa', '#fbfafa'),
+        ('color_0aac3c', '#0aac3c'),
+        ('color_0aac3c_40', '#660aac3c'),
+        ('color_cfd1d0', '#cfd1d0'),
+        ('color_cfd1d0_80', '#cccfd1d0'),
+        ('color_cfd1d0_60', '#99cfd1d0'),
+        ('color_e0e2e3', '#e0e2e3'),
+        ('color_12a962', '#12a962'),
+        ('color_ff722b', '#ff722b'),
+        ('color_42cb7d', '#42CB7D'),
+        ('color_5bdc81', '#5bdc81'),
+        ('color_f57953', '#f57953'),
+        ('color_50ce86', '#50ce86'),
+        ('color_eefaf3', '#eefaf3'),
+        ('color_51dd7e', '#51dd7e'),
+        ('color_fff7e8', '#fff7e8'),
+        ('color_957137', '#957137'),
+        ('color_60441F', '#60441F'),
+        ('color_b3b3b3', '#b3b3b3'),
+        ('color_b2b2b2', '#b2b2b2'),
+        ('color_ccb2b2b2', '#99b2b2b2'),
+        ('color_5e74a1', '#5e74a1'),
+        ('color_f2f2f2', '#f2f2f2'),
+        ('color_a3e3bf', '#a3e3bf'),
+        ('color_green_40', '#6623c268'),
+        ('color_b4eacb', '#b4eacb'),
+        ('color_green_8', '#1223c268'),
+        ('color_green_10', '#1A23c268'),
+        ('color_green_80', '#CC23C268'),
+        ('color_d3f3e1', '#d3f3e1'),
+        ('color_131715', '#131715'),
+        ('color_36604f', '#36604F'),
+        ('color_131715_60', '#20131715'),
+        ('color_131715_90', '#dd131715'),
+        ('color_fff6f5f5', '#fff6f5f5'),
+        ('color_f2f3f5', '#f2f3f5'),
+        ('color_43de8a', '#43de8a'),
+        ('color_1Af16456', '#1Af16456'),
+        ('color_23C268_8', '#1423C268'),
+        ('color_99cfd1d0', '#99cfd1d0'),
+        ('color_4d23c268', '#4d23c268'),
+        ('color_23C268', '#23C268'),
+        ('color_ecf7ff', '#ECF7FF'),
+        ('color_fceffb', '#FCEFFB'),
+        ('color_23C268_08', '#1123C268'),
+        ('color_682f0f', '#682F0F'),
+        ('color_b19b90', '#B19B90'),
+        ('color_97e3b8', '#97e3b8'),
+        ('color_cccfd1d0', '#cccfd1d0'),
+        ('color_e2fdee', '#E2FDEE'),
+        ('color_cc131715', '#cc131715'),
+        ('color_a6000000', '#a6000000'),
+        ('color_434343', '#434343'),
+        ('color_a67b29', '#A67B29'),
+        ('color_f6d88', '#F6D488'),
+        ('color_fffbee', '#FFFBEE'),
+        ('dimgray', '#666666'),
+        ('whitesmoke', '#f8f8f8'),
+        ('empty_background', '#f6f6f6'),
+        ('sonw', '#eeeeee'),
+        ('blue', '#557db4'),
+        ('gainsboro', '#dcdcdc'),
+        ('admin', '#ffa000'),
+        ('collec', '#69c3fa'),
+        ('green', '#23c268'),
+        ('green_e0fce7', '#E0FCE7'),
+        ('rank_three', '#FFC117'),
+        ('rank_two', '#FF964D'),
+        ('color_f4f7f8', '#f4f7f8'),
+        ('color_e1e1e1', '#e1e1e1'),
+        ('color_46b450', '#23c268'),
+        ('color_caf8e0', '#caf8e0'),
+        ('color_8AC699', '#8AC699'),
+        ('color_f5', '#f5f5f5'),
+        ('color_e5', '#e5e5e5'),
+        ('color_db', '#dbdbdb'),
+        ('color_93e0b3', '#93e0b3'),
+        ('color_d4d4d4', '#d4d4d4'),
+        ('color_5c5c5c', '#5c5c5c'),
+        ('color_C0FFDB', '#C0FFDB'),
+        ('color_333333', '#333333'),
+        ('color_9923c268', '#9923c268'),
+        ('color_8c6a28', '#8c6a28'),
+        ('color_806A9F', '#806A9F'),
+        ('color_f2f0f5', '#f2f0f5'),
+        ('color_d9d9d9', '#d9d9d9'),
+        ('color_800aac3c', '#800aac3c'),
+        ('color_c27636', '#c27636'),
+        ('color_169757', '#169757'),
+        ('color_c27636_40', '#66c27636'),
+        ('color_99fcf3e1', '#99fcf3e1'),
+        ('color_7e4718', '#7e4718'),
+        ('color_3AD470', '#3AD470'),
+        ('font_black', '#3e403f'),
+        ('font_dimgray', '#7a7d7a'),
+        ('font_darkgray', '#a7a8a7'),
+        ('font_888888', '#888888'),
+        ('font_999', '#999999'),
+        ('font_aaaaaa', '#aaaaaa'),
+        ('font_cccccc', '#cccccc'),
+        ('font_fc9215', '#FC9215'),
+        ('font_555555', '#555555'),
+        ('font_ff6054', '#ff6054'),
+        ('font_ff5a54', '#ff5a54'),
+        ('font_fff5e8', '#FFF5E8'),
+        ('font_c27636', '#C27636'),
+        ('font_66c27636', '#66C27636'),
+        ('font_fff8ee', '#fff8ee'),
+        ('font_ff6455', '#ff6455'),
+        ('font_f6f5f5', '#f6f5f5'),
+        ('font_3e403f', '#3e403f'),
+        ('font_dark', '#a8a8a8'),
+        ('font_gainsboro', '#d0d0d0'),
+        ('font_red', '#ff5050'),
+        ('font_blue', '#557db4'),
+        ('font_white', '#ffffff'),
+        ('font_white_95', '#f2ffffff'),
+        ('font_white_85', '#d9ffffff'),
+        ('font_green', '#23c268'),
+        ('font_yellow', '#ffcc00'),
+        ('font_3a', '#3a3a3a'),
+        ('font_b0', '#b0b0b0'),
+        ('font_ab', '#ababab'),
+        ('font_828282', '#828282'),
+        ('font_ff9900', '#ff9900'),
+        ('font_f99D70', '#f99d70'),
+        ('font_fcf9f3', '#fcf9f3'),
+        ('font_e59304', '#e59304'),
+        ('font_fff0d9', '#fff0d9'),
+        ('font_d9dad9', '#d9dad9'),
+        ('font_e9f9f0', '#e9f9f0'),
+        ('font_e9e9e9', '#e9e9e9'),
+        ('font_a7a8a7', '#a7a8a7'),
+        ('font_ffa224', '#ffa224'),
+        ('font_ffb415', '#ffb415'),
+        ('color_f1eeee', '#f1eeee'),
+        ('line_dash_color', '#e5e5e5'),
+        ('font_color_ff131715', '#ff131715'),
+        ('menu_item_bg_pressed', '#f8f8f8'),
+        ('menu_item_bg_pressed_eb23c268', '#e9fbf1'),
+        ('menu_item_bg_pressed_e623c268', '#d0f6E1'),
+        ('bg_pressed', '#30000000'),
+        ('transparence', '#00000000'),
+        ('color_ffaf0f', '#ffaf0f'),
+        ('colorPrimary_8', '#1423c268'),
+        ('color_f9f9f9', '#f9f9f9'),
+        ('black_66', '#66000000'),
+        ('color_131715_75', '#bf131715'),
+        ('color_3323c268', '#3323c268'),
+        ('color_orange_80', '#CCffa224'),
+        ('divider', '#f8f8f8'),
+        ('divider_eee', '#eeeeee'),
+        ('divider_99eee', '#99eeeeee'),
+        ('divider_new', '#f8f8f8'),
+        ('type_color', '#a7a8a7'),
+        ('btn_download_orange', '#ffa224'),
+        ('btn_download_green', '#23c268'),
+        ('btn_download_gray', '#dddddd'),
+        ('btn_cloud_download', '#ffa224'),
+        ('bg_default_navigate', '#23c268'),
+        ('default_navigate_title', '#ffffff'),
+        ('bg_white_default_navigate', '#ffffff'),
+        ('default_navigate_black_title', '#3e403f'),
+        ('star_fill_color', '#23c268'),
+        ('star_bg_color', '#BDBDBD'),
+        ('star_fill_yellow_color', '#ffcc00'),
+        ('score_font_color', '#ffcc00'),
+        ('bg_game_recommend_guideview', '#99000000'),
+        ('white_99', '#99ffffff'),
+        ('black_10', '#10000000'),
+        ('black_20', '#20000000'),
+        ('black_26', '#26000000'),
+        ('black_90p', '#1A000000'),
+        ('black_95p', '#0c000000'),
+        ('black_70p', '#B3000000'),
+        ('black_bfp', '#bf000000'),
+        ('black_80p', '#cc000000'),
+        ('aeaeae_80', '#ccaeaeae'),
+        ('black_65p', '#A6000000'),
+        ('colorprimary_40', '#6632be64'),
+        ('colorprimary_10', '#1032be64'),
+        ('color_f0f0f0', '#f0f0f0'),
+        ('color_ffb916', '#ffb916'),
+        ('color_ffbb32', '#ffbb32'),
+        ('color_ffbd26', '#ffbd26'),
+        ('color_ff970f', '#ff970f'),
+        ('color_ffa609', '#ffa609'),
+        ('color_fffbf4', '#fffbf4'),
+        ('color_fffaf1', '#fffaf1'),
+        ('color_ffb49a', '#ffb49a'),
+        ('color_26e089', '#26E089'),
+        ('color_f16456', '#f16456'),
+        ('find_tab_qq_bg', '#41AAFA'),
+        ('find_tab_tool_bg', '#FFAA69'),
+        ('find_tab_auxiliary_bg', '#37D7BE'),
+        ('divider_line_eee', '#eeeeee'),
+        ('cloud_play_bt', '#ffa224'),
+        ('fast_play_bt', '#ffa224'),
+        ('color_42DC72', '#42DC72'),
+        ('color_28C36B', '#28C36B'),
+        ('color_ffa224', '#ffa224'),
+        ('color_009ac8', '#009ac8'),
+        ('color_00b9f0', '#00B9F0'),
+        ('color_d1ffe6', '#d1ffe6'),
+        ('color_7a7d7a', '#7A7D7A'),
+        ('color_ee8e1a', '#EE8E1A'),
+        ('notification_title', '#131715'),
+        ('notification_content', '#7A7D7A'),
+        ('color_8023c268', '#8023c268'),
+        ('color_ccd1ebdc', '#CCD1EBDC'),
+        ('color_f6f5f5', '#F6F5F5'),
+        ('color_f6f5f5_00', '#00F6F5F5'),
+        ('color_1fa7a8a7', '#1fa7a8a7'),
+        ('color_edfaf3', '#EDFAF3'),
+        ('color_b3cfd1d0', '#b3cfd1d0'),
+        ('red_dot_color', '#f16456'),
+        ('color_020202_50', '#88020202'),
+        ('divider_line', '#f7f6f6'),
+        ('color_adffe2', '#ADFFE2'),
+        ('color_e4fbbd', '#E4FBBD'),
+        ('bg_ad_text', '#f2f0f5'),
+        ('ad_text', '#806A9F'),
+        ('rank_renqi', '#62ce79'),
+        ('rank_biaosheng', '#50d8a0'),
+        ('rank_expect', '#39d6bd'),
+        ('rank_player', '#5bcaf4'),
+        ('rank_developer', '#69b9f5'),
+        ('rank_erciyuan', '#3ed1d6'),
+        ('rank_download', '#3acbe8'),
+        ('rank_scales', '#49cbe3'),
+        ('rank_online_play', '#3fd1e6'),
+        ('color_66f2f3f5', '#66f2f3f5'),
+        ('color_ffe3fffd', '#ffe3fffd'),
+        ('color_272727', '#272727'),
+        ('color_12cccccc', '#12cccccc'),
+        ('color_ffe5ffe1', '#ffe5ffe1'),
+        ('color_cccccc', '#cccccc'),
+        ('color_dbd9d9', '#dbd9d9'),
+        ('color_ffcf71', '#ffcf71'),
+        ('color_ff6a86', '#ff6a86'),
+        ('color_00b9ee', '#00b9ee'),
+        ('color_663ad470', '#663ad470'),
+        ('color_ff0000', '#ff0000'),
+        ('color_3399ff', '#3399ff'),
+        ('color_b3aeaeae', '#b3aeaeae'),
+        ('color_14cccccc', '#14cccccc'),
+        ('color_990aac3c', '#990aac3c'),
+        ('color_f7f8f9', '#f7f8f9'),
+        ('color_f18570', '#f18570'),
+        ('color_11cccccc', '#11cccccc'),
+        ('color_ffa000', '#ffa000'),
+        ('color_ffdd4b', '#ffdd4b'),
+        ('color_c9c9cd', '#c9c9cd'),
+        ('color_3308f36e', '#3308f36e'),
+        ('color_62d494', '#62d494'),
+        ('color_fff5d2', '#fff5d2'),
+        ('color_fff2f2', '#fff2f2'),
+        ('color_daf5e7', '#daf5e7'),
+        ('color_ffe973', '#ffe973'),
+        ('color_edfdea', '#edfdea'),
+        ('color_66ffffff', '#66ffffff'),
+        ('color_5523c268', '#5523c268'),
+        ('color_ff6054', '#ff6054'),
+        ('color_fffcf3e1', '#fffcf3e1'),
+        ('color_fff2f3f5', '#fff2f3f5'),
+        ('color_a8000000', '#a8000000'),
+        ('color_ffc346', '#ffc346'),
+        ('color_ee7e1a', '#ee7e1a'),
+        ('color_7e4f24', '#7e4f24'),
+        ('color_ffa709', '#ffa709'),
+        ('color_ff23c268', '#ff23c268'),
+        ('color_fd481f', '#fd481f'),
+        ('color_993e403f', '#993e403f'),
+        ('color_fdf8ed', '#fdf8ed'),
+        ('color_ffffe0b4', '#ffffe0b4'),
+        ('color_4d131715', '#4d131715'),
+        ('color_ffde93', '#ffde93'),
+        ('color_1aeeac2a', '#1aeeac2a'),
+        ('color_33c1b26a', '#33c1b26a'),
+        ('color_cbcbcb', '#cbcbcb'),
+        ('color_3e403f', '#3e403f'),
+        ('color_42dc72', '#42dc72'),
+        ('color_ff11ce33', '#ff11ce33'),
+        ('color_ffd231', '#ffd231'),
+        ('color_ff6200ee', '#ff6200ee'),
+        ('color_69000000', '#69000000'),
+        ('color_4d000000', '#4d000000'),
+        ('color_586898', '#586898'),
+        ('color_992b8346', '#992b8346'),
+        ('color_fdd366', '#fdd366'),
+        ('color_999a9a', '#999a9a'),
+        ('color_00f6f5f5', '#00f6f5f5'),
+        ('color_a7a8a7', '#a7a8a7'),
+        ('color_80333333', '#80333333'),
+        ('color_66ffb415', '#66ffb415'),
+        ('color_f8f8f8', '#f8f8f8'),
+        ('color_33a0a000', '#33a0a000'),
+        ('color_33eeac2a', '#33eeac2a'),
+        ('color_993ad470', '#993ad470'),
+        ('color_1f23c268', '#1f23c268'),
+        ('color_99000000', '#99000000'),
+        ('color_8ac699', '#8ac699'),
+        ('color_7f08d080', '#7f08d080'),
+        ('color_bdedd2', '#bdedd2'),
+        ('color_66000000', '#66000000'),
+        ('color_fff1e9', '#fff1e9'),
+        ('color_00131715', '#00131715'),
+        ('color_19bb6e', '#19bb6e'),
+        ('color_55f2f3f5', '#55f2f3f5'),
+        ('color_66cfd1d0', '#66cfd1d0'),
+        ('color_e5e5e5', '#e5e5e5'),
+        ('color_28c36b', '#28c36b'),
+        ('color_4d3e403f', '#4d3e403f'),
+        ('color_aaffffff', '#aaffffff'),
+        ('color_f6f6f6', '#f6f6f6'),
+        ('color_33effbf1', '#33effbf1'),
+        ('color_ffe0faeb', '#ffe0faeb'),
+        ('color_6632be64', '#6632be64'),
+        ('color_cb23c268', '#cb23c268'),
+        ('color_26000000', '#26000000'),
+        ('color_cc23c268', '#cc23c268'),
+        ('color_eeeeee', '#eeeeee'),
+        ('color_23c268', '#23c268'),
+        ('color_fffc9215', '#fffc9215'),
+        ('color_33ffffff', '#33ffffff'),
+        ('color_e6ffffff', '#e6ffffff'),
+        ('color_05b46a', '#05b46a'),
+        ('color_33f6f5f5', '#33f6f5f5'),
+        ('color_e4e4e4', '#e4e4e4'),
+        ('color_ff28c36b', '#ff28c36b'),
+        ('color_ffceaa', '#ffceaa'),
+        ('color_ff0aac3c', '#ff0aac3c'),
+        ('color_ff7a7d7a', '#ff7a7d7a'),
+        ('color_557db4', '#557db4'),
+        ('color_919193', '#919193'),
+        ('color_3a3a3a', '#3a3a3a'),
+        ('color_ffc7d9e3', '#ffc7d9e3'),
+        ('color_99f2f3f5', '#99f2f3f5'),
+        ('color_fff9ec', '#fff9ec'),
+        ('color_ff4938', '#ff4938'),
+        ('color_a39a9e', '#a39a9e'),
+        ('color_cc26e089', '#cc26e089'),
+        ('color_ccd9d9d9', '#ccd9d9d9'),
+        ('color_f3ffec', '#f3ffec'),
+        ('color_ffeeee', '#ffeeee'),
+        ('color_4dcfd1d0', '#4dcfd1d0'),
+        ('color_ffedc0', '#ffedc0'),
+        ('color_4d333333', '#4d333333'),
+        ('color_cc000000', '#cc000000'),
+        ('color_ffb3b3b3', '#ffb3b3b3'),
+        ('color_ff6455', '#ff6455'),
+        ('color_33000000', '#33000000'),
+        ('color_ffcfd1d0', '#ffcfd1d0'),
+        ('color_00333333', '#00333333'),
+        ('color_803ad470', '#803ad470'),
+        ('color_ff666666', '#ff666666'),
+        ('color_ffffff', '#ffffff'),
+        ('color_e6faf0', '#e6faf0'),
+        ('color_41aafa', '#41aafa'),
+        ('color_99ffffff', '#99ffffff'),
+        ('color_25bc73', '#25bc73'),
+        ('color_ffffc658', '#ffffc658'),
+        ('color_1affffff', '#1affffff'),
+        ('color_66d3f3e1', '#66d3f3e1'),
+        ('color_ccffffff', '#ccffffff'),
+        ('color_2223c268', '#2223c268'),
+        ('color_f6ff7e', '#f6ff7e'),
+        ('color_feeb9c', '#feeb9c'),
+        ('color_bf131715', '#bf131715'),
+        ('color_26ffffff', '#26ffffff'),
+        ('color_b832be64', '#b832be64'),
+        ('color_e7b15f', '#e7b15f'),
+        ('color_ffcccccc', '#ffcccccc'),
+        ('color_666666', '#666666'),
+        ('color_00000000', '#00000000'),
+        ('color_ccf9f9f9', '#ccf9f9f9'),
+        ('color_6623c268', '#6623c268'),
+        ('color_7affffff', '#7affffff'),
+        ('color_eefbf3', '#eefbf3'),
+        ('color_f3f3f3', '#f3f3f3'),
+        ('color_00ffffff', '#00ffffff'),
+        ('color_fff8ee', '#fff8ee'),
+        ('color_cdcaca', '#cdcaca'),
+        ('color_ffffb415', '#ffffb415'),
+        ('color_fffcf0ce', '#fffcf0ce'),
+        ('color_a06229', '#a06229'),
+        ('color_40ececec', '#40ececec'),
+        ('color_a2a3a3', '#a2a3a3'),
+        ('color_80ffa224', '#80ffa224'),
+        ('color_823c14', '#823c14'),
+        ('color_c7f4dc', '#c7f4dc'),
+        ('color_0023c268', '#0023c268'),
+        ('color_663e403f', '#663e403f'),
+        ('color_7fffffff', '#7fffffff'),
+        ('color_e9f9f0', '#e9f9f0'),
+        ('color_1423c368', '#1423c368'),
+        ('color_29131715', '#29131715'),
+        ('color_00ffcc', '#00ffcc'),
+        ('color_ff000000', '#ff000000'),
+        ('color_effbf4', '#effbf4'),
+        ('color_c08f3c', '#c08f3c'),
+        ('color_ff333333', '#ff333333'),
+        ('color_5178bc', '#5178bc'),
+        ('color_f231af67', '#f231af67'),
+        ('color_80cfd1d0', '#80cfd1d0'),
+        ('color_1423c268', '#1423c268'),
+        ('color_d6726813', '#d6726813'),
+        ('color_afb1af', '#afb1af'),
+        ('color_00f2f3f5', '#00f2f3f5'),
+        ('color_88000000', '#88000000'),
+        ('color_bb9c99', '#bb9c99'),
+        ('color_ff26e089', '#ff26e089'),
+        ('color_ff5a54', '#ff5a54'),
+        ('color_7bdaa4', '#7bdaa4'),
+        ('color_9928c36b', '#9928c36b'),
+        ('color_8c580d', '#8c580d'),
+        ('color_123456', '#123456'),
+        ('color_1fffffff', '#1fffffff'),
+        ('color_fff1f1', '#fff1f1'),
+        ('color_fffbfafa', '#fffbfafa'),
+        ('color_8007d885', '#8007d885'),
+        ('color_b3000000', '#b3000000'),
+        ('color_ffa7a8a7', '#ffa7a8a7'),
+        ('color_b3222222', '#b3222222'),
+        ('color_f7131715', '#f7131715'),
+        ('color_fafafa', '#fafafa'),
+        ('color_fcf3e1', '#fcf3e1'),
+        ('color_2623c268', '#2623c268'),
+        ('color_f2ffffff', '#f2ffffff'),
+        ('color_f5e0e2', '#f5e0e2'),
+        ('color_bdedd1', '#bdedd1'),
+        ('color_ff3e403f', '#ff3e403f'),
+        ('color_f53e403f', '#f53e403f'),
+        ('color_efa200', '#efa200'),
+        ('color_00b7ee', '#00b7ee'),
+        ('color_9908d080', '#9908d080'),
+        ('color_00d9d9d9', '#00d9d9d9'),
+        ('color_ffdad6', '#ffdad6'),
+        ('color_077c7c75', '#077c7c75'),
+        ('color_000000', '#000000'),
+        ('color_99eeeeee', '#99eeeeee'),
+        ('color_f3f8ce', '#f3f8ce'),
+        ('color_f5f5f5', '#f5f5f5'),
+        ('color_54da8e', '#54da8e'),
+        ('color_3be886', '#3be886'),
+        ('color_141c30', '#141c30'),
+        ('color_09cccccc', '#09cccccc'),
+        ('color_3ad470', '#3ad470'),
+        ('color_ffedfaf3', '#ffedfaf3'),
+        ('color_999999', '#999999'),
+        ('color_80ffffff', '#80ffffff'),
+        ('color_fc9215', '#fc9215'),
+        ('color_40d870', '#40d870'),
+        ('color_cb3e403f', '#cb3e403f'),
+        ('color_1e000000', '#1e000000'),
+        ('color_1a23c268', '#1a23c268'),
+        ('color_946464', '#946464'),
+        ('color_cca7a8a7', '#cca7a8a7'),
+        ('color_b3ffffff', '#b3ffffff'),
+        ('color_cecece', '#cecece'),
+        ('color_75000000', '#75000000'),
+        ('color_60ff0000', '#60ff0000'),
+        ('color_32be64', '#32be64'),
+        ('color_dddddd', '#dddddd'),
+        ('color_66131715', '#66131715'),
+        ('color_e9e9e9', '#e9e9e9'),
+        ('color_20000000', '#20000000'),
+        ('color_f58909', '#f58909'),
+        ('color_1a000000', '#1a000000'),
+        ('color_fafbfb', '#fafbfb'),
+        ('color_fff7e7', '#fff7e7'),
+        ('color_8b8c8c', '#8b8c8c'),
+        ('color_40000000', '#40000000'),
+        ('color_14000000', '#14000000'),
+        ('color_ff3ad470', '#ff3ad470'),
+        ('color_a3000000', '#a3000000'),
+        ('color_6642dc72', '#6642dc72'),
+        ('color_0036d67c', '#0036d67c'),
+        ('color_66fc9215', '#66fc9215'),
+        ('color_3d000000', '#3d000000'),
+        ('color_ffb644', '#ffb644'),
+        ('color_e4e5e4', '#e4e5e4'),
+        ('color_a0000000', '#a0000000'),
+        ('color_f98a00', '#f98a00'),
+        ('color_d9cab9', '#d9cab9'),
+        ('color_07cccccc', '#07cccccc'),
+        ('color_6628c36b', '#6628c36b'),
+        ('color_f5fefc', '#f5fefc'),
+        ('color_ffffffff', '#ffffffff'),
+        ('color_ff999999', '#ff999999'),
+        ('color_44000000', '#44000000'),
+        ('color_fff8f8f8', '#fff8f8f8'),
+        ('color_b3434343', '#b3434343'),
+        ('color_59000000', '#59000000'),
+        ('color_d0d0d0', '#d0d0d0'),
+        ('color_26ececec', '#26ececec'),
+        ('color_efeff3', '#efeff3'),
+        ('color_cf844f', '#cf844f'),
+        ('color_bf000000', '#bf000000'),
+        ('color_d6fff1', '#d6fff1'),
+        ('color_30000000', '#30000000'),
+        ('color_00eeac2a', '#00eeac2a'),
+        ('color_b30aac3c', '#b30aac3c'),
+        ('color_ff36d67c', '#ff36d67c'),
+        ('color_8028c36b', '#8028c36b'),
+        ('color_fff0c9', '#fff0c9'),
+        ('color_80000000', '#80000000'),
+        ('color_ed816e', '#ed816e'),
+        ('color_cbedd8', '#cbedd8'),
+        ('color_ff08d080', '#ff08d080'),
+        ('color_cbffa224', '#cbffa224'),
+        ('color_ffb415', '#ffb415'),
+        ('color_7bdbea', '#7bdbea'),
+        ('color_e6000000', '#e6000000'),
+        ('color_d3f5e3', '#d3f5e3'),
+        ('color_eaeaea', '#eaeaea'),
+        ('color_e8e8e8', '#e8e8e8'),
+        ('color_bae5fd', '#bae5fd')]
+    return sorted(old_colors, key=ascii, reverse=True)
+
+
+# 旧的颜色集
+def get_old_dimens():
+    dimens = [
+        ('activity_horizontal_margin', '16dp'),
+        ('gamedetail_top_line', '12dp'),
+        ('gamedetail_bottom_line', '6dp'),
+        ('home_index_navigate_height', '44dp'),
+        ('toolbar_height', '45dp'),
+        ('slidingtablayout_height', '40dp'),
+        ('default_padding', '12dp'),
+        ('drawable_padding', '4dp'),
+        ('user_info_paddingtop', '6dp'),
+        ('user_info_paddingbottom', '6dp'),
+        ('leftmargin', '12dp'),
+        ('rightmargin', '12dp'),
+        ('divider_05', '0.5dp'),
+        ('divider_8', '8dp'),
+        ('tool_icon_heigth', '36dp'),
+        ('qq_game_icon_width', '68dp'),
+        ('rank_list_icon_width', '70dp'),
+        ('rank_list_circle_width', '20dp'),
+        ('home_index_userinfo_avatar_width', '20dp'),
+        ('mine_avatar_width_bg', '68dp'),
+        ('mine_avatar_width', '66dp'),
+        ('navigate_return_padding_right', '24dp'),
+        ('navigate_title_size', '17sp'),
+        ('news_title_size', '16dp'),
+        ('news_time_size', '10sp'),
+        ('news_padding_top', '16dp'),
+        ('video_title_size', '16dp'),
+        ('video_time_size', '10sp'),
+        ('video_padding_top', '16dp'),
+        ('gamedetail_itemright_top', '2.5dp'),
+        ('strategy_all_game_size', '12sp'),
+        ('strategy_all_game_icon_corner', '3dp'),
+        ('qq_group_padding_top', '12dp'),
+        ('rank_list_padding_top', '16dp'),
+        ('emoji_icon_width', '30dp'),
+        ('type_size', '12sp'),
+        ('type_padding_right', '8dp'),
+        ('type_padding_bottom', '5dp'),
+        ('gamedetail_icon_width', '90dp'),
+        ('gamedetail_detail_game_icon_width', '68dp'),
+        ('gamedetail_downloadbtn_height', '40dp'),
+        ('gamedetail_downloadbtn_height1', '36dp'),
+        ('gamedetail_downloadbtn_height2', '38dp'),
+        ('red_point_width', '6dp'),
+        ('red_point_width_half', '3dp'),
+        ('gamelist_game_icon_width', '68dp'),
+        ('search_edit_height', '32dp'),
+        ('search_edit_height_half', '16dp'),
+        ('playerview_height', '200dp'),
+        ('default_downloadbtn_height', '28dp'),
+        ('default_downloadbtn_width', '60dp'),
+        ('default_downloadbtn_height_half', '12dp'),
+        ('linepaddingbutton', '0dp'),
+        ('paddingbutton', '0dp'),
+        ('categorypadding', '10dp'),
+        ('login_btn_height', '44dp'),
+        ('login_btn_height_half', '22dp'),
+        ('btn_height', '44dp'),
+        ('tv_hot_tag_height', '28dp'),
+        ('wonder_face_gv_padding', '6dp'),
+        ('wonder_face_gv_horizontal_space', '4dp'),
+        ('wonder_face_gv_vertical_space', '4dp'),
+        ('wonder_face_page_point_width', '8dp'),
+        ('wonder_face_page_point_width_half', '4dp'),
+        ('wonder_face_page_rg_height', '20dp'),
+        ('spacingExtra8', '0dp'),
+        ('spacingExtra6', '0dp'),
+        ('hykb_game_detail_score_card_size', '82dp'),
+        ('hykb_dimens_size_0dp', '0dp'),
+        ('hykb_dimens_size_05dp', '0.5dp'),
+        ('hykb_dimens_size_1dp', '1dp'),
+        ('hykb_dimens_size_2dp', '2dp'),
+        ('hykb_dimens_size_2_5dp', '2.5dp'),
+        ('hykb_dimens_size_3dp', '3dp'),
+        ('hykb_dimens_size_3_5dp', '3.5dp'),
+        ('hykb_dimens_size_4dp', '4dp'),
+        ('hykb_dimens_size_4_5dp', '4.5dp'),
+        ('hykb_dimens_size_5dp', '5dp'),
+        ('hykb_dimens_size_6dp', '6dp'),
+        ('hykb_dimens_size_7dp', '7dp'),
+        ('hykb_dimens_size_8dp', '8dp'),
+        ('hykb_dimens_size_9dp', '9dp'),
+        ('hykb_dimens_size_10dp', '10dp'),
+        ('hykb_dimens_size_11dp', '11dp'),
+        ('hykb_dimens_size_12dp', '12dp'),
+        ('hykb_dimens_size_12_point5_dp', '12.5dp'),
+        ('hykb_dimens_size_13dp', '13dp'),
+        ('hykb_dimens_size_13dp_point5', '13.5dp'),
+        ('hykb_dimens_size_14dp', '14dp'),
+        ('hykb_dimens_size_14dp_point5', '14.5dp'),
+        ('hykb_dimens_size_15dp', '15dp'),
+        ('hykb_dimens_size_16dp', '16dp'),
+        ('hykb_dimens_size_16_point5_dp', '16.5dp'),
+        ('hykb_dimens_size_17dp', '17dp'),
+        ('hykb_dimens_size_17_point5_dp', '17.5dp'),
+        ('hykb_dimens_size_18dp', '18dp'),
+        ('hykb_dimens_size_19dp', '19dp'),
+        ('hykb_dimens_size_20dp', '20dp'),
+        ('hykb_dimens_size_21dp', '21dp'),
+        ('hykb_dimens_size_22dp', '22dp'),
+        ('hykb_dimens_size_23dp', '23dp'),
+        ('hykb_dimens_size_24dp', '24dp'),
+        ('hykb_dimens_size_25dp', '25dp'),
+        ('hykb_dimens_size_26dp', '26dp'),
+        ('hykb_dimens_size_27dp', '27dp'),
+        ('hykb_dimens_size_28dp', '28dp'),
+        ('hykb_dimens_size_29dp', '29dp'),
+        ('hykb_dimens_size_30dp', '30dp'),
+        ('hykb_dimens_size_31dp', '31dp'),
+        ('hykb_dimens_size_33dp', '33dp'),
+        ('hykb_dimens_size_32dp', '32dp'),
+        ('hykb_dimens_size_34dp', '34dp'),
+        ('hykb_dimens_size_35dp', '35dp'),
+        ('hykb_dimens_size_36dp', '36dp'),
+        ('hykb_dimens_size_38dp', '38dp'),
+        ('hykb_dimens_size_39dp', '39dp'),
+        ('hykb_dimens_size_40dp', '40dp'),
+        ('hykb_dimens_size_42dp', '42dp'),
+        ('hykb_dimens_size_44dp', '44dp'),
+        ('hykb_dimens_size_45dp', '45dp'),
+        ('hykb_dimens_size_46dp', '46dp'),
+        ('hykb_dimens_size_48dp', '48dp'),
+        ('hykb_dimens_size_50dp', '50dp'),
+        ('hykb_dimens_size_52dp', '52dp'),
+        ('hykb_dimens_size_53dp', '53dp'),
+        ('hykb_dimens_size_54dp', '54dp'),
+        ('hykb_dimens_size_55dp', '55dp'),
+        ('hykb_dimens_size_56dp', '56dp'),
+        ('hykb_dimens_size_58dp', '58dp'),
+        ('hykb_dimens_size_60dp', '60dp'),
+        ('hykb_dimens_size_62dp', '62dp'),
+        ('hykb_dimens_size_64dp', '64dp'),
+        ('hykb_dimens_size_65dp', '65dp'),
+        ('hykb_dimens_size_66dp', '66dp'),
+        ('hykb_dimens_size_68dp', '68dp'),
+        ('hykb_dimens_size_70dp', '70dp'),
+        ('hykb_dimens_size_72dp', '72dp'),
+        ('hykb_dimens_size_74dp', '74dp'),
+        ('hykb_dimens_size_75dp', '75dp'),
+        ('hykb_dimens_size_78dp', '78dp'),
+        ('hykb_dimens_size_80dp', '80dp'),
+        ('hykb_dimens_size_82dp', '82dp'),
+        ('hykb_dimens_size_84dp', '84dp'),
+        ('hykb_dimens_size_88dp', '88dp'),
+        ('hykb_dimens_size_89dp', '89dp'),
+        ('hykb_dimens_size_90dp', '90dp'),
+        ('hykb_dimens_size_92dp', '92dp'),
+        ('hykb_dimens_size_95dp', '95dp'),
+        ('hykb_dimens_size_98dp', '98dp'),
+        ('hykb_dimens_size_110dp', '110dp'),
+        ('hykb_dimens_size_120dp', '120dp'),
+        ('hykb_dimens_size_122dp', '122dp'),
+        ('hykb_dimens_size_130dp', '130dp'),
+        ('hykb_dimens_size_134dp', '134dp'),
+        ('hykb_dimens_size_140dp', '140dp'),
+        ('hykb_dimens_size_144dp', '144dp'),
+        ('hykb_dimens_size_150dp', '150dp'),
+        ('hykb_dimens_size_158dp', '158dp'),
+        ('hykb_dimens_size_160dp', '160dp'),
+        ('hykb_dimens_size_165dp', '165dp'),
+        ('hykb_dimens_size_170dp', '170dp'),
+        ('hykb_dimens_size_178dp', '178dp'),
+        ('hykb_dimens_size_180dp', '180dp'),
+        ('hykb_dimens_size_184dp', '184dp'),
+        ('hykb_dimens_size_192dp', '192dp'),
+        ('hykb_dimens_size_100dp', '100dp'),
+        ('hykb_dimens_size_104dp', '104dp'),
+        ('hykb_dimens_size_106dp', '106dp'),
+        ('hykb_dimens_size_112dp', '112dp'),
+        ('hykb_dimens_size_200dp', '200dp'),
+        ('hykb_dimens_size_220dp', '220dp'),
+        ('hykb_dimens_size_208dp', '208dp'),
+        ('hykb_dimens_size_240dp', '240dp'),
+        ('hykb_dimens_size_260dp', '260dp'),
+        ('hykb_dimens_size_300dp', '300dp'),
+        ('hykb_dimens_size_304dp', '304dp'),
+        ('guess_u_like_tip_dp', '2250dp'),
+        ('hykb_dimens_size_253dp', '253dp'),
+        ('hykb_dimens_font_8sp', '8sp'),
+        ('hykb_dimens_font_9sp', '9sp'),
+        ('hykb_dimens_font_10sp', '10sp'),
+        ('hykb_dimens_font_11sp', '11sp'),
+        ('hykb_dimens_font_12sp', '12sp'),
+        ('hykb_dimens_font_13sp', '13sp'),
+        ('hykb_dimens_font_14sp', '14sp'),
+        ('hykb_dimens_font_15sp', '15sp'),
+        ('hykb_dimens_font_16sp', '16sp'),
+        ('hykb_dimens_font_20sp', '20sp'),
+        ('hykb_dimens_font_24sp', '24sp'),
+        ('hykb_dimens_font_34sp', '34sp'),
+        ('hykb_dimens_font_17sp', '17sp'),
+        ('hykb_dimens_font_18sp', '18sp'),
+        ('hykb_dimens_font_19sp', '19sp'),
+        ('hykb_dimens_font_28sp', '28sp'),
+        ('hykb_dimens_gamedetail_kbdj', '10sp'),
+        ('gamedetail_margin_left', '16dp'),
+        ('gamedetail_margin_right', '16dp'),
+        ('homeindex_margin_left', '16dp'),
+        ('homeindex_margin_right', '16dp'),
+        ('homeindex_four_nav_icon_width', '46dp'),
+        ('homeindex_item_corners', '5dp'),
+        ('homeindex_item_newgame_game_icon_width', '74dp'),
+        ('homeindex_item_newgame_game_icon_height', '54dp'),
+        ('homeindex_item_game_icon_width', '40dp'),
+        ('homeindex_item_game_date_bg_height', '20dp'),
+        ('homeindex_item_game_date_bg_height_half', '10dp'),
+        ('homeindex_item_huanyihuan_bg_height', '28dp'),
+        ('homeindex_item_huanyihuan_bg_height_half', '14dp'),
+        ('homeindex_item_good_game_recommend_game_icon_width', '72dp'),
+        ('vote_item_radius', '4dp'),
+        ('homeindex_hot_game_update_pic_width', '304dp'),
+        ('homeindex_hot_game_update_pic_height', '171dp'),
+        ('homeindex_item_jingxuan_heji_item_icon_width', '155dp'),
+        ('score_font_size', '12sp'),
+        ('forum_detail_header_game_icon_width', '80dp'),
+        ('moderator_list_user_icon_width', '43dp'),
+        ('item_person_center_bbs_avatar_width', '36dp'),
+        ('gamedetail_video_pic_w', '152dp'),
+        ('gamedetail_video_pic_h', '87dp'),
+        ('homeindex_message_banner', '36dp'),
+        ('dialog_cornor', '8dp'),
+        ('homeindex_message_close_w', '42dp'),
+        ('design_snackbar_padding_horizontal" tools:override="true', '20dp'),
+        ('design_snackbar_padding_vertical" tools:override="true', '12dp'),
+        ('post_detail_item_top', '6dp'),
+        ('post_detail_item_bottom', '6dp'),
+        ('post_detail_item_bottom_12dp', '12dp'),
+        ('post_detail_title_height', '48dp'),
+        ('item_search_hot_game_height', '36dp'),
+        ('item_search_hot_game_padding', '9dp'),
+        ('default_status_align_topmargin', '90dp'),
+        ('personal_game_fragment_align_topmargin', '77dp'),
+        ('post_detail_reply_praise_height_view', '14dp'),
+        ('update_dialog_content_max_height', '205dp'),
+        ('main_search_margin_left_right', '16dp'),
+        ('hotspot_overlay_bottom', '8dp'),
+        ('expand_delete_w_h', '12dp')
+    ]
+    return sorted(dimens, key=ascii, reverse=True)

+ 147 - 0
utils/include_utils.py

@@ -0,0 +1,147 @@
+#!/usr/bin/python
+# -*- coding: UTF-8 -*-
+import re
+
+
+def auto_parse_include(text, suffix, callback=None):
+    # 遍历所有的 '@include' 标签
+    xml = suffix == ".xml"
+    java = suffix == ".java"
+
+    if xml:
+        frgment_new_instance_matches = re.findall(r'<include[\s\S]*?/>', text)
+        # print(f"发现include标签:{matches}")
+        # 如果存在 '@include' 标签,取出标签中的 layout
+        if frgment_new_instance_matches:
+            for match in frgment_new_instance_matches:
+                layout = re.search(r'layout=\"@layout/([^\"]+)\"', match).group(1)
+                if layout and callback:
+                    callback(f"{layout}.xml")
+                # print(f"解析到include标签:{layout}.xml")
+
+        # 遍历所有的viewStub
+        frgment_new_instance_matches = re.findall(r'<ViewStub[\s\S]*?/>', text)
+        if frgment_new_instance_matches:
+            for match in frgment_new_instance_matches:
+                view_stub = re.search(r'layout=\"@layout/([^\"]+)\"', match).group(1)
+                print(f"解析到ViewStub:{view_stub}")
+                if view_stub and callback:
+                    callback(f"{view_stub}.xml")
+
+        # 遍历所有的background
+        drawable_background = re.findall(r'android:background=\"@drawable/([^\"]+)\"', text)
+        if drawable_background:
+            for match in drawable_background:
+                print(f"解析到background:{match}")
+                if match and callback:
+                    callback(f"{match}.xml")
+
+        # 遍历所有的src
+        drawable_src = re.findall(r'android:src=\"@drawable/([^\"]+)\"', text)
+        if drawable_src:
+            for match in drawable_src:
+                print(f"解析到src:{match}")
+                if match and callback:
+                    callback(f"{match}.xml")
+
+    if java:
+        # 遍历所有的 'R.layout.xxxxxxx' 代码
+        frgment_new_instance_matches = re.findall(r'R\.layout\.\w*\b', text)
+        if frgment_new_instance_matches:
+            for match in frgment_new_instance_matches:
+                layout = re.search(r'R\.layout\.(\w*)\b', match).group(1)
+                if layout and callback:
+                    callback(f"{layout}.xml")
+
+        # 遍历所有的viewBinding
+        # inflate 或者 bind匹配
+        bind_inflate_matches = re.findall(r'(\w+Binding)\.(?:bind|inflate)+', text)
+        if bind_inflate_matches:
+            for match in bind_inflate_matches:
+                v1 = re.search(r'(\w+)Binding', match).group(1)
+                print(f"解析到viewBinding:{v1} bind或者inflate")
+                # 将v2的驼峰改为下划线命名,首字母小写
+                v1 = re.sub(r'(?<!^)([A-Z])', r'_\1', v1).lower()
+                if v1 and callback:
+                    callback(f"{v1}.xml")
+
+        # 泛型匹配
+        generics_matches = re.findall(r'<(\w+)Binding+,\s*(\w+)?Binding?>', text)
+        if generics_matches:
+            for match in generics_matches:
+                for v2 in match:
+                    if v2:
+                        print(f"解析到viewBinding:{v2} 泛型匹配")
+                        # 将v2的驼峰改为下划线命名,首字母小写
+                        v2 = re.sub(r'(?<!^)([A-Z])', r'_\1', v2).lower()
+                        if v2 and callback:
+                            callback(f"{v2}.xml")
+
+        # 遍历所有的fragment
+        # 取出 public class StrategyFragment extends的类名
+        class_name = re.findall(r'\s+class\s+(\w+Fragment\d?)\s+', text)
+        class_name = class_name[0] if class_name else None
+
+        # 匹配*Fragment.newInstance
+        frgment_new_instance_matches = re.findall(r'\b(\w+Fragment\d?)\.newI', text)
+        if frgment_new_instance_matches:
+            for fragment in frgment_new_instance_matches:
+                print(f"解析到fragment newInstance:{fragment}")
+                if fragment and callback:
+                    callback(f'{fragment}.java')
+
+        # 匹配new *Fragment()
+        new_fragment_matches = re.findall(r'\bnew\s+(\w+Fragment\d?)\(', text)
+        if new_fragment_matches:
+            for new_fragment in new_fragment_matches:
+                # 不匹配new 自己的class
+                no_new_self = not (new_fragment == class_name)
+                if new_fragment and no_new_self and callback:
+                    print(f"解析到fragment new:{new_fragment}")
+                    callback(f'{new_fragment}.java')
+
+        # 遍历所有的adapter
+        # 取出 public class StrategyFragment extends的类名
+        class_name = re.findall(r'\s+class\s+(\w+Adapter\d?)\s+', text)
+        class_name = class_name[0] if class_name else None
+
+        # 匹配*Adapter.newInstance
+        adapter_new_instance_matches = re.findall(r'\b(\w+Adapter\d?)\.newI', text)
+        if adapter_new_instance_matches:
+            for adapter in adapter_new_instance_matches:
+                print(f"解析到adapter newInstance:{adapter}")
+                if adapter and callback:
+                    callback(f'{adapter}.java')
+
+        # 匹配new *Adapter()
+        new_adapter_matches = re.findall(r'\bnew\s+(\w+Adapter\d?)\(', text)
+        if new_adapter_matches:
+            for new_adapter in new_adapter_matches:
+                # 不匹配new 自己的class
+                no_new_self = not (new_adapter == class_name)
+                if new_adapter and no_new_self and callback:
+                    print(f"解析到adapter new:{new_adapter}")
+                    callback(f'{new_adapter}.java')
+
+        # 遍历所有的delegate
+        # 取出 public class StrategyFragment extends的类名
+        class_name = re.findall(r'\s+class\s+(\w+Delegate\d?)\s+', text)
+        class_name = class_name[0] if class_name else None
+
+        # 匹配*Delegate.newInstance
+        delegate_new_instance_matches = re.findall(r'\b(\w+Delegate\d?)\.newI', text)
+        if delegate_new_instance_matches:
+            for delegate in delegate_new_instance_matches:
+                print(f"解析到delegate newInstance:{delegate}")
+                if delegate and callback:
+                    callback(f'{delegate}.java')
+
+        # 匹配new *Delegate()
+        new_delegate_matches = re.findall(r'\bnew\s+(\w+Delegate\d?)\(', text)
+        if new_delegate_matches:
+            for new_delegate in new_delegate_matches:
+                # 不匹配new 自己的class
+                no_new_self = not (new_delegate == class_name)
+                if new_delegate and no_new_self and callback:
+                    print(f"解析到delegate new:{new_delegate}")
+                    callback(f'{new_delegate}.java')

+ 18 - 0
utils/module_utils.py

@@ -0,0 +1,18 @@
+#!/usr/bin/python
+# -*- coding: UTF-8 -*-
+import re
+
+
+# 提取项目中有哪些模块
+def get_modules_from_settings_file(project_path):
+    settings_path = project_path + "/settings.gradle"
+    print(f"开始解析:{settings_path}")
+    with open(settings_path, 'r', encoding='utf-8') as file:
+        content = file.read()
+
+    pattern = r"include\s*\(?'\s*:(.*?)'\)?"
+    modules = re.findall(pattern, content)
+    print(f"解析完成,项目包含: {len(modules)} 个模块:{modules}")
+    modules.remove('common')
+    print("忽略模块common")
+    return modules

+ 428 - 0
utils/other_utils.py

@@ -0,0 +1,428 @@
+#!/usr/bin/python
+# -*- coding: UTF-8 -*-
+import os
+import re
+from pathlib import Path
+
+from utils.color_set import get_new_colors, get_old_colors, get_old_dimens
+
+
+# 需要忽略的文件
+def get_excluded_files():
+    return {'colors.xml', 'colors_alpha.xml', 'strings.xml',
+            'TimeSpendDetailFragment.kt', 'TimeSpendDetailDialog.kt', 'PostTypeHelper.java',
+            'ProduceDataRecycleViewScrollBar.java', 'DefaultTitleDialog.java', 'GlideUtils.java'}
+
+
+# 需要忽略的文件夹
+def get_excluded_dirs():
+    return ['.git', '.svn', 'build', '.gradle', '.idea', 'test', 'androidTest']
+
+
+# 需要处理的文件后缀
+def get_included_suffix():
+    return ['.xml', '.java', '.kt']
+
+
+# 统一路径分隔符
+def unify_path_separator(path: str):
+    path = path.replace("\\", os.path.sep)
+    path = path.replace("/", os.path.sep)
+    return path
+
+
+def update_colors_resource_file(colors_xml_path: str, color_codes):
+    with open(colors_xml_path, 'r', encoding='utf-8') as f:
+        text = f.read()
+
+    new_colors = set()
+    for color_code in color_codes:
+        color_name = get_color_name(color_code)
+
+        if color_name.lower() not in text and color_name.upper() not in text:
+            new_colors.add(f'    <color name="{color_name}">{color_code.lower()}</color>')
+
+    if new_colors:
+        new_contents = text.replace('</resources>', '\n'.join(new_colors) + '\n</resources>')
+
+        with open(colors_xml_path, 'w', encoding='utf-8') as f:
+            f.write(new_contents)
+
+
+# 提取指定文件中的颜色值
+def extract_color_codes_from_file(file_path: str):
+    with open(file_path, 'r', encoding='utf-8') as f:
+        text = f.read()
+    color_codes = set(re.findall(r'#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6})', text))
+    return color_codes
+
+
+# 根据颜色值获取颜色名称
+def get_color_name(color_code):
+    name = f'color_{color_code.lower()}'
+    name = name.replace("#", "")
+    return name.lower()
+
+
+# 根据颜色值获取颜色名称
+def get_file_suffix(file_path: str):
+    if not os.path.isfile(file_path):
+        print(f"{file_path} 不是一个文件")
+        return ""
+    return Path(file_path).suffix
+
+
+# 提取指定文件中的颜色值
+def extract_codes_colors(text, suffix):
+    # 提取所有颜色
+    color_codes = set(re.findall(r'#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6})', text))
+    if color_codes:
+        # print(f"提取的颜色:{color_codes}")
+        if suffix == ".java" or suffix == ".kt":
+            # pattern = r'Color.parseColor(#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6})'  # 匹配模式
+            pattern = r"(Color\.parseColor\s*\(\s*\"#[0-9A-Fa-f]+\s*\"\s*\))"  # 匹配模式
+            matches = re.findall(pattern, text)
+            if matches:
+                for match in matches:
+                    color_code = re.search(r'"#([0-9A-Fa-f]+)"', match).group(1)
+                    color_name = get_color_name(color_code)
+                    replacement = "ResUtils.getColor(R.color.{})".format(color_name)  # 替换的文本
+                    text = text.replace(match, replacement)  # 替换
+                if suffix == ".java":
+                    if "import com.xmcy.hykb.utils.ResUtils;" not in text:
+                        text = text.replace("import android.graphics.Color;",
+                                            "import android.graphics.Color;\nimport com.xmcy.hykb.utils.ResUtils;")
+                if suffix == ".kt":
+                    if "import com.xmcy.hykb.utils.ResUtils" not in text:
+                        text = text.replace("import android.graphics.Color",
+                                            "import android.graphics.Color\nimport com.xmcy.hykb.utils.ResUtils")
+        elif suffix == ".xml":
+            pattern = r'#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6})'  # 匹配模式
+            result = re.findall(pattern, text)
+            if result:
+                for color_code in result:
+                    color_name = get_color_name(color_code)
+                    replacement = r'@color/{}'.format(color_name)  # 替换的文本
+                    text = text.replace(color_code, replacement)  # 替换
+    return text
+
+
+# 修改主题
+def update_base_class(text):
+    pattern = r'#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6})'  # 匹配模式
+    result = re.findall(pattern, text)
+    if result:
+        for color_code in result:
+            color_name = get_color_name(color_code)
+            replacement = r'@color/{}'.format(color_name)  # 替换的文本
+            text = text.replace(color_code, replacement)  # 替换
+    return text
+
+
+# 修改过时方法
+def update_deprecated(text):
+    text = text.replace("DensityUtils.dp2px(mContext,", "DensityUtils.dp2px(")
+    text = text.replace("DensityUtils.dp2px(mActivity,", "DensityUtils.dp2px(")
+    text = text.replace("DensityUtils.dp2px(context,", "DensityUtils.dp2px(")
+    text = text.replace("DensityUtils.dp2px(activity,", "DensityUtils.dp2px(")
+    text = text.replace("DensityUtils.dp2px(getActivity(),", "DensityUtils.dp2px(")
+    text = text.replace("DensityUtils.dp2px(HYKBApplication.getContext(), ", "DensityUtils.dp2px(")
+    text = text.replace("DensityUtils.dp2px(getContext(),", "DensityUtils.dp2px(")
+    # text = text.replace("setBackgroundDrawable", "setBackground")
+    text = text.replace("setBackground(context.getResources().getDrawable(R.", "setBackgroundResource((R.")
+
+    text = text.replace(r'\(\(R\.drawable\.[^\)]+\)\)', r'\(R\.drawable\.[^\)]+\)')
+    return text
+
+
+# 修改主题
+def update_themes(text):
+    text = text.replace("\"android:style/Theme.Dialog\"", "\"@style/Theme.Material3.DayNight.Dialog\"")
+    text = text.replace("\"@android:style/Theme.Dialog\"", "\"@style/Theme.Material3.DayNight.Dialog\"")
+    text = text.replace("\"@android:style/Theme.Holo.Dialog\"", "\"@style/Theme.Material3.DayNight.Dialog\"")
+
+    text = text.replace("ThemeOverlay.AppCompat.Light", "Theme.Material3.DayNight")
+    text = text.replace("Theme.AppCompat.NoActionBar", "Theme.Material3.DayNight.NoActionBar")
+    text = text.replace("Theme.AppCompat.Light", "Theme.Material3.DayNight")
+    text = text.replace("Theme.AppCompat", "Theme.Material3.DayNight")
+
+    text = text.replace("\"Theme.Material3.DayNight", "\"@style/Theme.Material3.DayNight")
+
+    text = text.replace("<item name=\"android:windowBackground\">@color/white</item>",
+                        "<item name=\"android:windowBackground\">@color/bg_white</item>")
+    return text
+
+
+# 匹配两行或更多连续的空白行,并将它们替换为一行空白行
+def delete_java_blank_line(text):
+    text = re.sub("\n\s+\n+", "\n\n", text)
+    return text
+
+
+# 删除xml多余空白行
+def delete_xml_blank_line(text, suffix):
+    if suffix == ".xml":
+        text = re.sub("\n\s+\n+", "\n\n", text)
+    return text
+
+
+# 添加R文件引入
+def add_import_R(text, suffix):
+    if suffix == ".java":
+        if "import android.graphics.Color;" in text:
+            if "package com.xmcy.hykb.app" in text and "import com.xmcy.hykb.R;" not in text:
+                text = text.replace("import android.graphics.Color;",
+                                    "import android.graphics.Color;\nimport com.xmcy.hykb.R;")
+            if "import androidx.core.content.ContextCompat;" not in text:
+                text = text.replace("import android.graphics.Color;",
+                                    "import android.graphics.Color;\nimport androidx.core.content.ContextCompat;")
+    elif suffix == ".kt":
+        if "import android.graphics.Color" in text:
+            if "package com.xmcy.hykb.app" in text and "import com.xmcy.hykb.R" not in text:
+                text = text.replace("import android.graphics.Color",
+                                    "import android.graphics.Color\nimport com.xmcy.hykb.R")
+            if "import androidx.core.content.ContextCompat" not in text:
+                text = text.replace("import android.graphics.Color",
+                                    "import android.graphics.Color\nimport androidx.core.content.ContextCompat")
+    return text
+
+
+# 添加头信息
+def add_xml_res_auto(text):
+    if "xmlns:app=\"http://schemas.android.com/apk/res-auto\"" not in text and "app:" in text:
+        text = text.replace("xmlns:android=\"http://schemas.android.com/apk/res/android\"",
+                            "xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  xmlns:app=\"http://schemas.android.com/apk/res-auto\"")
+    return text
+
+
+# 删除xml注释
+def delete_xml_remark(text):
+    matches = re.findall(r"<!-[\s\S]*?-->", text)
+    if matches:
+        for match in matches:
+            text = text.replace(match + "\n", "")
+            text = text.replace(match, "")
+    return text
+
+
+# 替换旧的dimen
+def hykb_dimens(text):
+    dimens = get_old_dimens()
+    text = text.replace("@dimen/post_detail_item_bottom_12dp", "12dp")
+    for dimen in dimens:
+        key = dimen[0]
+        value = dimen[1]
+        text = text.replace(f"@dimen/{key}", f"{value}")
+        text = text.replace(f"@dimen/{key}", f"{value}")
+    return text
+
+
+# 替换旧的颜色
+def replace_old_color(text):
+    new_colors = get_new_colors()
+    old_colors = get_old_colors()
+
+    for new_color in new_colors:
+        new_color_name = new_color[0]
+        new_color_code = new_color[1]
+        for old_color in old_colors:
+            old_color_name = old_color[0]
+            old_color_code = old_color[1]
+
+            if len(old_color_code) == 8 and old_color_code.startswith("00"):
+                print(f"发现透明颜色:{old_color_name}->{old_color_code}")
+                text = text.replace(f"@color/{old_color_name}", f"@color/transparent")
+                text = text.replace(f"R.color.{old_color_name}", f"R.color.transparent")
+            elif old_color_code.lower() == new_color_code.lower():
+                # print(f"新旧颜色装换{old_color_name}->{new_color_name}->{new_color_code}")
+                text = text.replace(f"@color/{old_color_name}", f"@color/{new_color_name}")
+                text = text.replace(f"R.color.{old_color_name}", f"R.color.{new_color_name}")
+    return text
+
+
+# 替换旧方法
+def replace_res_utils(text, suffix):
+    if "import androidx.core.content.ContextCompat\"" not in text and (
+            "ResUtils.getColor(" in text or "ResUtils.getDrawable(" in text):
+        if suffix == ".java":
+            text = text.replace("import com.xmcy.hykb.utils.ResUtils;",
+                                "import com.xmcy.hykb.utils.ResUtils;\nimport androidx.core.content.ContextCompat;")
+        elif suffix == ".kt":
+            text = text.replace("import com.xmcy.hykb.utils.ResUtils",
+                                "import com.xmcy.hykb.utils.ResUtils\nimport androidx.core.content.ContextCompat")
+
+    matches = re.findall(r'extends\s+\w+Activity', text)
+    if matches:
+        text = text.replace("ResUtils.getColor(", "getColorResId(")
+        text = text.replace("ResUtils.getDrawable(", "ContextCompat.getDrawable(this, ")
+
+    matches = re.findall(r'extends\s+\w+Fragment', text)
+    if matches:
+        text = text.replace("ResUtils.getColor(", "getColor(")
+        text = text.replace("ResUtils.getDrawable(", "ContextCompat.getDrawable(getContext(), ")
+
+    matches = re.findall(r'extends\s+\w+PopupWindow', text)
+    if matches:
+        text = text.replace("ResUtils.getColor(", "ContextCompat.getColor(context, ")
+        text = text.replace("ResUtils.getDrawable(", "ContextCompat.getDrawable(context, ")
+
+    matches = re.findall(r'extends\s+\w+RecyclerView.Adapter', text)
+    if matches:
+        text = text.replace("ResUtils.getColor(", "ContextCompat.getColor(viewHolder.itemView.getContext(), ")
+        text = text.replace("ResUtils.getDrawable(", "ContextCompat.getDrawable(viewHolder.itemView.getContext(), ")
+
+    matches = re.findall(r'extends\s+\w+BaseRecyclerViewBindAdapter', text)
+    if matches:
+        text = text.replace("ResUtils.getColor(", "ContextCompat.getColor(context, ")
+        text = text.replace("ResUtils.getDrawable(", "ContextCompat.getDrawable(context, ")
+
+    matches = re.findall(r'extends\s+\w+BaseMultipleAdapter', text)
+    if matches:
+        text = text.replace("ResUtils.getColor(", "ContextCompat.getColor(activity, ")
+        text = text.replace("ResUtils.getDrawable(", "ContextCompat.getDrawable(activity, ")
+
+    if suffix == ".java":
+        if "Activity mActivity" in text:
+            text = text.replace("ResUtils.getColor(", "ContextCompat.getColor(mActivity, ")
+            text = text.replace("ResUtils.getDrawable(", "ContextCompat.getDrawable(mActivity, ")
+        elif "Context mContext" in text:
+            text = text.replace("ResUtils.getColor(", "ContextCompat.getColor(mContext, ")
+            text = text.replace("ResUtils.getDrawable(", "ContextCompat.getDrawable(mContext, ")
+        else:
+            text = text.replace("ResUtils.getColor(", "ContextCompat.getColor(getContext(), ")
+            text = text.replace("ResUtils.getDrawable(", "ContextCompat.getDrawable(getContext(), ")
+    elif suffix == ".kt":
+        text = text.replace("ResUtils.getColor(", "ContextCompat.getColor(context, ")
+        text = text.replace("ResUtils.getDrawable(", "ContextCompat.getDrawable(context, ")
+
+    if ("ResUtils.getString(" not in text
+            and "ResUtils.getDimension(" not in text
+            and "ResUtils.getDimensionPixelOffset(" not in text
+            and "ResUtils.getDimensionPixelSize(" not in text
+            and "ResUtils.getContextResource(" not in text):
+        text = text.replace("import com.xmcy.hykb.utils.ResUtils;", "")
+    return text
+
+
+def BaseTextOneLineStyle(text):
+    if "style=\"@style/BaseTextOneLineStyle\"" in text:
+        print(f"发现:BaseTextOneLineStyle")
+        text = text.replace("style=\"@style/BaseTextOneLineStyle\"",
+                            "android:includeFontPadding=\"false\" android:singleLine=\"true\" android:ellipsize=\"end\"")
+    return text
+
+
+def MoreButtonStyle(text):
+    if "style=\"@style/MoreButtonStyle\"" in text:
+        print(f"发现:MoreButtonStyle")
+        text = text.replace("style=\"@style/MoreButtonStyle\"",
+                            "android:text=\"@string/more\"\n" +
+                            "      android:drawableRight=\"@drawable/home_icon_title_arrow\"\n" +
+                            "      android:textColor=\"@color/black_h3\"\n" +
+                            "      android:textSize=\"12sp\"\n" +
+                            "      android:layout_width=\"wrap_content\"\n" +
+                            "      android:layout_height=\"24dp\"\n" +
+                            "      android:gravity=\"center\"\n" +
+                            "      android:background=\"@drawable/bg_more_button_20\"\n" +
+                            "      android:paddingLeft=\"8dp\"\n" +
+                            "      android:paddingRight=\"8dp\"")
+    return text
+
+
+def bg_white_radius10(text):
+    if "android:background=\"@drawable/bg_white_radius10\"" in text:
+        print(f"发现:bg_white_radius10")
+        text = text.replace("android:background=\"@drawable/bg_white_radius10\"",
+                            "app:bl_solid_color=\"@color/bg_white\"\n app:bl_corners_radius=\"10dp\"")
+    return text
+
+
+def bg_homeindex_item_10(text):
+    if "android:background=\"@drawable/bg_homeindex_item_10\"" in text:
+        print(f"发现:bg_homeindex_item_10")
+        text = text.replace("android:background=\"@drawable/bg_homeindex_item_10\"",
+                            "app:bl_solid_color=\"@color/bg_white\"\n app:bl_corners_radius=\"10dp\"")
+    return text
+
+
+def bg_btn_ffffff_10dp(text):
+    if "android:background=\"@drawable/bg_btn_ffffff_10dp\"" in text:
+        print(f"发现:bg_white_radius10")
+        text = text.replace("android:background=\"@drawable/bg_btn_ffffff_10dp\"",
+                            "app:bl_solid_color=\"@color/bg_white\"\n app:bl_corners_radius=\"10dp\"")
+    return text
+
+
+def bg_btn_white_topr10(text):
+    if "android:background=\"@drawable/bg_btn_white_topr10\"" in text:
+        print(f"发现:bg_btn_white_topr10")
+        text = text.replace("android:background=\"@drawable/bg_btn_white_topr10\"",
+                            "app:bl_solid_color=\"@color/bg_white\"\n app:bl_corners_topRadius=\"10dp\"")
+    return text
+
+
+def bg_btn_white_topr12(text):
+    if "android:background=\"@drawable/bg_btn_white_topr12\"" in text:
+        print(f"发现:bg_btn_white_topr12")
+        text = text.replace("android:background=\"@drawable/bg_btn_white_topr12\"",
+                            "app:bl_solid_color=\"@color/bg_white\"\n app:bl_corners_topRadius=\"12dp\"")
+    return text
+
+
+def bg_btn_white_topr16(text):
+    if "android:background=\"@drawable/bg_btn_white_topr16\"" in text:
+        print(f"发现:bg_btn_white_topr16")
+        text = text.replace("android:background=\"@drawable/bg_btn_white_topr16\"",
+                            "app:bl_solid_color=\"@color/bg_white\" app:bl_corners_topRadius=\"16dp\"")
+    return text
+
+
+def replace_xml_imageview(text):
+    if "<ImageView\n" in text:
+        text = text.replace("<ImageView\n",
+                            "<androidx.appcompat.widget.AppCompatImageView\n")
+    return text
+
+
+def replace_xml_textview(text):
+    text = text.replace("com.xmcy.hykb.app.view.KBTextView", "com.xmcy.hykb.view.KipoTextView")
+    text = text.replace("KBTextView", "KipoTextView")
+    return text
+
+
+def replace_system_bar(text):
+    text = text.replace("getColorResId(R.color.white)", "getColorResId(R.color.bg_white)")
+    text = text.replace("getColorResId(R.color.color_cccfd1d0)", "getColorResId(R.color.black_h5_80)")
+    text = text.replace("getColorResId(R.color.whitesmoke)", "getColorResId(R.color.bg_deep)")
+    text = text.replace("SystemBarHelper.setStatusBarMode(this, true)",
+                        "SystemBarHelper.setStatusBarMode(this, getResources().getBoolean(R.bool.status_bar_dark_font))")
+    text = text.replace("SystemBarHelper.tintStatusBar(this, getColorResId(R.color.bg_light))",
+                        "SystemBarHelper.tintStatusBar(this, getColorResId(R.color.bg_deep))")
+    return text
+
+
+def replace_icon(text):
+    text = text.replace("gamedetail_icon_nav_come_back3", "bar_back")
+    text = text.replace("icon_back_black", "bar_back")
+    text = text.replace("accredit_icon_check", "set_sign_tick")
+    text = text.replace("gamedetails_icon_into", "set_icon_arrow")
+    text = text.replace("home_icon_arrow_gray2", "set_icon_arrow")
+
+    text = text.replace("android:drawableRight=\"@drawable/icon_more\"",
+                        "app:drawableEndCompat=\"@drawable/set_icon_arrow\"")
+    text = text.replace("android:src=\"@drawable/icon_more\"",
+                        "android:src=\"@drawable/set_icon_arrow\"")
+    return text
+
+
+def replace_background(text):
+    text = text.replace("android:background=\"@android:color/white\"", "android:background=\"@color/bg_white\"")
+    text = text.replace("android:background=\"@color/white\"", "android:background=\"@color/bg_white\"")
+    text = text.replace("android:background=\"@color/whitesmoke\"", "android:background=\"@color/bg_deep\"")
+    text = text.replace("app:bl_solid_color=\"@color/white\"", "app:bl_solid_color=\"@color/bg_white\"")
+    text = text.replace("app:bl_solid_color=\"@android:color/white\"", "app:bl_solid_color=\"@color/bg_white\"")
+    text = text.replace("app:bl_solid_color=\"#ffffffff\"", "app:bl_solid_color=\"@color/bg_white\"")
+    text = text.replace("app:bl_solid_color=\"#ffffff\"", "app:bl_solid_color=\"@color/bg_white\"")
+    text = text.replace("app:bl_solid_color=\"#FFFFFFFF\"", "app:bl_solid_color=\"@color/bg_white\"")
+    text = text.replace("app:bl_solid_color=\"#FFFFFF\"", "app:bl_solid_color=\"@color/bg_white\"")
+    return text