基线备份:thirdparty 变体完成 + Android 4.2 兼容改造前
包含内容: - thirdparty flavor 独立 applicationId + Intent 入口(ThirdPartyEntryActivity) - 58 后端接口适配(单 /api 路径、code 0/200、camelCase 字段、UNBOUND 轮询) - MAC 硬件锚定校验(防一凭证多设备共用) - EPG mac 覆盖 SDK init(sMacOverride)+ ChannelManger 初始化对齐 - 提示文案优化(设备未注册/权益未绑定)
This commit is contained in:
96
app/src/main/java/com/pukka/jiecheng/utils/DataValueUtils.java
Executable file
96
app/src/main/java/com/pukka/jiecheng/utils/DataValueUtils.java
Executable file
@@ -0,0 +1,96 @@
|
||||
package com.pukka.jiecheng.utils;
|
||||
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
import org.json.JSONException;
|
||||
|
||||
public class DataValueUtils {
|
||||
private static final String TAG = "DataValueUtils";
|
||||
|
||||
public DataValueUtils() {
|
||||
}
|
||||
|
||||
public static String getDataValues(String dataAll, String... valueKeys) {
|
||||
String value = dataAll;
|
||||
|
||||
try {
|
||||
for(int i = 0; i < valueKeys.length; ++i) {
|
||||
JSONObject jsonObject = JSON.parseObject(value);
|
||||
value = jsonObject.getString(valueKeys[i]);
|
||||
if (i == valueKeys.length - 1) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
} catch (Exception var5) {
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
public static String setDataValue(String dataAll, String keys, String values) {
|
||||
try {
|
||||
JSONObject json = null;
|
||||
json = JSONObject.parseObject(dataAll);
|
||||
Set<String> keySet = json.keySet();
|
||||
Iterator var5 = keySet.iterator();
|
||||
|
||||
while(true) {
|
||||
while(var5.hasNext()) {
|
||||
String key = (String)var5.next();
|
||||
Object obj = json.get(key);
|
||||
if (obj instanceof JSONArray) {
|
||||
JSONArray arr = (JSONArray)obj;
|
||||
|
||||
for(int i = 0; i < arr.size(); ++i) {
|
||||
String child = setDataValue(arr.get(i).toString(), keys, values);
|
||||
arr.set(i, JSONObject.parse(child));
|
||||
}
|
||||
|
||||
json.put(key, arr);
|
||||
} else if (obj instanceof JSONObject) {
|
||||
JSONObject sub = (JSONObject)obj;
|
||||
String substr = setDataValue(sub.toJSONString(), keys, values);
|
||||
json.put(key, JSONObject.parse(substr));
|
||||
} else if (key.equals(keys)) {
|
||||
json.put(key, values);
|
||||
}
|
||||
}
|
||||
|
||||
return json.toJSONString();
|
||||
}
|
||||
} catch (Exception var11) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public static org.json.JSONObject toJSONObject(String dataAll) {
|
||||
org.json.JSONObject jsonObject = new org.json.JSONObject();
|
||||
|
||||
try {
|
||||
JSONObject json = null;
|
||||
json = JSONObject.parseObject(dataAll);
|
||||
Set<String> keySet = json.keySet();
|
||||
Iterator var4 = keySet.iterator();
|
||||
|
||||
while(var4.hasNext()) {
|
||||
String key = (String)var4.next();
|
||||
Object obj = json.get(key);
|
||||
jsonObject.put(key, obj);
|
||||
}
|
||||
|
||||
return jsonObject;
|
||||
} catch (JSONException var7) {
|
||||
var7.printStackTrace();
|
||||
return jsonObject;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user