刚刚看到有兄弟发了第一题的,我来发个第二题先。第一次玩
题目要求
-------------
1.请以重打包的形式将qihootest2.apk的程序包名改为 "com.qihoo.crack.StubApplication",使得在同一手机上面可以重复安装并正确运行;
2.请写个Application类,并在Manifest里面注册你的Application。同时要求使用该Application加载原包的Application;
3.本题3分,以非重打包的方式达到同等效果的不计分。
-------------
题还是很简单的,简单提提就好了
1)改包名:
改包名,简单吧,
1.Manifest : package ,application name,provider 要改
2.smail
a) smail 里面的目录 test -> crack.
b) smail 文件批量替换 com/qihoo/test/ - > com/qihoo/crack
3.so
这个程序有个so里面硬编码了包名,如果目标包名长度短点的话,直接改so就好了,但是他要求改成crack.
我的办法是: 不改so . 写个stub类 com.qihoo.test.MainActivity
----------
android.app.Activity
^
|
com.qihoo.test.MainActivity
^
|
com.qihoo.crack.MainActivity
-------------
native 方法还是放在 com.qihoo.test.MainActivity中
如下:
com.qihoo.test.MainActivity:
.class public Lcom/qihoo/test/MainActivity;
.super Landroid/app/Activity;
.source "MainActivity.java"
# direct methods
.method static constructor <clinit>()V
.locals 1
.prologue
.line 12
const-string v0, "qihooTest"
invoke-static {v0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V
.line 13
return-void
.end method
.method public constructor <init>()V
.locals 0
.prologue
.line 10
invoke-direct {p0}, Landroid/app/Activity;-><init>()V
return-void
.end method
.method public native applicatioNameCheck()V
.end method
.method public native packageNameCheck()V
.end method
com.qihoo.crack.MainActivity:
.class public Lcom/qihoo/crack/MainActivity;
.super Lcom/qihoo/test/MainActivity;
.source "MainActivity.java"
# instance fields
.field private app:Lcom/qihoo/crack/StubApplication;
........................
........................
这就差不多了
2)写个Application
那就写个呗。
.class public Lcom/qihoo/crack/XiaoApplication;
.super Landroid/app/Application;
.source "XiaoApplication.java"
# instance fields
.field private stubapp:Lcom/qihoo/crack/StubApplication;
# direct methods
.method public constructor <init>()V
.locals 0
.prologue
.line 5
invoke-direct {p0}, Landroid/app/Application;-><init>()V
return-void
.end method
.method public onCreate()V
.locals 1
.prologue
.line 14
invoke-super {p0}, Landroid/app/Application;->onCreate()V
new-instance v0, Lcom/qihoo/crack/StubApplication;
invoke-direct {v0}, Lcom/qihoo/crack/StubApplication;-><init>()V
iput-object v0,p0, Lcom/qihoo/crack/XiaoApplication;->stubapp:Lcom/qihoo/crack/StubApplication;
invoke-virtual {v0}, Lcom/qihoo/crack/StubApplication;->getvalue()[I
move-result-object v0
.line 15
return-void
.end method
.method public onLowMemory()V
.locals 0
.prologue
.line 25
invoke-super {p0}, Landroid/app/Application;->onLowMemory()V
.line 26
return-void
.end method
.method public onTerminate()V
.locals 0
.prologue
.line 32
invoke-super {p0}, Landroid/app/Application;->onTerminate()V
.line 33
return-void
.end method
完。
大家也来讨论下自己的思路。
下面请大家畅所欲言.
更新:
-------------
1) 5/14 21:22 添加rebuild apk
-------------
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!