mirror of https://github.com/FongMi/TV.git
commit
3af697b797
@ -0,0 +1,11 @@ |
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" |
||||
android:width="24dp" |
||||
android:height="24dp" |
||||
android:viewportWidth="1024" |
||||
android:viewportHeight="1024"> |
||||
|
||||
<path |
||||
android:fillColor="#ffffff" |
||||
android:pathData="M938.7,426.7l0,-85.3c0,-46.9 -38.4,-85.3 -85.3,-85.3L128,256c-46.9,0 -85.3,38.4 -85.3,85.3l0,341.3c0,46.9 38.4,85.3 85.3,85.3l725.3,0c46.9,0 85.3,-38.4 85.3,-85.3l0,-85.3c23.5,0 42.7,-19.2 42.7,-42.7l0,-85.3C981.3,445.9 962.1,426.7 938.7,426.7zM896,469.3l0,85.3 0,128c0,23.5 -19.2,42.7 -42.7,42.7L128,725.3c-23.5,0 -42.7,-19.2 -42.7,-42.7L85.3,341.3c0,-23.5 19.2,-42.7 42.7,-42.7l725.3,0c23.5,0 42.7,19.2 42.7,42.7L896,469.3z" /> |
||||
|
||||
</vector> |
||||
@ -0,0 +1,9 @@ |
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" |
||||
android:width="24dp" |
||||
android:height="24dp" |
||||
android:viewportWidth="1024" |
||||
android:viewportHeight="1024"> |
||||
<path |
||||
android:pathData="M128,682.7l213.3,0L341.3,341.3 128,341.3 128,682.7zM938.7,426.7l0,-85.3c0,-46.9 -38.4,-85.3 -85.3,-85.3L128,256c-46.9,0 -85.3,38.4 -85.3,85.3l0,341.3c0,46.9 38.4,85.3 85.3,85.3l725.3,0c46.9,0 85.3,-38.4 85.3,-85.3l0,-85.3c23.5,0 42.7,-19.2 42.7,-42.7l0,-85.3C981.3,445.9 962.1,426.7 938.7,426.7zM896,682.7c0,23.5 -19.2,42.7 -42.7,42.7L128,725.3c-23.5,0 -42.7,-19.2 -42.7,-42.7L85.3,341.3c0,-23.5 19.2,-42.7 42.7,-42.7l725.3,0c23.5,0 42.7,19.2 42.7,42.7L896,682.7z" |
||||
android:fillColor="#ffffff"/> |
||||
</vector> |
||||
@ -0,0 +1,9 @@ |
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" |
||||
android:width="24dp" |
||||
android:height="24dp" |
||||
android:viewportWidth="1024" |
||||
android:viewportHeight="1024"> |
||||
<path |
||||
android:pathData="M938.7,426.7l0,-85.3c0,-46.9 -38.4,-85.3 -85.3,-85.3L128,256c-46.9,0 -85.3,38.4 -85.3,85.3l0,341.3c0,46.9 38.4,85.3 85.3,85.3l725.3,0c46.9,0 85.3,-38.4 85.3,-85.3l0,-85.3c23.5,0 42.7,-19.2 42.7,-42.7l0,-85.3C981.3,445.9 962.1,426.7 938.7,426.7zM896,682.7c0,23.5 -19.2,42.7 -42.7,42.7L128,725.3c-23.5,0 -42.7,-19.2 -42.7,-42.7L85.3,341.3c0,-23.5 19.2,-42.7 42.7,-42.7l725.3,0c23.5,0 42.7,19.2 42.7,42.7L896,682.7zM128,682.7l384,0L512,341.3 128,341.3 128,682.7z" |
||||
android:fillColor="#ffffff"/> |
||||
</vector> |
||||
@ -0,0 +1,9 @@ |
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" |
||||
android:width="24dp" |
||||
android:height="24dp" |
||||
android:viewportWidth="1024" |
||||
android:viewportHeight="1024"> |
||||
<path |
||||
android:pathData="M938.7,426.7l0,-85.3c0,-46.9 -38.4,-85.3 -85.3,-85.3L128,256c-46.9,0 -85.3,38.4 -85.3,85.3l0,341.3c0,46.9 38.4,85.3 85.3,85.3l725.3,0c46.9,0 85.3,-38.4 85.3,-85.3l0,-85.3c23.5,0 42.7,-19.2 42.7,-42.7l0,-85.3C981.3,445.9 962.1,426.7 938.7,426.7zM896,469.3l0,85.3 0,128c0,23.5 -19.2,42.7 -42.7,42.7L128,725.3c-23.5,0 -42.7,-19.2 -42.7,-42.7L85.3,341.3c0,-23.5 19.2,-42.7 42.7,-42.7l725.3,0c23.5,0 42.7,19.2 42.7,42.7L896,469.3zM128,682.7l554.7,0L682.7,341.3 128,341.3 128,682.7z" |
||||
android:fillColor="#ffffff"/> |
||||
</vector> |
||||
@ -0,0 +1,9 @@ |
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" |
||||
android:width="24dp" |
||||
android:height="24dp" |
||||
android:viewportWidth="1024" |
||||
android:viewportHeight="1024"> |
||||
<path |
||||
android:pathData="M128,682.7l725.3,0L853.3,341.3 128,341.3 128,682.7zM938.7,426.7l0,-85.3c0,-46.9 -38.4,-85.3 -85.3,-85.3L128,256c-46.9,0 -85.3,38.4 -85.3,85.3l0,341.3c0,46.9 38.4,85.3 85.3,85.3l725.3,0c46.9,0 85.3,-38.4 85.3,-85.3l0,-85.3c23.5,0 42.7,-19.2 42.7,-42.7l0,-85.3C981.3,445.9 962.1,426.7 938.7,426.7zM896,469.3l0,85.3 0,128c0,23.5 -19.2,42.7 -42.7,42.7L128,725.3c-23.5,0 -42.7,-19.2 -42.7,-42.7L85.3,341.3c0,-23.5 19.2,-42.7 42.7,-42.7l725.3,0c23.5,0 42.7,19.2 42.7,42.7L896,469.3z" |
||||
android:fillColor="#ffffff"/> |
||||
</vector> |
||||
@ -0,0 +1,33 @@ |
||||
package com.github.catvod.net.interceptor; |
||||
|
||||
import androidx.annotation.NonNull; |
||||
|
||||
import com.github.catvod.Proxy; |
||||
import com.github.catvod.net.OkCookieJar; |
||||
import com.github.catvod.utils.Util; |
||||
import com.google.common.net.HttpHeaders; |
||||
|
||||
import java.io.IOException; |
||||
import java.net.URI; |
||||
|
||||
import okhttp3.Interceptor; |
||||
import okhttp3.Request; |
||||
import okhttp3.Response; |
||||
|
||||
public class RequestInterceptor implements Interceptor { |
||||
|
||||
@NonNull |
||||
@Override |
||||
public Response intercept(@NonNull Chain chain) throws IOException { |
||||
Request request = chain.request(); |
||||
URI uri = request.url().uri(); |
||||
String url = request.url().toString(); |
||||
Request.Builder builder = request.newBuilder(); |
||||
OkCookieJar.sync(url, request.header(HttpHeaders.COOKIE)); |
||||
boolean local = url.contains(":" + Proxy.getPort() + "/"); |
||||
if (url.contains("+") && local) builder.url(url.replace("+", "%2B")); |
||||
if (url.contains("gitcode.net")) builder.header(HttpHeaders.USER_AGENT, Util.CHROME); |
||||
if (uri.getUserInfo() != null) builder.header(HttpHeaders.AUTHORIZATION, Util.basic(uri.getUserInfo())); |
||||
return chain.proceed(builder.build()); |
||||
} |
||||
} |
||||
Loading…
Reference in new issue