Skip to first unread message

Mr. Pratim

unread,
Aug 29, 2016, 3:25:41 AM8/29/16
to MIT App Inventor Forum

Today, I've posted the whole process here. [Sorry, No screenshots]

I shall convert   appinventor.ai_iammine.abcd    to   com.iammine.abcd [Last checked on 28.8.2016]

To change the package name successfully we have to go through 3 steps:-

1. Decompiling the apk, editing it and recompiling it.
2.Getting a pem certificate and pk8 key with OpenSSL
3.Signing the apk.


[STEP1]~Getting the apk, decompiling it and recompiling it.~

1.Download apktool 2.1.1 from HERE

2.Now, paste the apk to apktool directory [where you extracted]

3.Now, press SHIFT key along with right-click and goto ->  "open command window here''

4.now type  "apktool d abcd.apk" [package visual name]

5.Now do the process no 4 and 5 from http://puravidaapps.com/packagename.php

6.Now goto     adcd/smali/appinventor  , you'll be able to find a folder inside it, rename it to "iammine"  [for my case]

7.Move [cut] this folder to  adcd/smali/com/

8.Do process no 3 from here. then type "apktool b abcd" and enter  [the apk will be recompiled to adcd/dist]


[STEP2]~Getting a pem and pk8 with OpenSSL~ [This is most important to sign that apk]

1.Down OpenSSL from HERE and extract it.  

2.Go to extractiondirectory/bin [openssl/bin for my case] folder, press SHIFT key along with right-click and goto ->"open command window here''   

3.Type     openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days XXX -nodes  

[You might get and error saying can't find openssl.cnf in C:\Openssl. If this error persists, then copy the file "openssl.cnf" from the bin folder to C:\Openssl]

4.Give the information required by the application and you will get 2 files called "certificate.pem" and "key.pem"

[Unfortunately the signapk occurs problem if you want to sign with the pem version of the key.so we have to convert it to pk8.]

6.Again do process no.2 in this step. and type  openssl pkcs8 -topk8 -outform DER -in key.pem -inform PEM -out key.pk8 -nocrypt

7.Now, at all, we have the certificate.pem and key.pk8  


[STEP3] Signing the apk [APK is useless without signing]

1.Download Signapk.zip from HERE and extract it to a folder.

2.Paste the certificate.pem and key.pk8 and the apk which is recompiled in the adcd/dist.

3.Now from the ~SIGNAPK EXTRACTION FOLDER~ , do the process no.2 from step 2 [not in that folder, ->command same/folder changed]

4. now type        java -jar signapk.jar certificate.pem key.pk8 abcd.apk adcd-signed.apk

5.You will be able to see a new APK [Here, adcd-signed.apk] appears.

6.Good, the work is done,now we have the apk with our desired package name!! [here com.iammine.abcd]




The links here are uploaded to my personal box account. It will be your wish if you want to replace them.

Taifun

unread,
Aug 29, 2016, 10:15:31 AM8/29/16
to MIT App Inventor Forum
thank you very much!
Taifun

Abraham Getzler

unread,
Aug 29, 2016, 2:59:42 PM8/29/16
to MIT App Inventor Forum
(added to Unofficial Tricks section of this FAQ)
ABG

Mr. Pratim

unread,
Aug 30, 2016, 7:58:06 AM8/30/16
to MIT App Inventor Forum
Oh, I forgot to mention a thing. In SETP2 , process three, you can see the part of the command , "-days XXX"
.Here the certificate creator have to replace the "-days XXX" to "-days 3650" for making the certificate valid for 3650 days or 10 years.You are not forced to enter 10 year.You can enter freely any value.
Reply all
Reply to author
Forward
0 new messages