• Announcements

    • PaulOBrien

      Reminder - MoDaCo position on illegal content   07/30/15

      ILLEGAL CONTENT I'd like to just reaffirm MoDaCo's position regarding piracy and illegal content in the light of some recent questions / postings. Posts will be censored by myself or my moderation team if the contain or link to: Illegal / pirated / cracked software or sites that host such software Nintendo emulators / ROMs or sites hosting them (in light of Nintendo's legal stance) CUSTOM ROMS You may discuss and post links to custom device ROMs on MoDaCo, provided the following rules are adhered to: ROMs must not contain any illegal 3rd party software (this includes trial versions included without permission) ROMs must give full credit to the original author ISSUES If you have any issues with this policy, please contact PaulOBrien directly via PM.
    • PaulOBrien

      Reminder: Selling items on the forum directly is not allowed   07/30/15

      Please note that selling items on the forum directly is not allowed by the forum rules. There is a forum for eBay auctions whereby you can list the items on eBay and link to them there. This is the ONLY forum for this type of activity. You may also advertise links to the eBay forum in your signature. Please note that selling directly in contravention of these rules will result in a warning / suspension / ban.

How can i patch Kindle3.apk?

2 posts in this topic

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.



Share this post

Link to post
Share on other sites

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?



Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

MoDaCo is part of the MoDaCo.network, © Paul O'Brien 2002-2016. MoDaCo uses IntelliTxt technology.