Skip to content

Commit

Permalink
[feature|optimize|fix]整理申请权限代码;整理部分投屏代码;支持调节弹幕字号;优化播放界面Toolbar显示逻辑代码;…
Browse files Browse the repository at this point in the history
…导入数据源前申请存储权限,避免在某些手机上崩溃;修复数据源弹出Toast时崩溃的问题(没有把com.skyd.imomoe.util.ToastKt加入混淆规则)
  • Loading branch information
SkyD666 committed Jan 14, 2022
1 parent 5fdd276 commit f9a83e7
Show file tree
Hide file tree
Showing 45 changed files with 983 additions and 1,095 deletions.
7 changes: 4 additions & 3 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,15 @@
4. 支持**双指缩放****移动****旋转**视频
5. 支持视频**投屏**到电视
6. 支持部分视频**显示****发送弹幕**(需要数据源支持弹幕)
7. 支持**缓存视频**到本地(暂不支持m3u8格式资源缓存)
8. 支持**追番**(数据保存在本地)
9. 支持显示**观看历史**记录
10. 支持显示**搜索历史**记录
11. 支持改变视频**播放速度**
12. 支持改变**视频**显示**比例**(16:9, 4:3, 全屏等)
13. [支持**自定义**显示**数据源**](doc/customdatasource/README.md)
14. ......
7. 支持输入某站弹幕链接播放网络弹幕(例如https://api.bilibili.com/x/v1/dm/list.so?oid=97495910)
8. 支持**缓存视频**到本地(暂不支持m3u8格式资源缓存)
9. 支持**追番**(数据保存在本地)
10. 支持显示**观看历史**记录
11. 支持显示**搜索历史**记录
12. 支持改变视频**播放速度**
13. 支持改变**视频**显示**比例**(16:9, 4:3, 全屏等)
14. [支持**自定义**显示**数据源**](doc/customdatasource/README.md)
15. ......

## 运行截图

Expand All @@ -67,7 +68,7 @@

## 安全说明

**请勿**私自**传播APK**安装包,Github仓库为唯一长期仓库,**请仅在Github仓库下载安装包**请勿下载来历不明的应用与Jar包,谨防隐私泄露,谨防受骗!
**请勿**私自**传播APK**安装包,Github仓库为唯一长期仓库,**请仅在Github仓库下载安装包**请勿下载来历不明的应用与ads包,谨防隐私泄露,谨防受骗!

### 已发现未知来源的APK

Expand Down
1 change: 1 addition & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ public static final int *;
-keep class com.skyd.imomoe.model.util.** { *; }
-keep class com.skyd.imomoe.util.html.source.** { *; }
-keep class com.skyd.imomoe.util.eventbus.** { *; }
-keep class com.skyd.imomoe.util.ToastKt { *; }
# 与自定义数据源相关的库不应该被混淆
-keep class org.jsoup.** { *; }
-keep class org.greenrobot.eventbus.** { *; }
Expand Down
10 changes: 1 addition & 9 deletions app/src/main/java/com/skyd/imomoe/model/DataSourceManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,13 @@ import com.skyd.imomoe.BuildConfig
import com.skyd.imomoe.model.interfaces.IConst
import com.skyd.imomoe.model.interfaces.IRouteProcessor
import com.skyd.imomoe.model.interfaces.IUtil
import com.skyd.imomoe.util.showToast
import com.skyd.imomoe.util.editor
import com.skyd.imomoe.util.sharedPreferences
import dalvik.system.DexClassLoader
import java.io.File


object DataSourceManager {
// var useCustomDataSource: Boolean
// get() {
// return App.context.sharedPreferences().getBoolean("useCustomDataSource", false)
// }
// set(value) {
// App.context.sharedPreferences().editor { putBoolean("useCustomDataSource", value) }
// }

const val DEFAULT_DATA_SOURCE = ""

Expand Down Expand Up @@ -97,7 +89,7 @@ object DataSourceManager {
@Suppress("UNCHECKED_CAST")
fun <T> create(clazz: Class<T>): T? {
// 如果不使用自定义数据,直接返回null
if (dataSourceName == DEFAULT_DATA_SOURCE) return null
if (dataSourceName == DEFAULT_DATA_SOURCE && !BuildConfig.DEBUG) return null
cache[clazz]?.let {
return it.newInstance() as T
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import com.skyd.imomoe.util.showToast
import okhttp3.HttpUrl.Companion.toHttpUrl
import java.lang.Exception

object DoH {
object DnsServer {
val defaultDnsServer = hashMapOf(
0 to "",
1 to "https://223.5.5.5/dns-query",
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/skyd/imomoe/net/Okhttp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import java.io.File
private val okhttpCache = Cache(File("cacheDir", "okhttpcache"), 10 * 1024 * 1024)
private val bootstrapClient = OkHttpClient.Builder().cache(okhttpCache).build()

var dns: DnsOverHttps? = DoH.dnsServer.let {
var dns: DnsOverHttps? = DnsServer.dnsServer.let {
if (it.isNullOrBlank()) null else {
try {
DnsOverHttps.Builder().client(bootstrapClient)
Expand Down
12 changes: 12 additions & 0 deletions app/src/main/java/com/skyd/imomoe/util/Number.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.skyd.imomoe.util

/**
* 只拼接百分号%
*/
inline val Int.percentage: String
get() = "${this}%"

/**
* 乘100后拼接百分号
*/
fun Int.toPercentage(): String = "${this * 100}%"
18 changes: 18 additions & 0 deletions app/src/main/java/com/skyd/imomoe/util/Permission.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.skyd.imomoe.util

import android.app.Activity
import androidx.fragment.app.Fragment
import com.hjq.permissions.Permission
import com.hjq.permissions.XXPermissions
import com.skyd.imomoe.view.listener.dsl.OnSinglePermissionCallback
import com.skyd.imomoe.view.listener.dsl.requestSinglePermission

fun Activity.requestManageExternalStorage(init: OnSinglePermissionCallback.() -> Unit) {
XXPermissions.with(this).permission(Permission.MANAGE_EXTERNAL_STORAGE)
.requestSinglePermission(init)
}

fun Fragment.requestManageExternalStorage(init: OnSinglePermissionCallback.() -> Unit) {
XXPermissions.with(this).permission(Permission.MANAGE_EXTERNAL_STORAGE)
.requestSinglePermission(init)
}
201 changes: 0 additions & 201 deletions app/src/main/java/com/skyd/imomoe/util/dlna/CastObject.java

This file was deleted.

Loading

0 comments on commit f9a83e7

Please sign in to comment.