Jump to content

How can i patch Kindle3.apk?

Guest Djp42

Recommended Posts

Hi all, i need help. I am trying to patch the Kindle3.apk pulled off my Nexus. I found this tut buy a guy known as "ME" from ApprenticeAlf. He created this patch to enable the user to view his PID so that he could then go on to remove DRM from purchased e-books. I have installed Apktool to my C drive. Adb is up n running. This is the tut i am trying to use,

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 (this is the part that is giving me problems. When i enter this line i get an "Access is denied" error. I am a noob btw.

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

Can someone please take a look at this tut and tell me if they can see any errors ie: should one of the lines be broken into 2 lines? Or. alternatively, is there an easier way to do this?

PS This is the script contained in the actual patch file

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



+ 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


Any help from you guys really would be appreciated cos right now i'm at a dead end.


Link to comment
Share on other sites

Guest ranseier

patch -p1 < ../kindle3.patch (this is the part that is giving me problems. When i enter this line i get an "Access is denied" error. I am a noob btw.

Well, I think there is something wrong with the permissions in this directory. Have you checked this? Can you create and delete files in this directory?


Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.