diff --git a/common/src/main/java/com/yunbao/common/HtmlConfig.java b/common/src/main/java/com/yunbao/common/HtmlConfig.java index 553153585..c4b3dac7e 100644 --- a/common/src/main/java/com/yunbao/common/HtmlConfig.java +++ b/common/src/main/java/com/yunbao/common/HtmlConfig.java @@ -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"; diff --git a/common/src/main/java/com/yunbao/common/http/HttpCallback.java b/common/src/main/java/com/yunbao/common/http/HttpCallback.java index 7b1c6b411..79acc81c5 100644 --- a/common/src/main/java/com/yunbao/common/http/HttpCallback.java +++ b/common/src/main/java/com/yunbao/common/http/HttpCallback.java @@ -36,6 +36,7 @@ public abstract class HttpCallback extends AbsCallback { public void onSuccess(Response 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(); diff --git a/common/src/main/java/com/yunbao/common/http/JavaConverterFactory.java b/common/src/main/java/com/yunbao/common/http/JavaConverterFactory.java index 070c97d24..898f5eb9b 100644 --- a/common/src/main/java/com/yunbao/common/http/JavaConverterFactory.java +++ b/common/src/main/java/com/yunbao/common/http/JavaConverterFactory.java @@ -43,8 +43,7 @@ public final class JavaConverterFactory extends Converter.Factory { } @Override - public Converter responseBodyConverter(Type type, Annotation[] annotations, - Retrofit retrofit) { + public Converter 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 implements Converter { + final class JsonResponseBodyConverter implements Converter { private final Gson gson; private final TypeAdapter adapter; + JsonResponseBodyConverter(Gson gson, TypeAdapter 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; } } } \ No newline at end of file diff --git a/common/src/main/java/com/yunbao/common/http/JsonBean.java b/common/src/main/java/com/yunbao/common/http/JsonBean.java index f6c4d927f..d9f1e51c5 100644 --- a/common/src/main/java/com/yunbao/common/http/JsonBean.java +++ b/common/src/main/java/com/yunbao/common/http/JsonBean.java @@ -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 %s has been sent to your personalized dress up Mini blind box Collection blind box - PD blind box + POYO blind box Individual dressing Can be obtained randomly, %s I got %s %s diff --git a/live/src/main/java/com/yunbao/live/activity/LiveActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveActivity.java index c373be3c6..326aa90e0 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveActivity.java @@ -972,7 +972,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL dialog.findViewById(R.id.tv_into).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - String url = CommonAppConfig.HOST + "/index.php?g=Appapi&m=task&a=index&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&tabIndex=1"; + String url = CommonAppConfig.HOST + "/h5/task/index.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&tabIndex=1"; WebViewActivity.forward(mContext, url, true); dialog.dismiss(); } diff --git a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java index 65f3d424e..52b4c534b 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java @@ -457,7 +457,7 @@ public class SocketRyClient { } else if (TextUtils.equals(boxType, "2")) { boxTypeName = WordUtil.isNewZh() ? "典藏盲盒" : "Collection blind box"; } else { - boxTypeName = WordUtil.isNewZh() ? "PD盲盒" : "PD blind box"; + boxTypeName = WordUtil.isNewZh() ? "POYO盲盒" : "POYO blind box"; } AllServerNotifyEvent allServerNotifyEvent = new AllServerNotifyEvent() diff --git a/live/src/main/java/com/yunbao/live/socket/SocketSwClient.java b/live/src/main/java/com/yunbao/live/socket/SocketSwClient.java index 93bad8965..ab6ad5b35 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketSwClient.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketSwClient.java @@ -461,7 +461,7 @@ public class SocketSwClient { } else if (TextUtils.equals(boxType, "2")) { boxTypeName = WordUtil.isNewZh() ? "典藏盲盒" : "Collection blind box"; } else { - boxTypeName = WordUtil.isNewZh() ? "PD盲盒" : "PD blind box"; + boxTypeName = WordUtil.isNewZh() ? "POYO盲盒" : "POYO blind box"; } AllServerNotifyEvent allServerNotifyEvent = new AllServerNotifyEvent().setBlindBoxId(map.getString("blind_box_id")).setBoxType(boxType).setBoxTypeName(boxTypeName).setDressName(WordUtil.isNewZh() ? map.getString("dress_name") : TextUtils.isEmpty(map.getString("dress_nameen")) ? map.getString("dress_name") : map.getString("dress_nameen")).setGiftNotification(map.getString("gift_notification")).setGiftName(WordUtil.isNewZh() ? mCt.getString("giftname") : mCt.getString("giftnameen")).setUserNiceName(map.getString("uname")).setGiftIcon(map.getString("gifticon")).setAnchorName(map.getString("ancherName")).setDisplaySrc(map.getString("display_src")); Log.e("AllServerNotifyEvent", allServerNotifyEvent.toString()); diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index 9e811c460..aceda8ca5 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -5523,7 +5523,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis @Override public void run() { BannerBean bannerBean = new BannerBean(); - bannerBean.setWishlistIcon(model.getWishlistIcon()).setWishlistName(model.getWishlistName()).setWishlistNum(model.getWishlistNum()).setWishlistProgress(model.getWishlistProgress()).setmLink(CommonAppConfig.HOST + "/index.php").setType(1); + bannerBean.setWishlistIcon(model.getWishlistIcon()).setWishlistName(model.getWishlistName()).setWishlistNum(model.getWishlistNum()).setWishlistProgress(model.getWishlistProgress()).setmLink(CommonAppConfig.HOST + "/h5/wish/index.html").setType(1); bannerBean.setShow_type("2"); mTopBannerList.add(bannerBean); LiveChatBean bean = new LiveChatBean(); @@ -6243,7 +6243,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } BannerBean bannerBean = new BannerBean(); - bannerBean.setWishlistIcon(wishListProgress.getWishlistIcon()).setWishlistName(wishListProgress.getWishlistName()).setWishlistNum(wishListProgress.getWishlistNum()).setWishlistProgress(wishListProgress.getWishlistProgress()).setmLink(CommonAppConfig.HOST + "/index.php").setType(1); + bannerBean.setWishlistIcon(wishListProgress.getWishlistIcon()).setWishlistName(wishListProgress.getWishlistName()).setWishlistNum(wishListProgress.getWishlistNum()).setWishlistProgress(wishListProgress.getWishlistProgress()).setmLink(CommonAppConfig.HOST + "/h5/wish/index.html").setType(1); bannerBean.setShow_type("2"); if (mTopBannerList.size() == 1 || mTopBannerList.size() == 0) { mTopBannerList.add(bannerBean); @@ -6302,7 +6302,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo(); String type = ""; StringBuffer htmlUrl = new StringBuffer(); - htmlUrl.append(bean.getLink()).append(bean.getLink().contains("?") ? "&uid=" : "?uid=").append(userInfo.getId()).append("&token=").append(userInfo.getToken()).append("&anchorUid=").append(mLiveUid).append("&liveUid=").append(mLiveUid).append("&t=").append(System.currentTimeMillis()).append("&g=Appapi&m=Wish&a=index").append("&isZh=").append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); + htmlUrl.append(bean.getLink()).append(bean.getLink().contains("?") ? "&uid=" : "?uid=").append(userInfo.getId()).append("&token=").append(userInfo.getToken()).append("&anchorUid=").append(mLiveUid).append("&liveUid=").append(mLiveUid).append("&t=").append(System.currentTimeMillis()).append("&isZh=").append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); if (TextUtils.equals(type, "1")) { ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false, 1); } else { @@ -6357,7 +6357,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo(); String type = ""; StringBuffer htmlUrl = new StringBuffer(); - htmlUrl.append(bean.getLink()).append(bean.getLink().contains("?") ? "&uid=" : "?uid=").append(userInfo.getId()).append("&token=").append(userInfo.getToken()).append("&anchorUid=").append(mLiveUid).append("&liveUid=").append(mLiveUid).append("&t=").append(System.currentTimeMillis()).append("&g=Appapi&m=Wish&a=index").append("&isZh=").append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); + htmlUrl.append(bean.getLink()).append(bean.getLink().contains("?") ? "&uid=" : "?uid=").append(userInfo.getId()).append("&token=").append(userInfo.getToken()).append("&anchorUid=").append(mLiveUid).append("&liveUid=").append(mLiveUid).append("&t=").append(System.currentTimeMillis()).append("&isZh=").append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); if (TextUtils.equals(type, "1")) { ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false, 1); } else { diff --git a/live/src/main/res/layout/view_live_room.xml b/live/src/main/res/layout/view_live_room.xml index d6f9621b3..a88d7aeae 100644 --- a/live/src/main/res/layout/view_live_room.xml +++ b/live/src/main/res/layout/view_live_room.xml @@ -2337,7 +2337,8 @@ android:layout_width="40dp" android:layout_height="50dp" android:layout_marginTop="10dp" - android:visibility="invisible"> + android:visibility="invisible" + tools:visibility="visible"> - + diff --git a/main/src/main/res/layout/activity_entry.xml b/main/src/main/res/layout/activity_entry.xml index 45e2ce5c5..bb561a424 100644 --- a/main/src/main/res/layout/activity_entry.xml +++ b/main/src/main/res/layout/activity_entry.xml @@ -51,7 +51,7 @@ android:src="@mipmap/icon_facebook" /> @@ -120,7 +120,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/login_use_phone" - android:layout_marginLeft="25dp" + android:layout_marginLeft="35dp" android:textColor="@color/black1" android:textSize="14sp" /> @@ -172,6 +172,7 @@ android:id="@+id/lt_login_other" android:layout_width="match_parent" android:layout_height="wrap_content" + android:layout_marginTop="100dp" android:layout_marginLeft="25dp" android:layout_marginRight="25dp" android:orientation="vertical"> diff --git a/main/src/main/res/mipmap-xxxhdpi/white_logo.png b/main/src/main/res/mipmap-xxxhdpi/white_logo.png deleted file mode 100644 index 51a8588ee..000000000 Binary files a/main/src/main/res/mipmap-xxxhdpi/white_logo.png and /dev/null differ