Skip to content

Commit

Permalink
Change android template package name
Browse files Browse the repository at this point in the history
Former-commit-id: 9129490
  • Loading branch information
nini22P committed May 17, 2023
1 parent 14eabba commit 90df565
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
6 changes: 4 additions & 2 deletions clone-android.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# 克隆 WebGAL Android 模板
cd release/assets/templates/
rm -rf WebGAL_Android_Template
git clone https://github.com/nini22P/WebGAL-Android.git
mv WebGAL-Android WebGAL_Android_Template
# MainActivity.kt 移动到主文件夹防止误删
mv WebGAL_Android_Template/app/src/main/java/io/github/nini22p/webgal/MainActivity.kt WebGAL_Android_Template/app/src/main/java/MainActivity.kt
mv WebGAL_Android_Template/app/src/main/java/com/openwebgal/demo/MainActivity.kt WebGAL_Android_Template/app/src/main/java/MainActivity.kt

cd ../../../
cd release

# 删除冗余文件
rm -rf assets/templates/WebGAL_Android_Template/.github
rm -rf assets/templates/WebGAL_Android_Template/.git
rm -rf assets/templates/WebGAL_Android_Template/.gitattributes
rm -rf assets/templates/WebGAL_Android_Template/app/src/main/assets/webgal/.gitkeep
rm -rf assets/templates/WebGAL_Android_Template/app/src/main/java/io
rm -rf assets/templates/WebGAL_Android_Template/app/src/main/java/com
2 changes: 1 addition & 1 deletion packages/origine2/src/translations/zh-cn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const zhCn = {
items: {
web: "导出为网页",
exe: "导出为可执行文件",
android: "导出为安卓工程文件"
android: "导出为安卓项目文件"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ export class ManageGameService {
return {
gameName: config.Game_name === '' ? 'WebGAL' : config.Game_name,
packageName:
config.Package_name === '' ? 'dev.webgal' : config.Package_name,
config.Package_name === ''
? 'com.openwebgal.demo'
: config.Package_name,
};
}

Expand Down Expand Up @@ -187,12 +189,12 @@ export class ManageGameService {
);
await this.webgalFs.replaceTextFile(
`${androidExportDir}/app/build.gradle`,
'io.github.nini22p.webgal',
'com.openwebgal.demo',
gameConfig.packageName,
);
await this.webgalFs.replaceTextFile(
`${androidExportDir}/app/src/main/java/MainActivity.kt`,
'io.github.nini22p.webgal',
'com.openwebgal.demo',
gameConfig.packageName,
);
await this.webgalFs.mkdir(
Expand Down
5 changes: 3 additions & 2 deletions release-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ cd release/assets/templates/
git clone https://github.com/nini22P/WebGAL-Android.git
mv WebGAL-Android WebGAL_Android_Template
# MainActivity.kt 移动到主文件夹防止误删
mv WebGAL_Android_Template/app/src/main/java/io/github/nini22p/webgal/MainActivity.kt WebGAL_Android_Template/app/src/main/java/MainActivity.kt
mv WebGAL_Android_Template/app/src/main/java/com/openwebgal/demo/MainActivity.kt WebGAL_Android_Template/app/src/main/java/MainActivity.kt
cd ../../../

cd release
Expand All @@ -51,9 +51,10 @@ rm -rf public/games/*
rm -rf public/games/.gitkeep
rm -rf assets/templates/WebGAL_Template/game/video/*
rm -rf assets/templates/WebGAL_Template/game/video/.gitkeep
rm -rf assets/templates/WebGAL_Android_Template/.github
rm -rf assets/templates/WebGAL_Android_Template/.git
rm -rf assets/templates/WebGAL_Android_Template/.gitattributes
rm -rf assets/templates/WebGAL_Android_Template/app/src/main/assets/webgal/.gitkeep
rm -rf assets/templates/WebGAL_Android_Template/app/src/main/java/io
rm -rf assets/templates/WebGAL_Android_Template/app/src/main/java/com

echo "WebGAL Origine is now ready to be deployed."
5 changes: 3 additions & 2 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ cd release/assets/templates/
git clone https://github.com/nini22P/WebGAL-Android.git
mv WebGAL-Android WebGAL_Android_Template
# MainActivity.kt 移动到主文件夹防止误删
mv WebGAL_Android_Template/app/src/main/java/io/github/nini22p/webgal/MainActivity.kt WebGAL_Android_Template/app/src/main/java/MainActivity.kt
mv WebGAL_Android_Template/app/src/main/java/com/openwebgal/demo/MainActivity.kt WebGAL_Android_Template/app/src/main/java/MainActivity.kt
cd ../../../

cd release
Expand All @@ -49,9 +49,10 @@ rm -rf public/games/*
rm -rf public/games/.gitkeep
rm -rf assets/templates/WebGAL_Template/game/video/*
rm -rf assets/templates/WebGAL_Template/game/video/.gitkeep
rm -rf assets/templates/WebGAL_Android_Template/.github
rm -rf assets/templates/WebGAL_Android_Template/.git
rm -rf assets/templates/WebGAL_Android_Template/.gitattributes
rm -rf assets/templates/WebGAL_Android_Template/app/src/main/assets/webgal/.gitkeep
rm -rf assets/templates/WebGAL_Android_Template/app/src/main/java/io
rm -rf assets/templates/WebGAL_Android_Template/app/src/main/java/com

echo "WebGAL Origine is now ready to be deployed."

0 comments on commit 90df565

Please sign in to comment.