Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
BYLAppRobot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liuyang
BYLAppRobot
Commits
72f867e0
Commit
72f867e0
authored
Oct 16, 2018
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
APK图片抓取识别及轮播流地址抓取,客户端ftp调试
#BYLSERVER-1438
parent
90f64f60
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
6 deletions
+36
-6
DlbRobotApp.kt
app/src/main/java/com/duolebo/blyrobot/DlbRobotApp.kt
+2
-0
MainActivity.kt
app/src/main/java/com/duolebo/blyrobot/MainActivity.kt
+24
-0
Task.kt
app/src/main/java/com/duolebo/blyrobot/data/Task.kt
+2
-0
Config.kt
app/src/main/java/com/duolebo/blyrobot/util/Config.kt
+8
-6
No files found.
app/src/main/java/com/duolebo/blyrobot/DlbRobotApp.kt
View file @
72f867e0
package
com.duolebo.blyrobot
import
android.app.Application
import
net.gotev.uploadservice.Logger
import
net.gotev.uploadservice.UploadService
import
net.gotev.uploadservice.okhttp.OkHttpStack
import
okhttp3.OkHttpClient
...
...
@@ -13,6 +14,7 @@ class DlbRobotApp: Application() {
UploadService
.
NAMESPACE
=
BuildConfig
.
APPLICATION_ID
UploadService
.
NAMESPACE
=
this
.
packageName
Logger
.
setLogLevel
(
Logger
.
LogLevel
.
DEBUG
)
val
client
=
OkHttpClient
()
UploadService
.
HTTP_STACK
=
OkHttpStack
(
client
)
...
...
app/src/main/java/com/duolebo/blyrobot/MainActivity.kt
View file @
72f867e0
...
...
@@ -27,6 +27,10 @@ import com.duolebo.blyrobot.util.Config
import
com.duolebo.blyrobot.util.Constants
import
com.minhui.vpn.utils.ThreadProxy
import
kotlinx.android.synthetic.main.activity_main.*
import
net.gotev.uploadservice.UploadNotificationConfig
import
net.gotev.uploadservice.ftp.FTPUploadRequest
import
net.gotev.uploadservice.ftp.UnixPermissions
import
java.io.File
import
java.util.*
class
MainActivity
:
AppCompatActivity
(),
IAppBaseCallback
{
...
...
@@ -72,6 +76,8 @@ class MainActivity : AppCompatActivity(), IAppBaseCallback {
startBtn
.
requestFocus
()
requestAppList
()
testFtpUpload
()
}
private
fun
requestAppList
()
{
...
...
@@ -159,6 +165,24 @@ class MainActivity : AppCompatActivity(), IAppBaseCallback {
return
drawable
}
fun
testFtpUpload
()
{
try
{
val
uploadRequest
=
FTPUploadRequest
(
this
,
Config
.
instance
.
getFtpServer
(),
21
)
.
setUsernameAndPassword
(
Config
.
instance
.
getFtpUserName
(),
Config
.
instance
.
getFtpPassword
())
.
setNotificationConfig
(
UploadNotificationConfig
())
.
setCreatedDirectoriesPermissions
(
UnixPermissions
(
"777"
))
.
setMaxRetries
(
4
)
val
uploadFile
=
File
(
"/sdcard/shumei.txt"
)
uploadRequest
.
addFileToUpload
(
uploadFile
.
absolutePath
,
Config
.
instance
.
getFtpRemotePath
()
+
"/"
+
uploadFile
.
name
)
val
uploadId
=
uploadRequest
.
startUpload
()
Log
.
i
(
TAG
,
"upload id $uploadId"
)
}
catch
(
exc
:
Exception
)
{
Log
.
e
(
TAG
,
exc
.
message
,
exc
)
}
}
inner
class
AppConfigAdapter
:
BaseAdapter
()
{
private
val
dataList
=
ArrayList
<
ApkInfo
>()
...
...
app/src/main/java/com/duolebo/blyrobot/data/Task.kt
View file @
72f867e0
...
...
@@ -310,6 +310,8 @@ class Task : IAppBaseCallback {
}
override
fun
onError
(
context
:
Context
?,
uploadInfo
:
UploadInfo
?,
serverResponse
:
ServerResponse
?,
exception
:
java
.
lang
.
Exception
?)
{
val
uploadSize
=
uploadInfo
?.
successfullyUploadedFiles
!!
.
size
Log
.
i
(
TAG
,
"onError...uploadCount: $uploadSize"
)
}
override
fun
onCompleted
(
context
:
Context
?,
uploadInfo
:
UploadInfo
?,
serverResponse
:
ServerResponse
?)
{
...
...
app/src/main/java/com/duolebo/blyrobot/util/Config.kt
View file @
72f867e0
...
...
@@ -8,7 +8,7 @@ class Config: IProtocolConfig {
override
fun
getProtocolUrl
():
String
{
if
(
isDebug
)
return
"http://192.168.2.42:8080/manage/apkInfo/query.do"
return
"http://test.duolebo.com/staging/apkInfo/query.do"
return
"http://test.duolebo.com
:8091
/staging/apkInfo/query.do"
}
override
fun
getTvid
():
String
{
...
...
@@ -23,33 +23,35 @@ class Config: IProtocolConfig {
fun
getReportProtocolUrl
():
String
{
if
(
isDebug
)
return
"http://192.168.2.42:8080/manage/apkReport/report.do"
return
"http://test.duolebo.com/staging/apkReport/report.do"
return
"http://test.duolebo.com
:8091
/staging/apkReport/report.do"
}
fun
getFtpServer
():
String
{
if
(
isDebug
)
return
"192.168.2.195"
return
"
test.duolebo.com
"
return
"
139.199.112.154
"
}
fun
getFtpUserName
():
String
{
if
(
isDebug
)
return
"mateng"
return
"ftpclient"
// return "ftpclient"
return
"vsftp"
}
fun
getFtpPassword
():
String
{
if
(
isDebug
)
return
"qwertasdfg"
return
"dlbftp1234qwer"
// return "dlbftp1234qwer"
return
"dlbvsftp1234rfv"
}
fun
getFtpRemotePath
():
String
{
if
(
isDebug
)
return
"/upload"
return
"/
screensho
t"
return
"/
tes
t"
}
companion
object
{
...
...
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