forked from 10bits/gedoor-Build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action_app_custom.sh
48 lines (46 loc) · 1.75 KB
/
action_app_custom.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
#本脚本用来个性化定制app,不会修改任何程序代码
function app_clear_18plus()
{
if [ $APP_NAME = 'legado' ]; then
echo "清空18PlusList.txt"
echo "">$APP_WORKSPACE/app/src/main/assets/18PlusList.txt
fi
}
function app_color_set()
{
if [ $APP_NAME = 'legado' ]; then
#设置搜索界面浮动按钮颜色
sed '/id\/fb_stop/a\ android:backgroundTint="#389099"' $APP_WORKSPACE/app/src/main/res/layout/activity_book_search.xml -i
fi
}
function app_resources_unuse()
{
if [ $APP_NAME = 'legado' ]; then
echo "删除一些用不到的资源"
rm $APP_WORKSPACE/app/src/main/assets/bg -rf
rm $APP_WORKSPACE/app/src/main/assets/web/new -rf
fi
}
function app_minify()
{
#缩小apk体积
sed '/minifyEnabled/i\ shrinkResources true' $APP_WORKSPACE/app/build.gradle -i
sed 's/minifyEnabled false/minifyEnabled true/' $APP_WORKSPACE/app/build.gradle -i
}
function app_live_together()
{
#解决安装程序共存问题
sed "s/'.release'/'.releaseA'/" $APP_WORKSPACE/app/build.gradle -i
sed 's/.release/.releaseA/' $APP_WORKSPACE/app/google-services.json -i
}
function app_sign()
{
echo "给apk增加签名"
cp $GITHUB_WORKSPACE/.github/workflows/legado.jks $APP_WORKSPACE/app/legado.jks
sed '$a\RELEASE_STORE_FILE=./legado.jks' $APP_WORKSPACE/gradle.properties -i
sed '$a\RELEASE_KEY_ALIAS=legado' $APP_WORKSPACE/gradle.properties -i
sed '$a\RELEASE_STORE_PASSWORD=gedoor_legado' $APP_WORKSPACE/gradle.properties -i
sed '$a\RELEASE_KEY_PASSWORD=gedoor_legado' $APP_WORKSPACE/gradle.properties -i
}
app_clear_18plus;app_sign;app_live_together;app_minify;app_resources_unuse