钟文昌:Android平台的开发策略

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

51
Copyright 2009 - 2012
www.mask.org.tw All rights reserved.
52
Copyright 2009 - 2012
www.mask.org.tw All rights reserved.
53
Copyright 2009 - 2012
www.mask.org.tw All rights reserved.
43 Copyright 2009 - 2012 www.mask.org.tw All rights reserved.
Dalvik Opcodes
• • • • • • • • •
44
nop move vx,vy return vx const vx, lit32 filled-new-array {parameters},type_id iget vx, vy, field_id iput vx,vy, field_id invoke-virtual { parameters }, methodtocall invoke-direct { parameters }, methodtocall
www.mask.org.tw All rights reserved.
Android
Slides from "Android Anatomy and Physiology“, Patrick Brady ©
8
Copyright 2009 - 2012
www.mask.org.tw All rights reserved.
(Mask) mask.chung@gmail.com http://www.mask.org.tw http://www.mask.org.tw/blog 时间 2012.10.20 (50min) 2012 动开发 会
Android
开发
讲纯属个
为 业
2
License Announcement
开发
• Google • 场 • 术 •
18 Copyright 2009 - 2012 www.mask.org.tw All rights reserved.
• • •
19 Copyright 2009 - 2012 www.mask.org.tw All rights reserved.

Before
After
54
Copyright 2009 - 2012
www.mask.org.tw All rights reserved.
Before After
55 Copyright 2009 - 2012 www.mask.org.tw All rights reserved.
Reference
37
Copyright 2009 - 2012
www.mask.org.tw All rights reserved.
38
Copyright 2009 - 2012
www.mask.org.tw All rights reserved.
39
Copyright 2009 - 2012
www.mask.org.tw All rights reserved.
www.mask.org.tw All rights reserved.
Android Application
Java xml
resource
.apk
34 Copyright 2009 - 2012 www.mask.org.tw All rights reserved.
Android Project
49
Copyright 2009 - 2012
www.mask.org.tw All rights reserved.
50
Copyright 2009 - 2012
www.mask.org.tw All rights reserved.
Puts the 4 bit constant into v3 Move the object reference in v26 to v0 Invokes interface method using Move the return value of a previous method invocation into p4 parameters in v0,v2,v3 Instantiates an object and puts its reference into v2 Moves p4 into v1 Invoke the constructor of LevleManager Puts the object reference in v2 into LevelManager:mLevelManager. The LevelManager instance is referenced by v0
28
How ARM Works
• arm-none-linux-gnueabi-gcc -S test.c
• more test.s
29 Copyright 2009 - 2012 www.mask.org.tw All rights reserved.
How JNI Works
• ...
30
Copyright 2009 - 2012
Copyright 2009 - 2012 www.mask.org.tw All rights reserved.
reverse
re-pack
45
Copyright 2009 ห้องสมุดไป่ตู้ 2012
www.mask.org.tw All rights reserved.
• Dalvik registers operated as local variables • Each method has a fresh set of registers
• • • • • • •
56
http://www.mask.org.tw http://www.mask.org.tw/blog http://www.sourceforge.net/projects/android-pax270 http://source.android.com/tech/dalvik/index.html http://pallergabor.uw.hu/androidblog/ dalvik_opcodes.html http://hitcon.org/hit2011/ http://developer.android.com/
Android Architecture
!
11
Copyright 2009 - 2012
www.mask.org.tw All rights reserved.
Code Flow
!
12
Copyright 2009 - 2012
www.mask.org.tw All rights reserved.
Just for Fun Free Your Mind & Crazy Hacking
26
I know nothing for Android How do I hack ?
27
Thinking... The incredible hacking always from the thinking...
2006 XScale
4
Agenda
开发 • Android • Hacking for Fun
6
Copyright 2009 - 2012
www.mask.org.tw All rights reserved.
Agenda
开发 • Android • Hacking for Fun
7
Copyright 2009 - 2012

•软 •

24
Copyright 2009 - 2012
www.mask.org.tw All rights reserved.
Agenda
• Android • Hacking for Fun
25
Copyright 2009 - 2012
www.mask.org.tw All rights reserved.
46
Copyright 2009 - 2012
www.mask.org.tw All rights reserved.
47
Copyright 2009 - 2012
www.mask.org.tw All rights reserved.
48
Copyright 2009 - 2012
www.mask.org.tw All rights reserved.
• All reference data followed by its original
license
3
Copyright 2009 - 2012
www.mask.org.tw All rights reserved.
http://www.sourceforge.net/projects/android-pxa270
31 Copyright 2009 - 2012 www.mask.org.tw All rights reserved.
32
Copyright 2009 - 2012
www.mask.org.tw All rights reserved.

开发
Java xml
resource
33
Copyright 2009 - 2012
• 组 • 纯软 •软
20

开发
Copyright 2009 - 2012
www.mask.org.tw All rights reserved.

• • •
21
产业
动医疗
车载
Copyright 2009 - 2012
www.mask.org.tw All rights reserved.
讨论议题
www.mask.org.tw All rights reserved.
What Do I Want
• Reverse(disassemble) .apk • Code modification/injection • Re-pack(assemble) to .apk • Execute .apk
www.mask.org.tw All rights reserved.



!
16
Copyright 2009 - 2012
www.mask.org.tw All rights reserved.


开发
开发
!
17
Copyright 2009 - 2012
www.mask.org.tw All rights reserved.
level 1 • • uninstall
40
Copyright 2009 - 2012
www.mask.org.tw All rights reserved.
41
Copyright 2009 - 2012
www.mask.org.tw All rights reserved.
42
Copyright 2009 - 2012
Android
Application Middleware Kernel

9
Copyright 2009 - 2012
www.mask.org.tw All rights reserved.
Linux Architecture
10
Copyright 2009 - 2012
www.mask.org.tw All rights reserved.
Android
13
Copyright 2009 - 2012
www.mask.org.tw All rights reserved.
Android
应 库 数 开发
14
Copyright 2009 - 2012
www.mask.org.tw All rights reserved.
15
Copyright 2009 - 2012
35
Copyright 2009 - 2012
www.mask.org.tw All rights reserved.
Building & Running
36
Copyright 2009 - 2012
www.mask.org.tw All rights reserved.
Sign ZipAlign
• • • • 电 • HTML5
22 Copyright 2009 - 2012 www.mask.org.tw All rights reserved.

• • Free your mind

23
Copyright 2009 - 2012
www.mask.org.tw All rights reserved.
www.mask.org.tw All rights reserved.
Tools
• apktool • http://code.google.com/p/androidapktool/
• smali / baksmali (assemble/disassemble) • http://code.google.com/p/smali/
相关文档
最新文档