|
也不是不能写,就是有点愁,这反编译的代码 我还是不想动手了。
public static String getLiveToken(String str, String str2) throws UnsupportedEncodingException {
String str3 = (System.currentTimeMillis() / 1000) + "";
String md52 = getMd5(str + "Tide" + str2);
StringBuilder sb = new StringBuilder();
int i = 0;
sb.append(md52.substring(0, 2));
sb.append(md52.substring(4, 8));
sb.append(md52.substring(14, 15));
sb.append(md52.substring(13, 14));
sb.append(md52.substring(12, 13));
sb.append(md52.substring(25, 29));
sb.append(md52.substring(30, 31));
sb.append(md52.substring(29, 30));
sb.append(md52.substring(28, 29));
sb.append(md52.substring(27, 28));
sb.append(md52.substring(26, 27));
String md53 = getMd5("tide" + str3 + sb.toString());
String replace = new String(Base64.encodeBase64(("t=" + str3 + "&c=" + str + "&a=" + str2 + "&v=" + (md53.substring(4, 5) + md53.substring(16, 17) + md53.substring(31, 32) + md53.substring(17, 18) + md53.substring(8, 9))).getBytes("UTF-8"))).replace(HttpUtils.EQUAL_SIGN, "|");
String trim = Pattern.compile("[^1-9]").matcher(replace).replaceAll("").trim();
ArrayList arrayList = new ArrayList();
while (i < trim.length()) {
int i2 = i + 1;
String substring = trim.substring(i, i2);
if (!arrayList.contains(Integer.valueOf(Integer.parseInt(substring)))) {
arrayList.add(Integer.valueOf(Integer.parseInt(substring)));
}
i = i2;
}
Iterator it = arrayList.iterator();
while (it.hasNext()) {
System.out.println(((Integer) it.next()).intValue());
}
Iterator it2 = arrayList.iterator();
String str4 = replace;
while (it2.hasNext()) {
int intValue = ((Integer) it2.next()).intValue();
if (intValue % 2 == 0) {
String substring2 = replace.substring(intValue - 1, intValue);
if ("abcdefghigklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZ".indexOf(substring2) != -1) {
int indexOf = ("abcdefghigklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZ".indexOf(substring2) + (intValue * intValue)) % 52;
str4 = replaceSomeWhere(str4, "abcdefghigklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZ".substring(indexOf, indexOf + 1), intValue);
}
} else {
String substring3 = replace.substring(intValue - 1, intValue);
if ("abcdefghigklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZ".indexOf(substring3) != -1) {
int indexOf2 = ("abcdefghigklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZ".indexOf(substring3) + intValue) % 52;
str4 = replaceSomeWhere(str4, "abcdefghigklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZ".substring(indexOf2, indexOf2 + 1), intValue);
}
}
}
return str4;
}
public void getLiveUrl(final boolean z, final String str, final String str2) throws UnsupportedEncodingException {
x.http().get(new RequestParams("http://mediaapi.nctv.net.cn/apiv3.2.3/m3u8.php?token=" + LiveUrlUtils.getLiveToken(this.channelid, Constants.TIDE_APP_ID)), new Callback.CommonCallback<String>() {
/* class com.cutv.mobile.zsncclient.live.PlaybillContentFragment.C16232 */
public void onCancelled(Callback.CancelledException cancelledException) {
}
public void onError(Throwable th, boolean z) {
}
public void onFinished() {
}
public void onSuccess(String str) {
LiveUrlBean liveUrlBean = (LiveUrlBean) new Gson().fromJson(str, LiveUrlBean.class);
switch (liveUrlBean.getStatus().intValue()) {
case 0:
default:
return;
case 1:
if (z) {
PlaybillContentFragment.this.listener.onClick(liveUrlBean.getAddress());
return;
}
PlaybillContentFragment.this.listener.onClick("http://liveplay.nctv.net.cn/" + liveUrlBean.getTss() + HttpUtils.PATHS_SEPARATOR + TimeUtils.getStringToDate(str, "yyyy-MM-dd HH:mm:ss") + "," + TimeUtils.getStringToDate(str2, "yyyy-MM-dd HH:mm:ss") + ".m3u8");
return;
}
}
});
}
|
|