Commit 9e69c7e6 authored by liuyang's avatar liuyang

APK抓包>从频道1开始依次抓取, ftp上传优化

#BYLSERVER-1693
parent 0ab9467f
...@@ -13,7 +13,7 @@ android { ...@@ -13,7 +13,7 @@ android {
minSdkVersion 15 minSdkVersion 15
targetSdkVersion 22 targetSdkVersion 22
versionCode 15 versionCode 15
versionName "1.3.30" versionName "1.4.40"
} }
signingConfigs { signingConfigs {
......
...@@ -105,6 +105,7 @@ class MainActivity : AppCompatActivity(), IAppBaseCallback { ...@@ -105,6 +105,7 @@ class MainActivity : AppCompatActivity(), IAppBaseCallback {
} }
private fun stop() { private fun stop() {
Toast.makeText(this, "正在停止任务,请稍候...", Toast.LENGTH_SHORT).show()
stopRobot() stopRobot()
stopBtn.isEnabled = false stopBtn.isEnabled = false
stopBtn.isFocusable = false stopBtn.isFocusable = false
......
...@@ -91,6 +91,7 @@ class BylRobotService: Service(), IAppBaseCallback { ...@@ -91,6 +91,7 @@ class BylRobotService: Service(), IAppBaseCallback {
override fun onDestroy() { override fun onDestroy() {
Log.i(TAG, "destroy...") Log.i(TAG, "destroy...")
super.onDestroy() super.onDestroy()
stopTask()
FtpManager.instance.stop() FtpManager.instance.stop()
LocalBroadcastManager.getInstance(this).unregisterReceiver(broadcastReceiver) LocalBroadcastManager.getInstance(this).unregisterReceiver(broadcastReceiver)
} }
......
...@@ -22,6 +22,8 @@ class FtpManager { ...@@ -22,6 +22,8 @@ class FtpManager {
fun start() { fun start() {
Log.i(TAG, "ftp manager start...") Log.i(TAG, "ftp manager start...")
if (this.isRunning)
return
scheduleTime?.run { cancel() } scheduleTime?.run { cancel() }
this.isRunning = true this.isRunning = true
scheduleTime = Timer() scheduleTime = Timer()
...@@ -64,6 +66,7 @@ class FtpManager { ...@@ -64,6 +66,7 @@ class FtpManager {
for (uploadTask in uploadTasks) { for (uploadTask in uploadTasks) {
cancelTask(uploadTask) cancelTask(uploadTask)
} }
this.isRunning = false
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment