好友
阅读权限 10
听众
最后登录 1970-1-1
一周前看到吾爱破解 ,莫名感觉有点意思,然后不务正业就开始试着研究研究,一个不会编程的新人,昨天尝试着对一个不知名的漫画软件进行破解,
发现没有壳!真的,有壳还能按教程试着去壳,没壳的软件就像脱光的妹纸摆在面前但是就不知道怎么玩!
软件属于看漫画的,前几章免费,后面要扣钻石,我试了内购破解,也试了购买破解,真的一通瞎改啥也不是,求大佬看下程序,指点一下怎么改!
这个软件个别图片尺度较大不敢上,怕被封,我就直接上代码了。一开始尝试了 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[2];
boolean z = HAS_ALIPAY_LIB;
r3[0] = WebView.class;
r3[1] = 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[2];
boolean z = HAS_ALIPAY_LIB;
r3[0] = WebView.class;
r3[1] = 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才能复制,看别人改的都简单的很,自己真心有点懵,求大佬看看再哪里动下手脚就可以了!万分感谢!