同文輸入法源代碼修改記錄

同文輸入法源代碼修改記錄



#!/bin/bash

my_name_s="五笔·至善"
my_name_t="五筆·至善"
my_folder="98WB"
my_package="trime_98"

echo "『包名』和『存储目录』同时修改过后,才能与原版本存。"
echo "修改后的『简体名称』是:${my_name_s}"
echo "修改后的『繁体名称』是:${my_name_t}"
echo "修改后的『存储目录』是:${my_folder}"
echo "修改后的『包名』是:${my_package}"

echo "修改 Makefile 配置文件的『默认路径』。"
sed -i "s/\/rime\//\/${my_folder}\//g" ./Makefile

echo "修改 build.gradle 配置文件的『包名称』。"
sed -i "s/com.osfans.trime/com.osfans.${my_package}/g" ./app/build.gradle

echo "修改『包目录』。"
mv ./app/src/main/java/com/osfans/trime ./app/src/main/java/com/osfans/${my_package}
mv ./app/src/main/assets/rime ./app/src/main/assets/${my_folder}

echo "修改 AndroidManifest 中的『包名称』。"
sed -i "s/com.osfans.trime/com.osfans.${my_package}/g" ./app/src/main/AndroidManifest.xml

echo "修改 JAVA 中的『包名称』。"
sed -i "s/com.osfans.trime/com.osfans.${my_package}/g" ./app/src/main/java/com/osfans/${my_package}/enums/*.java
sed -i "s/com.osfans.trime/com.osfans.${my_package}/g" ./app/src/main/java/com/osfans/${my_package}/*.java
sed -i "s/\"rime/\"${my_folder}/g" ./app/src/main/java/com/osfans/${my_package}/ResetDialog.java
sed -i "s/\"rime\"/\"${my_folder}\"/g" ./app/src/main/java/com/osfans/${my_package}/Config.java

echo "修改 CMakeLists.txt 中的『类名称』。"
sed -i "s/\/trime\//\/${my_package}\//g" ./app/src/main/jni/CMakeLists.txt

echo "修改『软件名称』。"
sed -i "s/同文输入法/${my_name_s}/g" ./app/src/main/res/values-zh-rCN/strings.xml
sed -i "s/同文輸入法/${my_name_t}/g" ./app/src/main/res/values-zh-rTW/strings.xml

echo "修改 donottranslate.xml 文件的『默认路径』。"
sed -i "s/sdcard\/rime/sdcard\/${my_folder}/g" ./app/src/main/res/values/donottranslate.xml

echo "修改 xml 文件夹的『包名称』。"
sed -i "s/com.osfans.trime/com.osfans.${my_package}/g" ./app/src/main/res/xml/method.xml
sed -i "s/

你可能感兴趣的:(同文輸入法源代碼修改記錄)