feat:路径混淆支持白名单

This commit is contained in:
Max
2024-01-20 12:16:10 +08:00
parent 72a362f2a6
commit 3a84f71fcd

View File

@@ -12,6 +12,9 @@ import okhttp3.Response
* Desc:路径转化
**/
class PathInterceptor : Interceptor {
private val whiteList = listOf<String>("/oauth/", "/acc/")
override fun intercept(chain: Interceptor.Chain): Response {
val request = chain.request()
val builder = request.newBuilder()
@@ -20,6 +23,11 @@ class PathInterceptor : Interceptor {
if (!url.toString().startsWith(UriProvider.API_URL)) {
return chain.proceed(request)
}
if (whiteList.firstOrNull {
path.contains(it)
} != null) {
return chain.proceed(request)
}
val newPath = DESUtils.DESAndBase64(path)
return if (newPath.isNullOrEmpty()) {
chain.proceed(request)