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
8cf426a8
authored
Mar 16, 2020
by
pye52
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
现在更新包统一改为外部地址
parent
72cb1847
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
11 deletions
+2
-11
app/src/main/java/com/bgycc/smartcanteen/command/UpdateCommandHandler.java
+2
-11
No files found.
app/src/main/java/com/bgycc/smartcanteen/command/UpdateCommandHandler.java
View file @
8cf426a8
...
@@ -12,7 +12,6 @@ import com.blankj.utilcode.util.FileIOUtils;
...
@@ -12,7 +12,6 @@ import com.blankj.utilcode.util.FileIOUtils;
import
com.blankj.utilcode.util.FileUtils
;
import
com.blankj.utilcode.util.FileUtils
;
import
com.blankj.utilcode.util.LogUtils
;
import
com.blankj.utilcode.util.LogUtils
;
import
com.blankj.utilcode.util.PathUtils
;
import
com.blankj.utilcode.util.PathUtils
;
import
com.blankj.utilcode.util.Utils
;
import
com.google.gson.Gson
;
import
com.google.gson.Gson
;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.annotations.NotNull
;
...
@@ -80,6 +79,7 @@ public class UpdateCommandHandler extends CommandHandler {
...
@@ -80,6 +79,7 @@ public class UpdateCommandHandler extends CommandHandler {
.
build
();
.
build
();
this
.
commandUpdate
=
gson
.
fromJson
(
command
.
getData
(),
CommandUpdate
.
class
);
this
.
commandUpdate
=
gson
.
fromJson
(
command
.
getData
(),
CommandUpdate
.
class
);
this
.
updateApk
=
new
File
(
PathUtils
.
getExternalStoragePath
(),
UPDATE_APK
);
this
.
updateApk
=
new
File
(
PathUtils
.
getExternalStoragePath
(),
UPDATE_APK
);
FileUtils
.
delete
(
updateApk
);
}
}
private
void
init
(
Command
command
,
Gson
gson
,
CommandProgressCallback
callback
)
{
private
void
init
(
Command
command
,
Gson
gson
,
CommandProgressCallback
callback
)
{
...
@@ -87,7 +87,7 @@ public class UpdateCommandHandler extends CommandHandler {
...
@@ -87,7 +87,7 @@ public class UpdateCommandHandler extends CommandHandler {
this
.
gson
=
gson
;
this
.
gson
=
gson
;
this
.
commandProgressCallback
=
callback
;
this
.
commandProgressCallback
=
callback
;
this
.
commandUpdate
=
gson
.
fromJson
(
command
.
getData
(),
CommandUpdate
.
class
);
this
.
commandUpdate
=
gson
.
fromJson
(
command
.
getData
(),
CommandUpdate
.
class
);
this
.
updateApk
=
new
File
(
Utils
.
getApp
().
getCacheDir
(),
UPDATE_APK
);
this
.
updateApk
=
new
File
(
PathUtils
.
getExternalStoragePath
(),
UPDATE_APK
);
}
}
@Override
@Override
...
@@ -98,15 +98,6 @@ public class UpdateCommandHandler extends CommandHandler {
...
@@ -98,15 +98,6 @@ public class UpdateCommandHandler extends CommandHandler {
}
}
start
=
true
;
start
=
true
;
FileUtils
.
delete
(
updateApk
);
FileUtils
.
delete
(
updateApk
);
boolean
createApk
=
false
;
try
{
createApk
=
updateApk
.
createNewFile
();
}
catch
(
IOException
e
)
{
LogUtils
.
e
(
TAG
,
"更新包文件创建失败: "
+
e
.
getMessage
(),
e
);
}
if
(!
createApk
)
{
return
failedResult
(
"更新包文件创建失败"
);
}
if
(
executor
==
null
)
{
if
(
executor
==
null
)
{
executor
=
Executors
.
newScheduledThreadPool
(
1
);
executor
=
Executors
.
newScheduledThreadPool
(
1
);
}
}
...
...
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