前言:这几天手机上装了个软件,用了没多久就收费了,颇为不爽,于是便想看看能否破解,便有了下文,请注意该文章只为技术交流,请不要进行非法破解。
软件描述:这个apk使用一定次数后就会扣掉积分 当积分少于0的时候 便不能使用,每次启动程序的时候便会提示积分为0,需要注册,这说明程序在启动的时候就已经检测了积分,刚好可以利用这点
练手软件:
http://pan.baidu.com/share/link?shareid=64695&uk=201738998
1.环境配置 首先请下载好最新的jdk,网络上到处都是,记得配置环境变量,网络都有 其次下载工具(请注意使用的时候所有路径要是英文的)
apktool d xxx.apk
package com.nfbazi.qimen;
import android.app.Activity;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import com.nfbazi.qimen.a.a;
public class activity_register extends Activity
{
a a = new a(this);
private SharedPreferences b;
protected void onCreate(Bundle paramBundle)
{
super.onCreate(paramBundle);
setContentView(2130903043);
EditText localEditText1 = (EditText)findViewById(2131165228);
EditText localEditText2 = (EditText)findViewById(2131165230);
localEditText1.setText(a.o);
localEditText2.setFocusable(true);
localEditText2.setFocusableInTouchMode(true);
Button localButton1 = (Button)findViewById(2131165232);
Button localButton2 = (Button)findViewById(2131165233);
localButton1.setOnClickListener(new bp(this));
localButton2.setOnClickListener(new bo(this));
TextView localTextView = (TextView)findViewById(2131165231);
if (a.q) //如果对象a.q字段不为0
{
localTextView.setTextColor(-16776961); //那么设置文字颜色
localTextView.setText("您已经注册了本程序。"); //设置文本
localEditText2.setText("************"); //设置文本
localEditText2.setEnabled(false); // 将填写注册码的文本框变灰 因为已经注册了
}
}
}
.class public Lcom/nfbazi/qimen/activity_register;
.super Landroid/app/Activity;
# instance fields
.field a:Lcom/nfbazi/qimen/a/a;
.field private b:Landroid/content/SharedPreferences;
# direct methods
.method public constructor <init>()V
.locals 1
invoke-direct {p0}, Landroid/app/Activity;-><init>()V
new-instance v0, Lcom/nfbazi/qimen/a/a;
invoke-direct {v0, p0}, Lcom/nfbazi/qimen/a/a;-><init>(Landroid/content/Context;)V
iput-object v0, p0, Lcom/nfbazi/qimen/activity_register;->a:Lcom/nfbazi/qimen/a/a;
return-void
.end method
.method static synthetic a(Lcom/nfbazi/qimen/activity_register;)Landroid/content/SharedPreferences;
.locals 1
iget-object v0, p0, Lcom/nfbazi/qimen/activity_register;->b:Landroid/content/SharedPreferences;
return-object v0
.end method
.method static synthetic a(Lcom/nfbazi/qimen/activity_register;Landroid/content/SharedPreferences;)V
.locals 0
iput-object p1, p0, Lcom/nfbazi/qimen/activity_register;->b:Landroid/content/SharedPreferences;
return-void
.end method
# virtual methods
.method protected onCreate(Landroid/os/Bundle;)V
.locals 4
const/4 v3, 0x1
invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V
const v0, 0x7f030003
invoke-virtual {p0, v0}, Lcom/nfbazi/qimen/activity_register;->setContentView(I)V
const v0, 0x7f07002c
invoke-virtual {p0, v0}, Lcom/nfbazi/qimen/activity_register;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Landroid/widget/EditText;
const v1, 0x7f07002e
invoke-virtual {p0, v1}, Lcom/nfbazi/qimen/activity_register;->findViewById(I)Landroid/view/View;
move-result-object v1
check-cast v1, Landroid/widget/EditText;
sget-object v2, Lcom/nfbazi/qimen/a/a;->o:Ljava/lang/String;
invoke-virtual {v0, v2}, Landroid/widget/EditText;->setText(Ljava/lang/CharSequence;)V
invoke-virtual {v1, v3}, Landroid/widget/EditText;->setFocusable(Z)V
invoke-virtual {v1, v3}, Landroid/widget/EditText;->setFocusableInTouchMode(Z)V
const v0, 0x7f070030
invoke-virtual {p0, v0}, Lcom/nfbazi/qimen/activity_register;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Landroid/widget/Button;
const v2, 0x7f070031
invoke-virtual {p0, v2}, Lcom/nfbazi/qimen/activity_register;->findViewById(I)Landroid/view/View;
move-result-object v2
check-cast v2, Landroid/widget/Button;
new-instance v3, Lcom/nfbazi/qimen/bp;
invoke-direct {v3, p0}, Lcom/nfbazi/qimen/bp;-><init>(Lcom/nfbazi/qimen/activity_register;)V
invoke-virtual {v0, v3}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V
new-instance v0, Lcom/nfbazi/qimen/bo;
invoke-direct {v0, p0}, Lcom/nfbazi/qimen/bo;-><init>(Lcom/nfbazi/qimen/activity_register;)V
invoke-virtual {v2, v0}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V
const v0, 0x7f07002f
invoke-virtual {p0, v0}, Lcom/nfbazi/qimen/activity_register;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Landroid/widget/TextView;
sget-boolean v2, Lcom/nfbazi/qimen/a/a;->q:Z
if-eqz v2, :cond_0 //这里的if-eqz 就是说 如果v2变量等于0的平方那么就跳...,我们将他删除掉
const v2, -0xffff01 //定义常量v2
invoke-virtual {v0, v2}, Landroid/widget/TextView;->setTextColor(I)V //调用方法设置颜色,参数为v0和v2,那么v2应该是颜色信息
const-string v2, "\u60a8\u5df2\u7ecf\u6ce8\u518c\u4e86\u672c\u7a0b\u5e8f\u3002" //定义字串也就是该程序已经注册
invoke-virtual {v0, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
const-string v0, "************" //将文本框设置为********** 之后再设置为灰色
invoke-virtual {v1, v0}, Landroid/widget/EditText;->setText(Ljava/lang/CharSequence;)V
const/4 v0, 0x0
invoke-virtual {v1, v0}, Landroid/widget/EditText;->setEnabled(Z)V
:cond_0
return-void
.end method
上面部分一样 从这里开始
const v2, -0xffff01
invoke-virtual {v0, v2}, Landroid/widget/TextView;->setTextColor(I)V
const-string v2, "\u60a8\u5df2\u7ecf\u6ce8\u518c\u4e86\u672c\u7a0b\u5e8f\u3002"
invoke-virtual {v0, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
const-string v0, "************"
invoke-virtual {v1, v0}, Landroid/widget/EditText;->setText(Ljava/lang/CharSequence;)V
const/4 v0, 0x0
invoke-virtual {v1, v0}, Landroid/widget/EditText;->setEnabled(Z)V
:cond_0
return-void
.end method
public String d()
{
com.nfbazi.qimen.a.a.a = c();
if (com.nfbazi.qimen.a.a.a < 5);
for (String str = "剩余积分:" + Integer.toString(com.nfbazi.qimen.a.a.a) + " 分。 您的积分不足。" + 10 + "次试用期过后,如果没有注册,还想继续免费使用软件,可点击程序主页面右下角的“获取积分”," + "通过下载安装应用,免费获取一定积分。" + "您也可以付费注册本软件,无需通过积分方式使用。点击程序主页面左下角“菜单”里的帮助,查看如何注册。" + "注册后,不会再有积分事项显示。"; ; str = "剩余积分:" + Integer.toString(com.nfbazi.qimen.a.a.a) + " 分。 每次点击“时家奇门”会“日家奇门”,会消费积分 " + 5 + " 分。")
return str;
}
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课