Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
huangzhicong
/
SmartCanteen
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
20484d93
authored
Mar 13, 2020
by
pye52
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'new_master' into new_for_phone
parents
1e30d455
f9ec85fc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
7 deletions
+23
-7
README.md
+4
-4
app/src/main/java/com/bgycc/smartcanteen/command/UpdateCommandHandler.java
+19
-3
No files found.
README.md
View file @
20484d93
### 分支管理
| 分支名 | 描述 |
| ---------- | ------------------------------------------------------------ |
| develop | 开发分支作为源分支,所有新功能开发和bug修复都在develop派生分支进行 |
| test | 测试环境,仅用作打包使用,打包前先从develop分支合并过来并递增版本号 |
| uat | uat环境,仅用作打包使用,打包前先从develop分支合并过来并递增版本号 |
| production | 生产环境,仅用作打包使用,打包前先从develop分支合并过来并递增版本号 |
| develop |
deprecated
开发分支作为源分支,所有新功能开发和bug修复都在develop派生分支进行 |
| test |
deprecated
测试环境,仅用作打包使用,打包前先从develop分支合并过来并递增版本号 |
| uat |
deprecated
uat环境,仅用作打包使用,打包前先从develop分支合并过来并递增版本号 |
| production |
deprecated
生产环境,仅用作打包使用,打包前先从develop分支合并过来并递增版本号 |
| new_master | 重构版本,通过Build Variants来切换到指定的环境,打包同理。已配置好混淆 |
| new_for_phone | 重构版本,供手机测试,通过Build Variants来切换到指定的环境,打包同理。已配置好混淆 |
...
...
app/src/main/java/com/bgycc/smartcanteen/command/UpdateCommandHandler.java
View file @
20484d93
package
com
.
bgycc
.
smartcanteen
.
command
;
import
android.os.Build
;
import
com.bgycc.smartcanteen.BuildConfig
;
import
com.bgycc.smartcanteen.api.SCRetrofit
;
import
com.bgycc.smartcanteen.entity.Command
;
...
...
@@ -165,9 +167,23 @@ public class UpdateCommandHandler extends CommandHandler {
LogUtils
.
d
(
TAG
,
"不允许安装低版本"
);
failed
(
"不允许安装低版本"
,
0
);
}
else
{
DangerousUtils
.
installAppSilent
(
updateApk
);
LogUtils
.
d
(
TAG
,
"开始安装"
);
success
(
"开始安装"
,
100
);
if
(
Build
.
VERSION
.
SDK_INT
<=
Build
.
VERSION_CODES
.
M
)
{
// 6.0以下安装包需要修改权限才能安装
try
{
Process
p
=
Runtime
.
getRuntime
().
exec
(
"chmod 755 "
+
updateApk
);
p
.
waitFor
();
DangerousUtils
.
installAppSilent
(
updateApk
);
LogUtils
.
d
(
TAG
,
"开始安装"
);
success
(
"开始安装"
,
100
);
}
catch
(
Exception
e
)
{
LogUtils
.
e
(
TAG
,
"安装文件权限修改失败"
);
failed
(
"安装文件权限修改失败"
,
0
);
}
}
else
{
DangerousUtils
.
installAppSilent
(
updateApk
);
LogUtils
.
d
(
TAG
,
"开始安装"
);
success
(
"开始安装"
,
100
);
}
}
try
{
Thread
.
sleep
(
DEFAULT_DELAY
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment