pull/137/head
FongMi 2 years ago
parent b70a99ea3a
commit 38ed224dd2
  1. 5
      app/src/main/java/com/fongmi/android/tv/player/extractor/JianPian.java
  2. 16
      catvod/src/main/java/com/github/catvod/utils/Path.java
  3. 4
      jianpian/build.gradle
  4. 19
      jianpian/src/main/java/com/p2p/P2PClass.java
  5. 3
      pyramid/src/main/java/com/undcover/freedom/pyramid/Loader.java
  6. 3
      pyramid/src/main/python/app.py

@ -2,7 +2,6 @@ package com.fongmi.android.tv.player.extractor;
import android.net.Uri;
import com.fongmi.android.tv.App;
import com.fongmi.android.tv.BuildConfig;
import com.fongmi.android.tv.player.Source;
import com.fongmi.android.tv.utils.Github;
@ -26,10 +25,10 @@ public class JianPian implements Source.Extractor {
private void init() throws Exception {
if (p2p != null) return;
File file = Path.so("p2p-jp-" + BuildConfig.FLAVOR_abi);
File file = Path.so("jpa_" + BuildConfig.FLAVOR_abi);
String path = Github.get().getReleasePath("/other/jniLibs/" + file.getName());
if (!file.exists()) Path.write(file, OkHttp.newCall(path).execute().body().bytes());
p2p = new P2PClass(App.get(), file.getAbsolutePath());
p2p = new P2PClass(file.getAbsolutePath());
}
@Override

@ -42,14 +42,6 @@ public class Path {
return root().getAbsolutePath();
}
public static String cachePath() {
return cache().getAbsolutePath();
}
public static String filesPath() {
return files().getAbsolutePath();
}
public static File so() {
return check(new File(files() + File.separator + "so"));
}
@ -58,6 +50,10 @@ public class Path {
return check(new File(cache() + File.separator + "js"));
}
public static File py() {
return check(new File(cache() + File.separator + "py"));
}
public static File jar() {
return check(new File(cache() + File.separator + "jar"));
}
@ -70,6 +66,10 @@ public class Path {
return check(new File(cache() + File.separator + "exo"));
}
public static File jpa() {
return check(new File(cache() + File.separator + "jpa"));
}
public static File thunder() {
return check(new File(cache() + File.separator + "thunder"));
}

@ -11,4 +11,8 @@ android {
//noinspection ChromeOsAbiSupport
ndk { abiFilters "armeabi-v7a" }
}
}
dependencies {
implementation project(':catvod')
}

@ -1,27 +1,14 @@
package com.p2p;
import android.content.Context;
import java.io.File;
import com.github.catvod.utils.Path;
public class P2PClass {
public int port;
public P2PClass(Context context, String lib) {
public P2PClass(String lib) {
System.load(lib);
init(context);
}
private void init(Context context) {
try {
String path = context.getCacheDir().getAbsolutePath();
File file = new File(path + File.separator + "jpali");
if (!file.exists()) file.mkdirs();
port = P2Pdoxstarthttpd("TEST3E63BAAECDAA79BEAA91853490A69F08".getBytes(), path.getBytes());
} catch (Exception e) {
e.printStackTrace();
}
this.port = P2Pdoxstarthttpd("TEST3E63BAAECDAA79BEAA91853490A69F08".getBytes(), Path.jpa().getAbsolutePath().getBytes());
}
public int P2Pdoxstarthttpd(byte[] bArr, byte[] bArr2) {

@ -7,6 +7,7 @@ import androidx.annotation.Keep;
import com.chaquo.python.PyObject;
import com.chaquo.python.Python;
import com.chaquo.python.android.AndroidPlatform;
import com.github.catvod.utils.Path;
public class Loader {
@ -16,8 +17,8 @@ public class Loader {
@Keep
private void init(Context context) {
if (!Python.isStarted()) Python.start(new AndroidPlatform(context));
cache = context.getCacheDir().getAbsolutePath() + "/plugin/";
app = Python.getInstance().getModule("app");
cache = Path.py().getAbsolutePath();
}
@Keep

@ -30,8 +30,7 @@ def download_file(name, ext):
def init_py(path, name, ext):
create_file(path)
py_name = path + name + '.py'
py_name = path + '/' + name + '.py'
download_file(py_name, ext)
return SourceFileLoader(name, py_name).load_module().Spider()

Loading…
Cancel
Save