Re-arrange folders and files for 5.0 tools
This commit is contained in:
50
Other_Tools/Kindle_for_Android_Patch/ReadMe_K4Android.txt
Normal file
50
Other_Tools/Kindle_for_Android_Patch/ReadMe_K4Android.txt
Normal file
@@ -0,0 +1,50 @@
|
||||
Kindle for Android
|
||||
------------------
|
||||
|
||||
Kindle for Android uses a different scheme to generate its books specific PIDs than Kindle for PC, Kindle for iPhone/iPad, and standalone Kindles.
|
||||
|
||||
Unfortunately, K4Android uses an "account secrets" file that would only be available if the device were jail-broken and even then someone would have to figure out how to decode this secret information in order to reverse the process.
|
||||
|
||||
Instead of trying to calculate the correct PIDs for each book from this primary data, "Me" (a commenter who posted to the ApprenticeAlf site) came up with a wonderful idea to simply modify the Kindle 3 for Android application to store the PIDs it uses to decode each book in its "about activity" window. This list of PIDS can then be provided to MobiDeDRM.py, which in its latest incarnations allows a comma separated list of pids to be passed in, to successfully remove the DRM from that book. Effectively "Me" has created an "Unswindle" for the Kindle for Android 3 application!
|
||||
|
||||
Obviously, to use "Me"'s approach, requires an Android Developer's Certificate (to sign the modified application) and access to and knowledge of the developer tools, but does not require anything to be jail-broken.
|
||||
|
||||
This is a copy the detailed instructions supplied by "Me" to the ApprenticeAlf blog in the comments. The kindle3.patch described below is included in this folder in the tools:
|
||||
|
||||
From the ApprenticeAlf Comments:
|
||||
|
||||
"Me" writes:
|
||||
|
||||
A better solution seems to create a patched version of the Kindle apk which either logs or displays it’s PID. I created a patch to both log the pid list and show it in the Kindle application in the about activity screen. The pid list isn’t available until the DRMed book has been opened (and the list seem to differ for different books).
|
||||
|
||||
To create the patched kindle apk a certificate must be created (http://developer.android.com/guide/publishing/app-signing.html#cert) and the apktool must be build from source (all subprojects) as long as version 1.4.2 isn’t released (http://code.google.com/p/android-apktool/wiki/BuildApktool).
|
||||
|
||||
These are the steps to pull the original apk from the Android device, uninstall it, create a patched apk and install that (tested on a rooted device, but I think all steps should also work on non-rooted devices):
|
||||
|
||||
adb pull /data/app/com.amazon.kindle-1.apk kindle3.apk
|
||||
adb uninstall com.amazon.kindle
|
||||
apktool d kindle3.apk kindle3
|
||||
cd kindle3
|
||||
patch -p1 < ../kindle3.patch
|
||||
cd ..
|
||||
apktool b kindle3 kindle3_patched.apk
|
||||
jarsigner -verbose -keystore kindle.keystore kindle3_patched.apk kindle
|
||||
zipalign -v 4 kindle3_patched.apk kindle3_signed.apk
|
||||
adb install kindle3_signed.apk
|
||||
|
||||
kindle3.patch (based on kindle version 3.0.1.70) is available on pastebin:
|
||||
http://pastebin.com/LNpgkcpP
|
||||
|
||||
Have fun!
|
||||
|
||||
Comment by me — June 9, 2011 @ 9:01 pm | Reply
|
||||
|
||||
Hi me,
|
||||
Wow! Great work!!!!
|
||||
|
||||
With your patch, you have created the equivalent of Unswindle for the Kindle for Android app and it does not even require jailbreaking!
|
||||
|
||||
Very nice work indeed!
|
||||
|
||||
Comment by some_updates — June 10, 2011 @ 4:28 am | Reply
|
||||
|
||||
100
Other_Tools/Kindle_for_Android_Patch/kindle3.patch
Normal file
100
Other_Tools/Kindle_for_Android_Patch/kindle3.patch
Normal file
@@ -0,0 +1,100 @@
|
||||
diff -ru kindle3_orig/smali/com/amazon/kcp/application/AndroidDeviceInformationProvider.smali kindle3/smali/com/amazon/kcp/application/AndroidDeviceInformationProvider.smali
|
||||
--- kindle3_orig/smali/com/amazon/kcp/application/AndroidDeviceInformationProvider.smali
|
||||
+++ kindle3/smali/com/amazon/kcp/application/AndroidDeviceInformationProvider.smali
|
||||
@@ -11,6 +11,8 @@
|
||||
|
||||
.field private security:Lcom/mobipocket/android/library/reader/AndroidSecurity;
|
||||
|
||||
+.field private pidList:Ljava/lang/String;
|
||||
+
|
||||
|
||||
# direct methods
|
||||
.method public constructor <init>(Lcom/mobipocket/android/library/reader/AndroidSecurity;Lcom/amazon/kcp/application/AndroidDeviceType;)V
|
||||
@@ -28,6 +30,10 @@
|
||||
.line 26
|
||||
iput-object p2, p0, Lcom/amazon/kcp/application/AndroidDeviceInformationProvider;->deviceType:Lcom/amazon/kcp/application/AndroidDeviceType;
|
||||
|
||||
+ const-string v0, "Open DRMed book to show PID list."
|
||||
+
|
||||
+ iput-object v0, p0, Lcom/amazon/kcp/application/AndroidDeviceInformationProvider;->pidList:Ljava/lang/String;
|
||||
+
|
||||
.line 27
|
||||
new-instance v0, Ljava/lang/StringBuilder;
|
||||
|
||||
@@ -175,4 +181,26 @@
|
||||
move-result-object v0
|
||||
|
||||
return-object v0
|
||||
+.end method
|
||||
+
|
||||
+.method public getPidList()Ljava/lang/String;
|
||||
+ .locals 1
|
||||
+
|
||||
+ .prologue
|
||||
+ .line 15
|
||||
+ iget-object v0, p0, Lcom/amazon/kcp/application/AndroidDeviceInformationProvider;->pidList:Ljava/lang/String;
|
||||
+
|
||||
+ return-object v0
|
||||
+.end method
|
||||
+
|
||||
+.method public setPidList(Ljava/lang/String;)V
|
||||
+ .locals 0
|
||||
+ .parameter "value"
|
||||
+
|
||||
+ .prologue
|
||||
+ .line 11
|
||||
+ iput-object p1, p0, Lcom/amazon/kcp/application/AndroidDeviceInformationProvider;->pidList:Ljava/lang/String;
|
||||
+
|
||||
+ .line 12
|
||||
+ return-void
|
||||
.end method
|
||||
diff -ru kindle3_orig/smali/com/amazon/kcp/application/IDeviceInformationProvider.smali kindle3/smali/com/amazon/kcp/application/IDeviceInformationProvider.smali
|
||||
--- kindle3_orig/smali/com/amazon/kcp/application/IDeviceInformationProvider.smali
|
||||
+++ kindle3/smali/com/amazon/kcp/application/IDeviceInformationProvider.smali
|
||||
@@ -27,3 +27,9 @@
|
||||
|
||||
.method public abstract getPid()Ljava/lang/String;
|
||||
.end method
|
||||
+
|
||||
+.method public abstract getPidList()Ljava/lang/String;
|
||||
+.end method
|
||||
+
|
||||
+.method public abstract setPidList(Ljava/lang/String;)V
|
||||
+.end method
|
||||
\ No newline at end of file
|
||||
diff -ru kindle3_orig/smali/com/amazon/kcp/info/AboutActivity.smali kindle3/smali/com/amazon/kcp/info/AboutActivity.smali
|
||||
--- kindle3_orig/smali/com/amazon/kcp/info/AboutActivity.smali
|
||||
+++ kindle3/smali/com/amazon/kcp/info/AboutActivity.smali
|
||||
@@ -32,9 +32,11 @@
|
||||
invoke-direct {v6, v1}, Ljava/util/ArrayList;-><init>(I)V
|
||||
|
||||
.line 36
|
||||
- const v1, 0x7f0b0005
|
||||
+ invoke-static {}, Lcom/amazon/kcp/application/DeviceInformationProviderFactory;->getProvider()Lcom/amazon/kcp/application/IDeviceInformationProvider;
|
||||
|
||||
- invoke-virtual {p0, v1}, Lcom/amazon/kcp/info/AboutActivity;->getString(I)Ljava/lang/String;
|
||||
+ move-result-object v0
|
||||
+
|
||||
+ invoke-interface {v0}, Lcom/amazon/kcp/application/IDeviceInformationProvider;->getPidList()Ljava/lang/String;
|
||||
|
||||
move-result-object v1
|
||||
|
||||
diff -ru kindle3_orig/smali/com/amazon/system/security/Security.smali kindle3/smali/com/amazon/system/security/Security.smali
|
||||
--- kindle3_orig/smali/com/amazon/system/security/Security.smali
|
||||
+++ kindle3/smali/com/amazon/system/security/Security.smali
|
||||
@@ -884,6 +884,15 @@
|
||||
|
||||
.line 332
|
||||
:cond_1
|
||||
+
|
||||
+ const-string v1, "PID list"
|
||||
+ invoke-static {}, Lcom/amazon/kcp/application/DeviceInformationProviderFactory;->getProvider()Lcom/amazon/kcp/application/IDeviceInformationProvider;
|
||||
+ move-result-object v0
|
||||
+ invoke-static {v7}, Ljava/util/Arrays;->toString([Ljava/lang/Object;)Ljava/lang/String;
|
||||
+ move-result-object v2
|
||||
+ invoke-interface {v0, v2}, Lcom/amazon/kcp/application/IDeviceInformationProvider;->setPidList(Ljava/lang/String;)V
|
||||
+ invoke-static {v1, v2}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
|
||||
+
|
||||
return-object v7
|
||||
|
||||
:cond_2
|
||||
Reference in New Issue
Block a user