pull/137/head
FongMi 3 years ago
parent c4d1497cdb
commit 0a75c6e60e
  1. 3
      app/src/main/java/com/fongmi/android/tv/player/extractor/Force.java
  2. 4
      catvod/src/main/java/com/github/catvod/utils/Github.java
  3. 2
      catvod/src/main/java/com/github/catvod/utils/Path.java
  4. 27
      forcetech/src/main/AndroidManifest.xml
  5. 4
      forcetech/src/main/java/com/forcetech/Util.java
  6. 4
      forcetech/src/main/java/com/forcetech/android/ForceTV.java
  7. 2
      forcetech/src/main/java/com/forcetech/service/PxPService.java

@ -11,6 +11,7 @@ import com.fongmi.android.tv.App;
import com.fongmi.android.tv.player.Source;
import com.forcetech.Util;
import com.github.catvod.net.OkHttp;
import com.github.catvod.utils.Github;
import java.util.HashSet;
@ -26,7 +27,7 @@ public class Force implements Source.Extractor {
}
private void init(String scheme) {
App.get().bindService(Util.intent(App.get(), scheme), mConn, Context.BIND_AUTO_CREATE);
App.get().bindService(Util.intent(App.get(), scheme, Github.getSo(scheme)), mConn, Context.BIND_AUTO_CREATE);
}
@Override

@ -66,8 +66,8 @@ public class Github {
public static String getSo(String name) {
try {
File file = Path.so(name);
String path = getReleasePath("/other/jniLibs/" + file.getName());
if (!file.exists() || file.length() == 0) Path.write(file, OkHttp.newCall(path).execute().body().bytes());
String url = getReleasePath("/other/jniLibs/".concat(file.getName()));
if (file.length() < 300) Path.write(file, OkHttp.newCall(url).execute().body().bytes());
return file.getAbsolutePath();
} catch (Exception e) {
return "";

@ -87,7 +87,7 @@ public class Path {
}
public static File so(String name) {
return new File(so(), "lib".concat(name).concat(".so"));
return new File("mitv".equals(name) ? cache() : so(), "lib".concat(name).concat(".so"));
}
public static File js(String name) {

@ -6,48 +6,39 @@
<service
android:name="com.forcetech.service.P2PService"
android:exported="false"
android:process=":p2p" />
android:exported="false" />
<service
android:name="com.forcetech.service.P3PService"
android:exported="false"
android:process=":p3p" />
android:exported="false" />
<service
android:name="com.forcetech.service.P4PService"
android:exported="false"
android:process=":p4p" />
android:exported="false" />
<service
android:name="com.forcetech.service.P5PService"
android:exported="false"
android:process=":p5p" />
android:exported="false" />
<service
android:name="com.forcetech.service.P6PService"
android:exported="false"
android:process=":p6p" />
android:exported="false" />
<service
android:name="com.forcetech.service.P7PService"
android:exported="false"
android:process=":p7p" />
android:exported="false" />
<service
android:name="com.forcetech.service.P8PService"
android:exported="false"
android:process=":p8p" />
android:exported="false" />
<service
android:name="com.forcetech.service.P9PService"
android:exported="false"
android:process=":p9p" />
android:exported="false" />
<service
android:name="com.gsoft.mitv.MainActivity"
android:exported="false"
android:process=":mitv" />
android:exported="false" />
</application>
</manifest>

@ -41,9 +41,9 @@ public class Util {
return name.toLowerCase();
}
public static Intent intent(Context context, String scheme) {
public static Intent intent(Context context, String scheme, String path) {
Intent intent = new Intent(context, clz(scheme));
intent.putExtra("scheme", scheme);
intent.putExtra("path", path);
return intent;
}

@ -1,12 +1,10 @@
package com.forcetech.android;
import com.github.catvod.utils.Github;
public class ForceTV {
public void start(String lib, int port) {
try {
System.load(Github.getSo(lib));
System.load(lib);
start(port, 20 * 1024 * 1024);
} catch (Throwable ignored) {
}

@ -23,7 +23,7 @@ public abstract class PxPService extends Service {
@Override
public IBinder onBind(Intent intent) {
forceTV = new ForceTV();
forceTV.start(intent.getStringExtra("scheme"), getPort());
forceTV.start(intent.getStringExtra("path"), getPort());
return binder;
}

Loading…
Cancel
Save