Disassemble .apk
Loading...
純粹實驗性動機, 以 app/Camera.apk 為例:
1. unzip Camera.apk:
-rw-r–r– 1 root root 119K 2010-07-18 22:24 resources.arsc
-rw-r–r– 1 root root 320K 2010-07-18 22:24 classes.dex
-rw-r–r– 1 root root 11K 2010-07-18 22:24 AndroidManifest.xml
drwxr-xr-x 7 root root 4.0K 2010-09-05 23:12 res
drwxr-xr-x 2 root root 4.0K 2010-09-05 23:12 META-INF
2. ./out/host/linux-x86/bin/dexdump classes.dex:
Processing ‘classes.dex’…
Opened ‘classes.dex’, DEX version ‘035’
Class #0 –
Class descriptor : ‘Lcom/android/camera/BufferedInputStream;’
Access flags : 0x0001 (PUBLIC)
Superclass : ‘Ljava/io/FilterInputStream;’
Interfaces –
Static fields –
Instance fields –
#0 : (in Lcom/android/camera/BufferedInputStream;)
name : ‘buf’
type : ‘[B’
access : 0x0004 (PROTECTED)
#1 : (in Lcom/android/camera/BufferedInputStream;)
name : ‘closed’
type : ‘Z’
access : 0x0002 (PRIVATE)
#2 : (in Lcom/android/camera/BufferedInputStream;)
name : ‘count’
type : ‘I’
access : 0x0004 (PROTECTED)
#3 : (in Lcom/android/camera/BufferedInputStream;)
name : ‘marklimit’
…
…
#0 : (in Lcom/android/camera/Camera$Capturer;)
name : ‘cancelAutoDismiss’
type : ‘()V’
access : 0x0401 (PUBLIC ABSTRACT)
code : (none)
#1 : (in Lcom/android/camera/Camera$Capturer;)
name : ‘cancelSave’
type : ‘()V’
access : 0x0401 (PUBLIC ABSTRACT)
code : (none)
#2 : (in Lcom/android/camera/Camera$Capturer;)
name : ‘dismissFreezeFrame’
type : ‘(Z)V’
access : 0x0401 (PUBLIC ABSTRACT)
code : (none)
#3 : (in Lcom/android/camera/Camera$Capturer;)
name : ‘getLastCaptureUri’
type : ‘()Landroid/net/Uri;’
access : 0x0401 (PUBLIC ABSTRACT)
code : (none)
#4 : (in Lcom/android/camera/Camera$Capturer;)
name : ‘onSnap’
type : ‘()V’
access : 0x0401 (PUBLIC ABSTRACT)
code : (none)
#5 : (in Lcom/android/camera/Camera$Capturer;)
name : ‘setDone’
type : ‘(Z)V’
access : 0x0401 (PUBLIC ABSTRACT)
code : (none)
source_file_idx : 143 (Camera.java)
…
對應到 Camera.java:
interface Capturer {
Uri getLastCaptureUri();
void onSnap();
void dismissFreezeFrame(boolean keep);
void cancelSave();
void cancelAutoDismiss();
void setDone(boolean wait);
}
Uri getLastCaptureUri();
void onSnap();
void dismissFreezeFrame(boolean keep);
void cancelSave();
void cancelAutoDismiss();
void setDone(boolean wait);
}
3.
out/host/linux-x86/bin/dexdump classes.dex | grep "\.java" | awk '{print $4}' | sort | uniq
(BufferedInputStream.java)
(Camera.java)
(MenuHelper.java)
(Camera.java)
(SelectedImageGetter.java)
(Camera.java)
(CameraButtonIntentReceiver.java)
(CameraSettings.java)
(CameraThread.java)
(CropImage.java)
(ImageViewTouchBase.java)
(CropImage.java)
(Wallpaper.java)
(DrmWallpaper.java)
(ErrorScreen.java)
(ExifInterface.java)
(GalleryPicker.java)
(GalleryPickerItem.java)
(GallerySettings.java)
(HighlightView.java)
(ImageGallery2.java)
(ImageManager.java)
(ImageGallery2.java)
(ImageLoader.java)
(ImageGallery2.java)
(ImageLoader.java)
(ImageManager.java)
(ImageViewTouchBase.java)
(MenuHelper.java)
(PickWallpaper.java)
(PwaUpload.java)
(R.java)
(SlideShow.java)
(UploadAction.java)
(UploadService.java)
(ViewImage.java)
(ViewVideo.java)
(Wallpaper.java)
(GoogleLoginCredentialsResult.java)
(IGoogleLoginService.java)
(LoginData.java)
(GoogleAppsVerifier.java)
(GoogleLoginServiceBlockingHelper.java)
(GoogleLoginServiceConstants.java)
(GoogleLoginServiceHelper.java)
(GoogleLoginServiceNotFoundException.java)
4. out/host/linux-x86/bin/aapt l Camera.apk:
META-INF/MANIFEST.MF
META-INF/CERT.SF
META-INF/CERT.RSA
res/drawable/image_border_bg_pressed_blue.9.png
res/drawable/ic_camera_indicator_photo.png
res/drawable/ic_gallery_finish.png
res/drawable/camera_crop_width.png
res/xml/gallery_preferences.xml
res/layout/details.xml
res/drawable/frame_gallery_preview_album_mask.png
res/drawable/ic_gallery_back_to_entry.png
res/anim/auto_focus_blink.xml
AndroidManifest.xml
res/drawable/frame_gallery_preview.xml
META-INF/MANIFEST.MFMETA-INF/CERT.SFMETA-INF/CERT.RSAres/drawable/image_border_bg_pressed_blue.9.pngres/drawable/ic_camera_indicator_photo.pngres/drawable/ic_gallery_finish.pngres/drawable/camera_crop_width.pngres/xml/gallery_preferences.xmlres/layout/details.xmlres/drawable/frame_gallery_preview_album_mask.pngres/drawable/ic_gallery_back_to_entry.pngres/anim/auto_focus_blink.xmlAndroidManifest.xmlres/drawable/frame_gallery_preview.xml
…
5. out/host/linux-x86/bin/aapt d xmltree Camera.apk AndroidManifest.xml:
N: android=http://schemas.android.com/apk/res/android E: manifest (line=1) A: android:sharedUserId(0x0101000b)="android.media" (Raw: "android. media") A: package="com.android.camera" (Raw: "com.android.camera") E: uses-permission (line=4) A: android:name(0x01010003)="android.permission.CAMERA" (Raw: "an droid.permission.CAMERA") E: uses-permission (line=5) A: android:name(0x01010003)="android.permission.ACCESS_FINE_LOCAT ION" (Raw: "android.permission.ACCESS_FINE_LOCATION") E: uses-permission (line=6) A: android:name(0x01010003)="android.permission.INTERNET" (Raw: " android.permission.INTERNET") E: uses-permission (line=7) A: android:name(0x01010003)="android.permission.WAKE_LOCK" (Raw: "android.permission.WAKE_LOCK") E: uses-permission (line=8) A: android:name(0x01010003)="com.google.android.googleapps.permis sion.GOOGLE_AUTH.lh2" (Raw: "com.google.android.googleapps.permission.GOOGLE_AUTH.lh2") ...
對應到 AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.camera" android:sharedUserId="android.media"> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="com.google.android.googleapps.permission.GOOGLE_AUTH.lh2"/> ...
Loading...
發表迴響