OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046
以下内容为反编译后的 f.java 源代码,内容仅作参考
package com.excelliance.kxqp.gs.discover.recommed;
import android.content.Context;
import com.excelliance.kxqp.gs.discover.model.MediaItem;
import com.excelliance.kxqp.gs.discover.model.ResponseData;
import com.excelliance.kxqp.gs.discover.model.request.MediaListRequestData;
import com.excelliance.kxqp.gs.discover.model.request.UserListRequestData;
import com.excelliance.kxqp.gs.discover.model.request.VideoRequestData;
import com.excelliance.kxqp.gs.util.as;
import com.excelliance.kxqp.gs.util.az;
import com.excelliance.kxqp.gs.util.bd;
import com.excelliance.kxqp.gs.util.be;
import com.excelliance.kxqp.gs.util.bp;
import com.excelliance.kxqp.gs.util.cn;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.List;
public class f {
private static f f5736a;
private Context f5737b;
private Gson c = new Gson();
private HashSet<String> d;
private String e;
public static synchronized f a(Context context) {
f fVar;
synchronized (f.class) {
if (f5736a == null) {
f5736a = new f(context.getApplicationContext());
}
fVar = f5736a;
}
return fVar;
}
private f(Context context) {
this.f5737b = context;
this.e = com.excelliance.kxqp.swipe.a.a.getString(this.f5737b, "server_wrong");
}
public ResponseData<List<MediaItem>> a(int i, int i2) {
UserListRequestData userListRequestData;
String str;
String a2;
ResponseData<List<MediaItem>> responseData;
String d = com.excelliance.kxqp.gs.discover.a.d(this.f5737b);
ResponseData<List<MediaItem>> responseData2 = new ResponseData<>();
responseData2.code = 1;
responseData2.msg = this.e;
try {
userListRequestData = (UserListRequestData) this.c.a(cn.i(this.f5737b).toString(), new TypeToken<UserListRequestData>() {
}.getType());
} catch (Exception e) {
e.printStackTrace();
az.e("RecommendRepository", e.toString());
userListRequestData = null;
}
if (userListRequestData == null) {
userListRequestData = new UserListRequestData(null, d, i, i2);
} else {
userListRequestData.setData(null, d, i, i2);
}
be d2 = bd.d("http://api.ourplay.com.cn/news/list", this.c.a(userListRequestData));
if (d2 != null) {
str = d2.c;
responseData2.msg = as.a(this.f5737b, d2);
} else {
str = null;
}
if (str != null && (a2 = bp.a(str, "fuck_snsslmm_bslznw", "utf-8")) != null) {
try {
responseData = (ResponseData) this.c.a(a2, new TypeToken<ResponseData<List<MediaItem>>>() {
}.getType());
} catch (Exception e2) {
az.e("RecommendRepository", e2.toString());
responseData = null;
}
if (userListRequestData != null) {
return responseData;
}
}
return responseData2;
}
public ResponseData<List<MediaItem>> a(int i, int i2, int i3) {
VideoRequestData videoRequestData;
String str;
String a2;
ResponseData<List<MediaItem>> responseData;
String d = com.excelliance.kxqp.gs.discover.a.d(this.f5737b);
try {
videoRequestData = (VideoRequestData) this.c.a(cn.i(this.f5737b).toString(), new TypeToken<VideoRequestData>() {
}.getType());
} catch (Exception e) {
e.printStackTrace();
az.e("RecommendRepository", e.toString());
videoRequestData = null;
}
if (videoRequestData == null) {
videoRequestData = new VideoRequestData(d, i, i2, i3);
} else {
videoRequestData.setData(d, i, i2, i3);
}
String a3 = this.c.a(videoRequestData);
ResponseData<List<MediaItem>> responseData2 = new ResponseData<>();
responseData2.code = 1;
responseData2.msg = this.e;
be d2 = bd.d("http://api.ourplay.com.cn/news/videolist", a3);
if (d2 != null) {
str = d2.c;
responseData2.msg = as.a(this.f5737b, d2);
} else {
str = null;
}
if (str != null && (a2 = bp.a(str, "fuck_snsslmm_bslznw", "utf-8")) != null) {
try {
responseData = (ResponseData) this.c.a(a2, new TypeToken<ResponseData<List<MediaItem>>>() {
}.getType());
} catch (Exception e2) {
az.e("RecommendRepository", e2.toString());
responseData = null;
}
if (responseData != null) {
return responseData;
}
}
return responseData2;
}
public void a(String str) {
if (str != null) {
b().add(str);
}
}
public void a() {
if (this.d != null) {
c(this.c.a(this.d));
}
}
private void c(String str) {
BufferedOutputStream bufferedOutputStream;
File file = new File(this.f5737b.getExternalCacheDir(), "content-read-id");
BufferedOutputStream bufferedOutputStream2 = null;
try {
try {
try {
if (!file.exists()) {
file.createNewFile();
}
bufferedOutputStream = new BufferedOutputStream(new FileOutputStream(file));
} catch (IOException e) {
az.e("RecommendRepository", e.toString());
return;
}
} catch (IOException e2) {
e = e2;
}
} catch (Throwable th) {
th = th;
}
try {
bufferedOutputStream.write(str.getBytes());
bufferedOutputStream.flush();
bufferedOutputStream.close();
} catch (IOException e3) {
e = e3;
bufferedOutputStream2 = bufferedOutputStream;
az.e("RecommendRepository", e.toString());
if (bufferedOutputStream2 != null) {
bufferedOutputStream2.close();
}
} catch (Throwable th2) {
th = th2;
bufferedOutputStream2 = bufferedOutputStream;
if (bufferedOutputStream2 != null) {
try {
bufferedOutputStream2.close();
} catch (IOException e4) {
az.e("RecommendRepository", e4.toString());
}
}
throw th;
}
}
public boolean b(String str) {
if (str == null) {
return false;
}
return b().contains(str);
}
private HashSet<String> b() {
if (this.d == null) {
String c = c();
if ("".equals(c)) {
this.d = d();
} else {
try {
this.d = (HashSet) this.c.a(c, new TypeToken<HashSet<String>>() {
}.getType());
} catch (Exception e) {
e.printStackTrace();
this.d = d();
}
if (this.d == null) {
this.d = d();
}
}
}
return this.d;
}
private String c() {
BufferedReader bufferedReader;
File file = new File(this.f5737b.getExternalCacheDir(), "content-read-id");
BufferedReader bufferedReader2 = null;
try {
try {
if (!file.exists()) {
file.createNewFile();
}
bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
} catch (Throwable th) {
th = th;
}
} catch (IOException e) {
e = e;
}
try {
StringBuilder sb = new StringBuilder();
while (true) {
String readLine = bufferedReader.readLine();
if (readLine == null) {
break;
}
sb.append(readLine);
}
String sb2 = sb.toString();
try {
bufferedReader.close();
} catch (IOException e2) {
az.e("RecommendRepository", e2.toString());
}
return sb2;
} catch (IOException e3) {
e = e3;
bufferedReader2 = bufferedReader;
az.e("RecommendRepository", e.toString());
if (bufferedReader2 != null) {
try {
bufferedReader2.close();
} catch (IOException e4) {
az.e("RecommendRepository", e4.toString());
}
}
return "";
} catch (Throwable th2) {
th = th2;
bufferedReader2 = bufferedReader;
if (bufferedReader2 != null) {
try {
bufferedReader2.close();
} catch (IOException e5) {
az.e("RecommendRepository", e5.toString());
}
}
throw th;
}
}
private HashSet<String> d() {
return new HashSet<>();
}
public ResponseData<List<MediaItem>> b(int i, int i2) {
MediaListRequestData mediaListRequestData;
String str;
String a2;
ResponseData<List<MediaItem>> responseData;
try {
mediaListRequestData = (MediaListRequestData) this.c.a(cn.i(this.f5737b).toString(), new TypeToken<MediaListRequestData>() {
}.getType());
} catch (Exception e) {
e.printStackTrace();
az.e("RecommendRepository", e.toString());
mediaListRequestData = null;
}
if (mediaListRequestData == null) {
mediaListRequestData = new MediaListRequestData(i, i2);
} else {
mediaListRequestData.setData(i, i2);
}
String a3 = this.c.a(mediaListRequestData);
ResponseData<List<MediaItem>> responseData2 = new ResponseData<>();
responseData2.code = 1;
responseData2.msg = this.e;
be d = bd.d("http://api.ourplay.com.cn/news/hotlist", a3);
if (d != null) {
str = d.c;
responseData2.msg = as.a(this.f5737b, d);
} else {
str = null;
}
if (str != null && (a2 = bp.a(str, "fuck_snsslmm_bslznw", "utf-8")) != null) {
try {
responseData = (ResponseData) this.c.a(a2, new TypeToken<ResponseData<List<MediaItem>>>() {
}.getType());
} catch (Exception e2) {
az.e("RecommendRepository", e2.toString());
responseData = null;
}
if (responseData != null) {
return responseData;
}
}
return responseData2;
}
}