|
|
|
@ -3,9 +3,10 @@ package com.fongmi.android.tv.bean; |
|
|
|
import androidx.annotation.NonNull; |
|
|
|
import androidx.annotation.NonNull; |
|
|
|
|
|
|
|
|
|
|
|
import com.fongmi.android.tv.App; |
|
|
|
import com.fongmi.android.tv.App; |
|
|
|
|
|
|
|
import com.github.catvod.utils.Util; |
|
|
|
import com.google.gson.annotations.SerializedName; |
|
|
|
import com.google.gson.annotations.SerializedName; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
public class ClearKey { |
|
|
|
public class ClearKey { |
|
|
|
@ -21,11 +22,21 @@ public class ClearKey { |
|
|
|
return item; |
|
|
|
return item; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static ClearKey get(String kid, String k) { |
|
|
|
public static ClearKey get(String line) { |
|
|
|
ClearKey key = new ClearKey(); |
|
|
|
ClearKey item = new ClearKey(); |
|
|
|
key.keys = Arrays.asList(new Keys(kid, k)); |
|
|
|
item.keys = new ArrayList<>(); |
|
|
|
key.type = "temporary"; |
|
|
|
item.type = "temporary"; |
|
|
|
return key; |
|
|
|
item.addKeys(line); |
|
|
|
|
|
|
|
return item; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void addKeys(String line) { |
|
|
|
|
|
|
|
for (String s : line.split(",")) { |
|
|
|
|
|
|
|
String[] split = s.split(":"); |
|
|
|
|
|
|
|
String kid = Util.base64(Util.hex2byte(split[0].trim())).replace("=", ""); |
|
|
|
|
|
|
|
String k = Util.base64(Util.hex2byte(split[1].trim())).replace("=", ""); |
|
|
|
|
|
|
|
keys.add(new Keys(kid, k)); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static class Keys { |
|
|
|
public static class Keys { |
|
|
|
|