柬埔寨通 v6.1.5版本的 MD5 值为:9b68581ac30883219d6a25858a099d6b
以下内容为反编译后的 RedPackOpenActivity.java 源代码,内容仅作参考
package net.duohuo.magappx.main.user.tool;
import android.animation.ObjectAnimator;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.alibaba.fastjson.JSONObject;
import com.facebook.drawee.view.SimpleDraweeView;
import com.huawei.hms.push.constant.RemoteMessageConst;
import com.jianpuzhaitong.forum.R;
import com.umeng.socialize.common.SocializeConstants;
import net.duohuo.core.ProxyTool;
import net.duohuo.core.annotation.Extra;
import net.duohuo.core.ioc.Ioc;
import net.duohuo.core.net.Net;
import net.duohuo.core.net.Result;
import net.duohuo.core.net.Task;
import net.duohuo.core.util.IUtil;
import net.duohuo.core.util.SafeJsonUtil;
import net.duohuo.magapp.chat.MagappChatCore;
import net.duohuo.magappx.API;
import net.duohuo.magappx.UrlScheme;
import net.duohuo.magappx.common.base.LyeahActivity;
import net.duohuo.magappx.video.videorecord.util.SharedPreferencesUtil;
public class RedPackOpenActivity extends LyeahActivity {
public static OnopenCallback onCallBack;
@BindView(R.id.box)
RelativeLayout box;
@BindView(R.id.des)
TextView desV;
@BindView(R.id.detail)
TextView detailV;
@BindView(R.id.head)
SimpleDraweeView headV;
@Extra
String infos;
JSONObject jo;
@BindView(R.id.name)
TextView nameV;
@BindView(R.id.open)
View openV;
@BindView(R.id.subtitle)
TextView subtitleV;
public interface OnopenCallback {
void onOpen();
}
@OnClick({R.id.container})
public void onClick(View view) {
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.read_pack_open_activity);
ButterKnife.bind(this);
ProxyTool.inject(this);
ObjectAnimator.ofFloat(this.box, "translationY", IUtil.dip2px(this, 400.0f), 0.0f).setDuration(200L).start();
JSONObject parseObject = JSONObject.parseObject(this.infos);
this.jo = parseObject;
this.headV.setImageURI(parseObject.getString("user_head"));
this.nameV.setText(this.jo.getString("user_name"));
this.desV.setText(this.jo.getString("des"));
}
@Override
public void finish() {
super.finish();
overridePendingTransition(R.anim.alpha_in, R.anim.alpha_out);
if (onCallBack != null) {
onCallBack = null;
}
}
@OnClick({R.id.open})
public void onClick() {
final ObjectAnimator duration = ObjectAnimator.ofFloat(this.openV, "rotationY", 0.0f, 360.0f).setDuration(500L);
duration.setRepeatCount(100);
duration.start();
Net url = Net.url(API.Common.receiveRedPacket);
url.param("id", this.jo.getString("id"));
url.param("key", this.jo.getString("key"));
url.param("send_userid", SafeJsonUtil.getString(this.jo, SocializeConstants.TENCENT_UID).replace(MagappChatCore.user_prefix, ""));
url.param("group_id", SafeJsonUtil.getString(this.jo, "group_id"));
url.post(new Task<Result>() {
@Override
public void onResult(Result result) {
if (result.success()) {
if (RedPackOpenActivity.onCallBack != null) {
RedPackOpenActivity.onCallBack.onOpen();
}
((SharedPreferencesUtil) Ioc.get(SharedPreferencesUtil.class)).setReceiveState(RedPackOpenActivity.this.jo.getString(RemoteMessageConst.MSGID), true);
if (Integer.valueOf(result.get("data").toString()).intValue() == 1) {
Intent intent = RedPackOpenActivity.this.getIntent();
RedPackOpenActivity.this.jo.put("link", (Object) ("https://app.jpztong.com/mag/operative/v1/redPacket/redpacket?id=" + RedPackOpenActivity.this.jo.getString("id")));
intent.putExtra("infos", RedPackOpenActivity.this.jo.toJSONString());
RedPackOpenActivity.this.setResult(-1, intent);
UrlScheme.toUrl(RedPackOpenActivity.this, "https://app.jpztong.com/mag/operative/v1/redPacket/redpacket?id=" + RedPackOpenActivity.this.jo.getString("id"));
RedPackOpenActivity.this.finish();
} else if (Integer.valueOf(result.get("data").toString()).intValue() == -1) {
UrlScheme.toUrl(RedPackOpenActivity.this, "https://app.jpztong.com/mag/operative/v1/redPacket/redpacket?id=" + RedPackOpenActivity.this.jo.getString("id"));
RedPackOpenActivity.this.finish();
} else if (Integer.valueOf(result.get("data").toString()).intValue() == 0) {
RedPackOpenActivity.this.subtitleV.setVisibility(4);
RedPackOpenActivity.this.desV.setText("手慢了,红包派完了");
RedPackOpenActivity.this.detailV.setVisibility(0);
RedPackOpenActivity.this.openV.setVisibility(8);
}
duration.cancel();
}
}
});
}
@OnClick({R.id.detail})
public void toDetail() {
UrlScheme.toUrl(this, "https://app.jpztong.com/mag/operative/v1/redPacket/redpacket?id=" + this.jo.getString("id"));
finish();
}
@OnClick({R.id.box, R.id.close})
public void onClose(View view) {
finish();
}
}