小白第一次内购破解,止步于程序修改,一个不知名漫画软件。求大佬指点
一周前看到吾爱破解,莫名感觉有点意思,然后不务正业就开始试着研究研究,一个不会编程的新人,昨天尝试着对一个不知名的漫画软件进行破解,发现没有壳!真的,有壳还能按教程试着去壳,没壳的软件就像脱光的妹纸摆在面前但是就不知道怎么玩!
软件属于看漫画的,前几章免费,后面要扣钻石,我试了内购破解,也试了购买破解,真的一通瞎改啥也不是,求大佬看下程序,指点一下怎么改!
这个软件个别图片尺度较大不敢上,怕被封,我就直接上代码了。一开始尝试了 PAY SUCCESS之类的,发现都没有用,因为这个付费直接跳转微信或支付宝,返回无失败痰喘
后来搜索WEIXIN,找到了充值的代码
然后看着代码发了很久的呆,虽然懂点逻辑,但是看着这玩意,真的是懵逼了。总感觉代码这玩意跟妹纸一样,好脱不好上呀。下面上代码
//
// Decompiled by Jadx (from NP Manager)
//
package com.just.agentweb;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Handler.Callback;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.webkit.HttpAuthHandler;
import android.webkit.WebResourceError;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import java.lang.ref.WeakReference;
import java.lang.reflect.Method;
import java.net.URISyntaxException;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
public class DefaultWebClient extends MiddlewareWebClientBase {
public static final String ALIPAYS_SCHEME = "alipays://";
private static final String ANDROID_WEBVIEWCLIENT_PATH = "android.webkit.WebViewClient";
public static final int ASK_USER_OPEN_OTHER_PAGE = 250;
private static final int CONSTANTS_ABNORMAL_BIG = 7;
public static final int DERECT_OPEN_OTHER_PAGE = 1001;
public static final int DISALLOW_OPEN_OTHER_APP = 62;
private static final boolean HAS_ALIPAY_LIB;
public static final String HTTPS_SCHEME = "https://";
public static final String HTTP_SCHEME = "http://";
public static final String INTENT_SCHEME = "intent://";
public static final String SCHEME_SMS = "sms:";
private static final String TAG = "DefaultWebClient";
public static final String WEBCHAT_PAY_SCHEME = "weixin://wap/pay?";
private WeakReference<AbsAgentWebUIController> mAgentWebUIController = null;
private Callback mCallback = null;
private Set<String> mErrorUrlsSet = new HashSet();
private boolean mIsInterceptUnkownUrl = true;
private Object mPayTask;
private int mUrlHandleWays = ASK_USER_OPEN_OTHER_PAGE;
private Set<String> mWaittingFinishSet = new HashSet();
private WeakReference<Activity> mWeakReference = null;
private WebView mWebView;
private WebViewClient mWebViewClient;
private Method onMainFrameErrorMethod = null;
private boolean webClientHelper = true;
DefaultWebClient(Builder builder) {
super(Builder.access$000(builder));
this.mWebView = Builder.access$100(builder);
this.mWebViewClient = Builder.access$000(builder);
this.mWeakReference = new WeakReference(Builder.access$200(builder));
this.webClientHelper = Builder.access$300(builder);
this.mAgentWebUIController = new WeakReference(AgentWebUtils.getAgentWebUIControllerByWebView(Builder.access$100(builder)));
this.mIsInterceptUnkownUrl = Builder.access$400(builder);
if (Builder.access$500(builder) <= 0) {
this.mUrlHandleWays = ASK_USER_OPEN_OTHER_PAGE;
} else {
this.mUrlHandleWays = Builder.access$500(builder);
}
}
public boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) {
Object obj;
r3 = new Class;
boolean z = HAS_ALIPAY_LIB;
r3 = WebView.class;
r3 = WebResourceRequest.class;
if (!AgentWebUtils.isOverriedMethod(this.mWebViewClient, "shouldOverrideUrlLoading", "android.webkit.WebViewClient.shouldOverrideUrlLoading", r3)) {
obj = -1;
} else if (super.shouldOverrideUrlLoading(webView, webResourceRequest)) {
return true;
} else {
obj = 1;
}
String uri = webResourceRequest.getUrl().toString();
if (!uri.startsWith(HTTP_SCHEME)) {
if (!uri.startsWith(HTTPS_SCHEME)) {
if (!this.webClientHelper) {
return HAS_ALIPAY_LIB;
}
if (handleCommonLink(uri)) {
return true;
}
String str;
if (uri.startsWith(INTENT_SCHEME)) {
handleIntentUrl(uri);
LogUtils.i(TAG, "intent url ");
return true;
} else if (uri.startsWith(WEBCHAT_PAY_SCHEME)) {
LogUtils.i(TAG, "lookup wechat to pay ~~");
startActivity(uri);
return true;
} else if (uri.startsWith(ALIPAYS_SCHEME) && lookup(uri)) {
LogUtils.i(TAG, "alipays url lookup alipay ~~ ");
return true;
} else if (queryActiviesNumber(uri) > 0 && urlOpenWays(uri)) {
str = TAG;
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("intercept url:");
stringBuilder.append(uri);
LogUtils.i(str, stringBuilder.toString());
return true;
} else if (!this.mIsInterceptUnkownUrl) {
return obj > null ? HAS_ALIPAY_LIB : super.shouldOverrideUrlLoading(webView, webResourceRequest);
} else {
str = TAG;
StringBuilder stringBuilder2 = new StringBuilder();
stringBuilder2.append("intercept mIsInterceptUnkownUrl :");
stringBuilder2.append(webResourceRequest.getUrl());
LogUtils.i(str, stringBuilder2.toString());
return true;
}
}
}
if (this.webClientHelper && HAS_ALIPAY_LIB) {
z = true;
}
return z;
}
public boolean shouldOverrideUrlLoading(WebView webView, String str) {
Object obj;
r3 = new Class;
boolean z = HAS_ALIPAY_LIB;
r3 = WebView.class;
r3 = String.class;
if (!AgentWebUtils.isOverriedMethod(this.mWebViewClient, "shouldOverrideUrlLoading", "android.webkit.WebViewClient.shouldOverrideUrlLoading", r3)) {
obj = -1;
} else if (super.shouldOverrideUrlLoading(webView, str)) {
return true;
} else {
obj = 1;
}
if (!str.startsWith(HTTP_SCHEME)) {
if (!str.startsWith(HTTPS_SCHEME)) {
if (!this.webClientHelper) {
return HAS_ALIPAY_LIB;
}
if (handleCommonLink(str)) {
return true;
}
if (str.startsWith(INTENT_SCHEME)) {
handleIntentUrl(str);
return true;
} else if (str.startsWith(WEBCHAT_PAY_SCHEME)) {
startActivity(str);
return true;
} else if (str.startsWith(ALIPAYS_SCHEME) && lookup(str)) {
return true;
} else {
if (queryActiviesNumber(str) > 0 && urlOpenWays(str)) {
LogUtils.i(TAG, "intercept OtherAppScheme");
return true;
} else if (!this.mIsInterceptUnkownUrl) {
return obj > null ? HAS_ALIPAY_LIB : super.shouldOverrideUrlLoading(webView, str);
} else {
String str2 = TAG;
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("intercept InterceptUnkownScheme : ");
stringBuilder.append(str);
LogUtils.i(str2, stringBuilder.toString());
return true;
}
}
}
}
if (this.webClientHelper && HAS_ALIPAY_LIB) {
z = true;
}
return z;
}
private boolean handleCommonLink(String str) {
if (!(str.startsWith("tel:") || str.startsWith(SCHEME_SMS) || str.startsWith("mailto:"))) {
if (!str.startsWith("geo:0,0?q=")) {
return HAS_ALIPAY_LIB;
}
}
try {
Activity activity = (Activity) this.mWeakReference.get();
if (activity == null) {
return HAS_ALIPAY_LIB;
}
Intent intent = new Intent("android.intent.action.VIEW");
intent.setData(Uri.parse(str));
activity.startActivity(intent);
return true;
} catch (ActivityNotFoundException e) {
if (AgentWebConfig.DEBUG) {
e.printStackTrace();
}
}
}
/* JADX WARNING: Missing block: B:7:0x0037, code:
if (r0 != null) goto L_0x0039;
*/
/* Code decompiled incorrectly, please refer to instructions dump. */
private void onMainFrameError(WebView webView, int i, String str, String str2) {
this.mErrorUrlsSet.add(str2);
if (this.mWebViewClient != null && this.webClientHelper) {
Method method = this.onMainFrameErrorMethod;
if (method == null) {
method = AgentWebUtils.isExistMethod(this.mWebViewClient, "onMainFrameError", new Class[]{AbsAgentWebUIController.class, WebView.class, Integer.TYPE, String.class, String.class});
this.onMainFrameErrorMethod = method;
}
try {
method.invoke(this.mWebViewClient, new Object[]{this.mAgentWebUIController.get(), webView, Integer.valueOf(i), str, str2});
} catch (Throwable th) {
if (LogUtils.isDebug()) {
th.printStackTrace();
}
}
return;
}
if (this.mAgentWebUIController.get() != null) {
((AbsAgentWebUIController) this.mAgentWebUIController.get()).onMainFrameError(webView, i, str, str2);
}
}
public void onPageFinished(WebView webView, String str) {
if (this.mErrorUrlsSet.contains(str) || !this.mWaittingFinishSet.contains(str)) {
webView.setVisibility(0);
} else if (this.mAgentWebUIController.get() != null) {
((AbsAgentWebUIController) this.mAgentWebUIController.get()).onShowMainFrame();
}
if (this.mWaittingFinishSet.contains(str)) {
this.mWaittingFinishSet.remove(str);
}
if (!this.mErrorUrlsSet.isEmpty()) {
this.mErrorUrlsSet.clear();
}
super.onPageFinished(webView, str);
}
private boolean lookup(String str) {
try {
Activity activity = (Activity) this.mWeakReference.get();
if (activity == null) {
return true;
}
PackageManager packageManager = activity.getPackageManager();
Intent parseUri = Intent.parseUri(str, 1);
if (packageManager.resolveActivity(parseUri, 65536) != null) {
activity.startActivity(parseUri);
return true;
}
return HAS_ALIPAY_LIB;
} catch (Throwable th) {
if (LogUtils.isDebug()) {
th.printStackTrace();
}
}
}
private int queryActiviesNumber(String str) {
try {
if (this.mWeakReference.get() == null) {
return 0;
}
List queryIntentActivities = ((Activity) this.mWeakReference.get()).getPackageManager().queryIntentActivities(Intent.parseUri(str, 1), 65536);
return queryIntentActivities == null ? 0 : queryIntentActivities.size();
} catch (URISyntaxException e) {
if (LogUtils.isDebug()) {
e.printStackTrace();
}
return 0;
}
}
private void startActivity(String str) {
try {
if (this.mWeakReference.get() != null) {
Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW");
intent.setData(Uri.parse(str));
((Activity) this.mWeakReference.get()).startActivity(intent);
}
} catch (Exception e) {
if (LogUtils.isDebug()) {
e.printStackTrace();
}
}
}
private boolean urlOpenWays(String str) {
int i = this.mUrlHandleWays;
if (i == ASK_USER_OPEN_OTHER_PAGE) {
if (this.mAgentWebUIController.get() != null) {
((AbsAgentWebUIController) this.mAgentWebUIController.get()).onOpenPagePrompt(this.mWebView, this.mWebView.getUrl(), getCallback(str));
}
return true;
} else if (i != DERECT_OPEN_OTHER_PAGE) {
return HAS_ALIPAY_LIB;
} else {
lookup(str);
return true;
}
}
public void onReceivedError(WebView webView, WebResourceRequest webResourceRequest, WebResourceError webResourceError) {
if (AgentWebUtils.isOverriedMethod(this.mWebViewClient, "onReceivedError", "android.webkit.WebViewClient.onReceivedError", new Class[]{WebView.class, WebResourceRequest.class, WebResourceError.class})) {
super.onReceivedError(webView, webResourceRequest, webResourceError);
}
if (webResourceRequest.isForMainFrame()) {
onMainFrameError(webView, webResourceError.getErrorCode(), webResourceError.getDescription().toString(), webResourceRequest.getUrl().toString());
}
String str = TAG;
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("onReceivedError:");
stringBuilder.append(webResourceError.toString());
LogUtils.i(str, stringBuilder.toString());
}
private void handleIntentUrl(String str) {
try {
if (!TextUtils.isEmpty(str)) {
if (str.startsWith(INTENT_SCHEME)) {
if (!lookup(str)) {
}
}
}
} catch (Throwable th) {
if (LogUtils.isDebug()) {
th.printStackTrace();
}
}
}
public void onReceivedError(WebView webView, int i, String str, String str2) {
if (AgentWebUtils.isOverriedMethod(this.mWebViewClient, "onReceivedError", "android.webkit.WebViewClient.onReceivedError", new Class[]{WebView.class, Integer.TYPE, String.class, String.class})) {
super.onReceivedError(webView, i, str, str2);
}
String str3 = TAG;
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("onReceivedError:");
stringBuilder.append(str);
stringBuilder.append("CODE:");
stringBuilder.append(i);
LogUtils.i(str3, stringBuilder.toString());
onMainFrameError(webView, i, str, str2);
}
public void onScaleChanged(WebView webView, float f, float f2) {
if (AgentWebUtils.isOverriedMethod(this.mWebViewClient, "onScaleChanged", "android.webkit.WebViewClient.onScaleChanged", new Class[]{WebView.class, Float.TYPE, Float.TYPE})) {
super.onScaleChanged(webView, f, f2);
return;
}
String str = TAG;
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("onScaleChanged:");
stringBuilder.append(f);
stringBuilder.append(" n:");
stringBuilder.append(f2);
LogUtils.i(str, stringBuilder.toString());
if (f2 - f > 7.0f) {
webView.setInitialScale((int) ((f / f2) * 100.0f));
}
}
static {
boolean z;
try {
Class.forName("com.alipay.sdk.app.PayTask");
z = true;
} catch (Throwable unused) {
z = HAS_ALIPAY_LIB;
}
HAS_ALIPAY_LIB = z;
String str = TAG;
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("HAS_ALIPAY_LIB:");
stringBuilder.append(HAS_ALIPAY_LIB);
LogUtils.i(str, stringBuilder.toString());
}
private Callback getCallback(String str) {
if (this.mCallback != null) {
return this.mCallback;
}
1 1 = new 1(this, str);
this.mCallback = 1;
return 1;
}
public void onPageStarted(WebView webView, String str, Bitmap bitmap) {
if (!this.mWaittingFinishSet.contains(str)) {
this.mWaittingFinishSet.add(str);
}
super.onPageStarted(webView, str, bitmap);
}
public static Builder createBuilder() {
return new Builder();
}
public void onReceivedHttpAuthRequest(WebView webView, HttpAuthHandler httpAuthHandler, String str, String str2) {
super.onReceivedHttpAuthRequest(webView, httpAuthHandler, str, str2);
}
public void onReceivedHttpError(WebView webView, WebResourceRequest webResourceRequest, WebResourceResponse webResourceResponse) {
super.onReceivedHttpError(webView, webResourceRequest, webResourceResponse);
}
public WebResourceResponse shouldInterceptRequest(WebView webView, WebResourceRequest webResourceRequest) {
return super.shouldInterceptRequest(webView, webResourceRequest);
}
public WebResourceResponse shouldInterceptRequest(WebView webView, String str) {
return super.shouldInterceptRequest(webView, str);
}
public boolean shouldOverrideKeyEvent(WebView webView, KeyEvent keyEvent) {
return super.shouldOverrideKeyEvent(webView, keyEvent);
}
}
不知道怎么弄成别的代码的文档,只能复制直接传了,转JAVA才能复制,看别人改的都简单的很,自己真心有点懵,求大佬看看再哪里动下手脚就可以了!万分感谢!
又找个购买的文件,也试了半天,搞不定内购,有没有大佬给个负购买的破解程序方法也行呀
//
// Decompiled by Jadx (from NP Manager)
//
package com.jfkj.manhua.ui;
import android.content.Intent;
import android.net.Uri;
import android.os.Handler;
import android.support.constraint.ConstraintLayout;
import android.support.v7.app.AlertDialog.Builder;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.Html;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import butterknife.BindView;
import com.facebook.drawee.view.SimpleDraweeView;
import com.jfkj.manhua.ad_com.AdManager;
import com.jfkj.manhua.adapter.ComicPictureRvAdapter;
import com.jfkj.manhua.adapter.HeaderAndFooterWrapper;
import com.jfkj.manhua.base.BaseToolbarActivity;
import com.jfkj.manhua.been.AdBeen.Ad;
import com.jfkj.manhua.been.ComicBeen;
import com.jfkj.manhua.been.Episode;
import com.jfkj.manhua.constants.Constant;
import com.jfkj.manhua.constract.GetComicPictureConstract.View;
import com.jfkj.manhua.presenter.GetComicPicturePresenterImpl;
import com.jfkj.manhua.ucm.UcmManager;
import com.jfkj.manhua.utils.ComicLog;
import com.jfkj.manhua.utils.NormalTool;
import com.jfkj.manhua.utils.OkHttpUtil;
import com.jfkj.manhua.utils.ProgressDialogUtil;
import com.jfkj.manhua.utils.SPUtil;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Random;
public class ComicPictureActivity extends BaseToolbarActivity implements View {
public static final int AD_COUNT = 3;
public static int FIRST_AD_POSITION = 4;
public static int ITEMS_PER_AD = 5;
public static final int MAX_ITEMS = 50;
private static final String TAG = "ComicPictureActivity";
public static final String action = "historyupdate.broadcast.action";
private boolean hasPause = false;
private List<? extends android.view.View> mAdViewList;
private HashMap<android.view.View, Integer> mAdViewPositionMap = new HashMap();
private ComicPictureRvAdapter mAdapter;
private String mCartoonID;
private ComicBeen mComicBeen;
private int mCurrentPos = 0;
private Episode mEpisode;
private List<Episode> mEpisodeList;
private HeaderAndFooterWrapper mHeaderAndFooterWrapper;
private GetComicPicturePresenterImpl mPresenter;
@BindView(2131230960)
RecyclerView mRvPicture;
private List<String> mUrlList;
private WebView mWebView;
private void initHeaderAndFooter() {
this.mHeaderAndFooterWrapper = new HeaderAndFooterWrapper(this.mAdapter);
android.view.View inflate = LayoutInflater.from(this).inflate(2131361863, this.mRvPicture, false);
LinearLayout linearLayout = (LinearLayout) inflate.findViewById(2131230750);
if (!(ComicApplication.getmAdBeen() == null || ComicApplication.getmAdBeen().getChapter() == null || ComicApplication.getmAdBeen().getChapter().size() <= 0)) {
ArrayList chapter = ComicApplication.getmAdBeen().getChapter();
Ad ad = (Ad) chapter.get(new Random().nextInt(chapter.size()));
if (ad != null) {
linearLayout.setVisibility(0);
int screenWidth = NormalTool.getScreenWidth(ComicApplication.getContext());
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("screen X:");
stringBuilder.append(screenWidth);
ComicLog.e(stringBuilder.toString());
if (ad.getAd_type().equals("img")) {
SimpleDraweeView simpleDraweeView = new SimpleDraweeView(this);
LayoutParams layoutParams = new LayoutParams(screenWidth, -2);
layoutParams.setMargins(20, 10, 20, 10);
linearLayout.addView(simpleDraweeView, layoutParams);
NormalTool.setControllerListener(simpleDraweeView, ad.getImg(), screenWidth);
simpleDraweeView.setOnClickListener(new 5(this, ad));
} else if (ad.getAd_type().equals("text")) {
TextView textView = new TextView(this);
textView.setText(Html.fromHtml(ad.getText()));
RelativeLayout relativeLayout = new RelativeLayout(this);
RelativeLayout.LayoutParams layoutParams2 = new LayoutParams(-2, -2);
layoutParams2.addRule(14);
relativeLayout.addView(textView, layoutParams2);
LayoutParams layoutParams3 = new LayoutParams(screenWidth, -2);
layoutParams3.setMargins(20, 10, 20, 10);
linearLayout.addView(relativeLayout, layoutParams3);
textView.setOnClickListener(new 5(this, ad));
}
}
}
((Button) inflate.findViewById(2131230781)).setOnClickListener(new 7(this));
((Button) inflate.findViewById(2131230779)).setOnClickListener(new 8(this));
((Button) inflate.findViewById(2131230780)).setOnClickListener(new 9(this));
this.mHeaderAndFooterWrapper.addFootView(inflate);
this.mRvPicture.setAdapter(this.mHeaderAndFooterWrapper);
}
protected void initView() {
getSupportActionBar().setDisplayShowTitleEnabled(false);
setTitle(this.mEpisode.getTitle());
this.mRvPicture.setLayoutManager(new LinearLayoutManager(this, 1, false));
this.mRvPicture.setItemAnimator(new DefaultItemAnimator());
ProgressDialogUtil.showDefaultDialog(this);
this.mPresenter.getScriptData(this.mCartoonID, this.mEpisode.getNo());
initHeaderAndFooter();
int intValue = Integer.valueOf(this.mEpisode.getCost()).intValue();
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("cost:");
stringBuilder.append(intValue);
ComicLog.e(stringBuilder.toString());
if (intValue <= 0 && UcmManager.getInstance().getConfig(UcmManager.CONFIG_AD_OPEN_3).equals("1")) {
ComicLog.e("CONFIG_AD_OPEN_3:", "1");
if (UcmManager.getInstance().getConfig(UcmManager.CONFIG_AD_SWITCH_3).equals("0")) {
ComicLog.e("CONFIG_AD_SWITCH_3:", "0");
AdManager.geInstance().fetchAd(this, 4);
new Handler().postDelayed(new 2(this), 5000);
} else if (UcmManager.getInstance().getConfig(UcmManager.CONFIG_AD_SWITCH_3).equals("1")) {
ConstraintLayout constraintLayout = (ConstraintLayout) findViewById(2131230809);
SimpleDraweeView simpleDraweeView = (SimpleDraweeView) findViewById(2131230753);
String config = UcmManager.getInstance().getConfig("xiangqing_pic_1");
String config2 = UcmManager.getInstance().getConfig("xiangqing_gourl_1");
if (!(TextUtils.isEmpty(config) || TextUtils.isEmpty(config2))) {
constraintLayout.setVisibility(0);
simpleDraweeView.setImageURI(Uri.parse(config));
simpleDraweeView.setOnClickListener(new 3(this, config2, constraintLayout));
((ImageView) findViewById(2131230800)).setOnClickListener(new 4(this, constraintLayout));
}
}
}
}
public boolean onOptionsItemSelected(MenuItem menuItem) {
int i = 1;
switch (menuItem.getItemId()) {
case 16908332:
finish();
return true;
case 2131230916:
onPreClick();
break;
case 2131230918:
try {
String string = SPUtil.getString("cur_domain", "默认源");
String config = UcmManager.getInstance().getConfig("backurl_pic_key_1");
String config2 = UcmManager.getInstance().getConfig("backurl_pic_key_2");
Builder builder = new Builder(this);
builder.setTitle("切换图片源");
String[] strArr = TextUtils.isEmpty(config) ? new String[]{"默认源"} : TextUtils.isEmpty(config2) ? new String[]{"默认源", "线路1"} : new String[]{"默认源", "线路1", "线路2"};
if (string.equals("默认源")) {
i = 0;
} else {
if (string.equals(config)) {
if (strArr.length > 1) {
}
} else if (string.equals(config2) && strArr.length > 2) {
i = 2;
}
i = -1;
}
builder.setSingleChoiceItems(strArr, i, new 17(this, strArr, config, config2));
builder.show();
break;
} catch (Exception e) {
e.printStackTrace();
break;
}
case 2131230920:
onNextClick();
break;
case 2131230923:
this.mPresenter.getScriptData(this.mCartoonID, this.mEpisode.getNo());
break;
default:
break;
}
return super.onOptionsItemSelected(menuItem);
}
public void getError(String str, int i) {
ProgressDialogUtil.dismiss();
if (i == 0) {
showToast(str);
} else if (i == 1) {
new Builder(this).setTitle("提示").setMessage("钻石不足,是否充值").setNegativeButton("退出", new 13(this)).setPositiveButton("充值", new 12(this)).create().show();
} else if (i == 2) {
new Builder(this).setTitle("提示").setMessage("是否登陆").setNegativeButton("取消", new 15(this)).setPositiveButton("确定", new 14(this)).create().show();
} else if (i == 3) {
Intent intent = new Intent(this, MoreBookActivity.class);
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(this.mCartoonID);
stringBuilder.append("");
intent.putExtra("cartoon_id", stringBuilder.toString());
startActivity(intent);
finish();
}
}
private void onNextClick() {
Intent intent;
if (this.mCurrentPos >= this.mEpisodeList.size() - 1) {
Toast.makeText(this, "当前是最后一章了", 0).show();
intent = new Intent(this, MoreBookActivity.class);
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(this.mCartoonID);
stringBuilder.append("");
intent.putExtra("cartoon_id", stringBuilder.toString());
startActivity(intent);
finish();
return;
}
intent = new Intent(this, ComicPictureActivity.class);
intent.putExtra("Episode", (Serializable) this.mEpisodeList.get(this.mCurrentPos + 1));
intent.putExtra("Cartoon_id", this.mCartoonID);
intent.putExtra("Episodes", (Serializable) this.mEpisodeList);
intent.putExtra("Position", this.mCurrentPos + 1);
intent.putExtra("comicBeen", this.mComicBeen);
startActivity(intent);
}
protected void initData() {
this.mEpisode = (Episode) getIntent().getSerializableExtra("Episode");
this.mCartoonID = getIntent().getStringExtra("Cartoon_id");
this.mComicBeen = (ComicBeen) getIntent().getSerializableExtra("comicBeen");
this.mEpisodeList = (List) getIntent().getSerializableExtra("Episodes");
this.mCurrentPos = getIntent().getIntExtra("Position", 0);
ComicBeen comicBeen = this.mComicBeen;
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(this.mCurrentPos);
stringBuilder.append("");
comicBeen.setLastReadPoint(stringBuilder.toString());
this.mPresenter = new GetComicPicturePresenterImpl(this);
this.mUrlList = new ArrayList();
this.mAdapter = new ComicPictureRvAdapter();
this.mAdapter.updateData(this.mUrlList);
saveHistoryRead(this.mComicBeen, this.mCurrentPos, this.mEpisode.getTitle());
}
private void onPreClick() {
if (this.mCurrentPos <= 0) {
Toast.makeText(this, "当前是第一章", 0).show();
return;
}
Intent intent = new Intent(this, ComicPictureActivity.class);
intent.putExtra("Episode", (Serializable) this.mEpisodeList.get(this.mCurrentPos - 1));
intent.putExtra("Cartoon_id", this.mCartoonID);
intent.putExtra("Episodes", (Serializable) this.mEpisodeList);
intent.putExtra("Position", this.mCurrentPos - 1);
intent.putExtra("comicBeen", this.mComicBeen);
startActivity(intent);
}
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
setIntent(intent);
initData();
initView();
initListener();
}
public static String getDomain(String str) {
String str2 = "";
if (TextUtils.isEmpty(str) || !str.startsWith("http")) {
return str2;
}
try {
str = Uri.parse(str).getHost();
return (TextUtils.isEmpty(str) || !str.contains(".")) ? str2 : str.substring(str.indexOf(".") + 1, str.length());
} catch (Exception unused) {
return str2;
}
}
private void beginChongzhi() {
HashMap generateParams = NormalTool.generateParams("common.getpayurl");
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("common.getpayurl params:");
stringBuilder.append(generateParams.toString());
ComicLog.e(stringBuilder.toString());
OkHttpUtil.getInstance().postAsync(Constant.PUBLISH_SERVER, new 16(this), generateParams);
}
protected void onPause() {
super.onPause();
ComicLog.e("onPause");
this.hasPause = true;
}
protected void onResume() {
super.onResume();
ComicLog.e("onResume");
this.hasPause = false;
}
protected void onStop() {
super.onStop();
ComicLog.e("onStop");
this.hasPause = true;
}
private void onMuluClick() {
startActivity(new Intent(this, ComicItemActivity.class));
}
private void saveHistoryRead(ComicBeen comicBeen, int i, String str) {
new Thread(new 1(this, comicBeen, i, str)).start();
}
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(2131427330, menu);
return super.onCreateOptionsMenu(menu);
}
protected void onDestroy() {
super.onDestroy();
this.hasPause = true;
}
public void getComicPictureSuccess(List<String> list) {
runOnUiThread(new 11(this, list));
}
protected void initListener() {
this.mAdapter.setOnClickHolderInside(new 10(this));
}
public void getScriptDataSuccess(String str) {
}
protected int setLayoutResID() {
return 2131361820;
}
} java里面的内容大概倒是看得懂,if语句里面的判定结果全部改成支付成功的判定,但是切换到dex里面就不知道怎么改了 软件发过来,玩玩可以不 dex的if语句主要是通过比较(通常是跟0比较)来实行的,楼主可以多看看类似eqz,nez之类的关键词
页:
[1]