1.调整登录页面UI

2.修改H5URL地址
3.修改心愿单地址
4.将PD 修改未 POYO
This commit is contained in:
Martin
2024-09-13 16:30:20 +08:00
parent 9a72e54ca3
commit e58ce7932f
16 changed files with 57 additions and 51 deletions

View File

@@ -33,7 +33,7 @@ public class HtmlConfig {
public static final String LUCK_GIFT_TIP = CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=26";
//直播间玩家看到的心愿单
public static final String WISHLIST_URL = CommonAppConfig.HOST + "/index.php?g=Appapi&m=Wish&a=index";
public static final String WISHLIST_URL = CommonAppConfig.HOST + "/h5/wish/index.html?1=1";
//直播间玩家看到的转盘
public static final String TURNTABLE_URL = CommonAppConfig.HOST + "/Appapi/Turntable/index";

View File

@@ -36,6 +36,7 @@ public abstract class HttpCallback extends AbsCallback<JsonBean> {
public void onSuccess(Response<JsonBean> response) {
JsonBean bean = response.body();
String gson = new Gson().toJson(bean);
L.e("gson:" + gson);
if (bean != null) {
if (200 == bean.getRet()) {
Data data = bean.getData();

View File

@@ -43,8 +43,7 @@ public final class JavaConverterFactory extends Converter.Factory {
}
@Override
public Converter<ResponseBody, ?> responseBodyConverter(Type type, Annotation[] annotations,
Retrofit retrofit) {
public Converter<ResponseBody, ?> responseBodyConverter(Type type, Annotation[] annotations, Retrofit retrofit) {
TypeAdapter<?> adapter = gson.getAdapter(TypeToken.get(type));
return new JsonResponseBodyConverter<>(gson, adapter);
}
@@ -55,9 +54,10 @@ public final class JavaConverterFactory extends Converter.Factory {
return super.requestBodyConverter(type, parameterAnnotations, methodAnnotations, retrofit);
}
final class JsonResponseBodyConverter <T> implements Converter<ResponseBody, T> {
final class JsonResponseBodyConverter<T> implements Converter<ResponseBody, T> {
private final Gson gson;
private final TypeAdapter<T> adapter;
JsonResponseBodyConverter(Gson gson, TypeAdapter<T> adapter) {
this.gson = gson;
this.adapter = adapter;
@@ -67,31 +67,31 @@ public final class JavaConverterFactory extends Converter.Factory {
public T convert(ResponseBody value) throws IOException {
String response = value.string();
String allResponseData;
L.e("解密前::"+response);
L.e("解密前::" + response);
JSONObject jsonObject = JSONObject.parseObject(response);
if(jsonObject!=null){
allResponseData = jsonObject.getString("data");
if(allResponseData!=null){
byte[] decodedData = null;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
decodedData = Base64.getDecoder().decode(allResponseData);
}
response = AesUtils.decryptToString(decodedData);
allResponseData = jsonObject.getString("data");
if (allResponseData.indexOf(":") <= 0) {
byte[] decodedData = null;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
decodedData = Base64.getDecoder().decode(allResponseData);
}
}
jsonObject.put("data",JSONObject.parseObject(response));
response = AesUtils.decryptToString(decodedData);
jsonObject.put("data", JSONObject.parseObject(response));
response = JSON.toJSONString(jsonObject);
L.e("解密后::"+ response);
//获取加密数据解密之后再让adapter去处理json串解析具体的数据就可以了
try{
response = JSON.toJSONString(jsonObject);
L.e("解密后::" + response);
//获取加密数据解密之后再让adapter去处理json串解析具体的数据就可以了
try {
return adapter.fromJson(response);
} catch (Exception e) {
e.printStackTrace();
} finally {
value.close();
}
} else {
return adapter.fromJson(response);
} catch (Exception e) {
e.printStackTrace();
} finally {
value.close();
}
return null;
return null;
}
}
}

View File

@@ -39,32 +39,35 @@ public class JsonBean {
}
public Data getData() {
if(data.indexOf(":")>0){
return GsonUtils.fromJson(data,Data.class);
}else{
L.e("data:" + data);
if (data.indexOf(":") > 0) {
L.e("未加密::" + data);
return JSON.parseObject(data, Data.class);
//return GsonUtils.fromJson(data, Data.class);
} else {
Data resultData = new Data();
byte[] decodedData = null;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
decodedData = Base64.getDecoder().decode(data);
}
String decryptedText = AesUtils.decryptToString(decodedData);
L.e("解码前:"+data);
L.e("解码前-转成base64"+decodedData);
L.e("解码前-解密後:"+decryptedText);
L.e("解码前:" + data);
L.e("解码前-转成base64" + decodedData);
L.e("解码前-解密後:" + decryptedText);
JSONObject object = JSON.parseObject(decryptedText);
try {
JSONArray jsonArray = object.getJSONArray("info");
String [] array = new String[jsonArray.size()];
for (int i = 0; i <array.length; i++) {
String[] array = new String[jsonArray.size()];
for (int i = 0; i < array.length; i++) {
array[i] = jsonArray.getString(i);
}
resultData.setInfo(array);
resultData.setCode(object.getInteger("code"));
resultData.setMsg(object.getString("msg"));
}catch (Exception e) {
} catch (Exception e) {
try {
String [] array = new String[1];
array[0]= object.getString("info");
String[] array = new String[1];
array[0] = object.getString("info");
resultData.setInfo(array);
resultData.setCode(object.getInteger("code"));
resultData.setMsg(object.getString("msg"));

View File

@@ -620,7 +620,7 @@ public class JavascriptInterfaceUtils {
@JavascriptInterface
public void androidClickToTaskPage() {
ARouter.getInstance().build(PATH_REWARD).withString("url",
CommonAppConfig.HOST + "/index.php?g=Appapi&m=task&a=index" + "&uid=" + CommonAppConfig.getInstance().getUid()
CommonAppConfig.HOST + "/h5/task/index.html?" + "uid=" + CommonAppConfig.getInstance().getUid()
+ "&token=" + CommonAppConfig.getInstance().getToken() + "&tabIndex=1" + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0")).navigation();
}

View File

@@ -1183,7 +1183,7 @@
<string name="have_already_win">%s has been sent to your personalized dress up</string>
<string name="mini_blind_box">Mini blind box</string>
<string name="collection_blind_box">Collection blind box</string>
<string name="pd_blind_box">PD blind box</string>
<string name="pd_blind_box">POYO blind box</string>
<string name="individual_dressing">Individual dressing</string>
<string name="random_availability">Can be obtained randomly, %s</string>
<string name="random_availability2">I got %s %s</string>