Commit b2fb77d9 authored by liuyang's avatar liuyang

APK图片抓取识别及轮播流地址抓取,客户端4.2版本文件读取问题

#BYLSERVER-1438
parent f3598946
......@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
static def releaseTime() {
return new Date().format("yyyyMMdd", TimeZone.getTimeZone("UTC"))
return new Date().format("yyyyMMddHHmm", TimeZone.getTimeZone("UTC"))
}
android {
......
......@@ -256,6 +256,7 @@ class Task : IAppBaseCallback {
if (add) {
// 这里进行媒体视频播放地址识别
add = false
val extArr = this.apkInfo.mediaExt.split("|")
for (ext in extArr) {
if (url.contains(ext)) {
......
......@@ -156,15 +156,16 @@ object AppUtil {
sdcardAbsPath = Environment.getExternalStorageDirectory().absolutePath
// 4.2系统存在legacy|0读取问题
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.JELLY_BEAN_MR1) {
sdcardAbsPath = "/sdcard"
}
// val p = Pattern.compile("/?storage/emulated/\\d{1,2}")
// val m = p.matcher(sdcardAbsPath)
// if (m.find()) {
// sdcardAbsPath = sdcardAbsPath.replace("storage/emulated/", "storage/sdcard")
// if (Build.VERSION.SDK_INT == Build.VERSION_CODES.JELLY_BEAN_MR1) {
// sdcardAbsPath = "/sdcard"
// }
val p = Pattern.compile("/?storage/emulated/\\d{1,2}")
val m = p.matcher(sdcardAbsPath)
if (m.find()) {
sdcardAbsPath = sdcardAbsPath.replace("storage/emulated/0", "storage/emulated/legacy")
}
return sdcardAbsPath
}
}
\ 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