FORUMS

[GUIDE][14.10][15.04][15.10]APKTool for Ubuntu (Automate Installation)

3,031 posts
Thanks Meter: 5,380
 
By Calin, Retired Forum Moderator / Recognized Developer on 1st August 2014, 01:18 PM
Post Reply Email Thread

Intro
  • This little guide was accessed by many people,and this thread already got one year from it's release, so in order to make it even more simple for the users and continue to use and install APKTool to their Linux distributions i created an automated script, which it will upgrade an existing APKTool with a new version or install everything for the user.
    So basically if you saw my thread sometimes now you absolutely don't need anymore to write the commands and do all these stuff manually cause the script will now do it for you.
    For download, now you get the zip containing everything from the attachments.

How to run the script
  • To run the script is very simple, just download the zip, unpack it to your desktop for example and finally now open a terminal window from the folder where the script is located, and now type:

Code:
./Script.sh
  • If for some reason fails, just open the proprieties of the file, and make it executable... It will work.


How does it work?
  • The basic commands are this :
    • apktool if framework-res.apk: This command is recommended to be done at the first run, because this will allow to install the framework-res of your ROM which will be used in future to decompile the APKs based on that API level
    • apktool d SystemUI.apk OUT: This command will decompile an apk to the OUT folder but if you want to choose an other name, you're freely to do it.
      The command also can be wrote in this manner: apktool d SystemUI.apk and the apk will be decompiled into a folder with the same name of the app, in this case SystemUI
    • apktool b SystemUI: When you will finish to work on an APK obviously you will also need to recompile the apk with the changes so to do that you will need to use this command which as stated will recompile the apk with the changes.
    • java -jar signapk.jar testkey.x509.pem testkey.pk8 name_of_app.apk name_of_app-signed.apk: This command will allow you to sign your apk once it's compiled, and i suggest you to do it every time you made some changes because on Android when you will try to install it or push it to system for example it will not work in most of the cases so it's better always to sign the apk always. The command is very simple to use it, just write it into a terminal window and the signed apk will be made in a few seconds.

  • So pretty much that's it
    If you find any kind of problem during the recompilation of an APK don't panic, just watch again the sources and the guide you are following to see if you made good the steps, or search on Google, your best friend for these things
  • You can also write it here if you want and I or some other user will help you out with your problem
    Thanks, and i hope this will help some people
The Following 94 Users Say Thank You to Calin For This Useful Post: [ View ]
14th August 2014, 05:35 AM |#2  
Inactive Recognized Developer
Flag IHB
Thanks Meter: 4,828
 
Donate to Me
More
Nice guide Think its the best Ive seen for installing on Linux. Wish I found this the first time I installed it on Linux.

Im lazy, hate typing, and change distros often so i turned it all into a script a while back. But think this is great for newbies.

Great work bud.

edit-

Posted 2 weeks ago and only 3 thanks? Come on people. Be thankful for this. Not too long ago you could barely even find one guide for this let alone one put together well. Hit the thanksssssss.
The Following 5 Users Say Thank You to ShinySide For This Useful Post: [ View ] Gift ShinySide Ad-Free
14th August 2014, 06:23 AM |#3  
Member
Thanks Meter: 20
 
More
I already searched for it but didn't find an answer: How do I sign an apk on ubuntu?
Nice guide, will do it AS soon AS I have time.
Sent from my Nexus 5 using XDA Free mobile app
14th August 2014, 09:21 AM |#4  
Calin's Avatar
OP Retired Forum Moderator / Recognized Developer
Flag Oradea
Thanks Meter: 5,380
 
Donate to Me
More
Quote:
Originally Posted by ShinySide

Nice guide Think its the best Ive seen for installing on Linux. Wish I found this the first time I installed it on Linux.

Im lazy, hate typing, and change distros often so i turned it all into a script a while back. But think this is great for newbies.

Great work bud.

edit-

Posted 2 weeks ago and only 3 thanks? Come on people. Be thankful for this. Not too long ago you could barely even find one guide for this let alone one put together well. Hit the thanksssssss.

Thanks man )
I will add also a mini guide for signing this afternoon

edit. added mini guide also for signing
The Following User Says Thank You to Calin For This Useful Post: [ View ]
EnricoD
14th August 2014, 10:27 AM |#5  
Guest
Thanks Meter: 0
 
More
great work, very useful for noobs

If You install oracle's java You don't need the open jdk

This is user's choice


Why not the 7 instead of 6th?
Code:
sudo apt-get install openjdk-7-jre
It's possible also to make this process faster by adding a wget instead of downloading all apktool things from the website

for example i uploaded apktool files on my dropbox and I download everytime I have to install apktool by simply running

Code:
wget https://www.dropbox.com/s/6s9bxszxjl7wclz/apktool.tar.gz
then

Code:
tar -zxvf apktool.tar.gz
then

Code:
cd apktool
You can also run single commands to make the installation process faster

Code:
sudo chmod +x aapt apktool apktool.jar
Code:
sudo chown -R yourusername aapt apktool apktool.jar
enricod@enricod-Aspire-5920G:~/Scrivania/apktool$

Code:
sudo cp aapt apktool apktool.jar /usr/local/bin
just hints
The Following 3 Users Say Thank You to For This Useful Post: [ View ] Gift Ad-Free
14th August 2014, 10:30 AM |#6  
Calin's Avatar
OP Retired Forum Moderator / Recognized Developer
Flag Oradea
Thanks Meter: 5,380
 
Donate to Me
More
Yeah sure it can be done also in this way
The Following User Says Thank You to Calin For This Useful Post: [ View ]
14th August 2014, 01:02 PM |#7  
paulle's Avatar
Senior Member
Thanks Meter: 279
 
More
ubuntu 14.04 ia32libs
in ubuntu 14.04 (64bit) the ia32libs aren't available.

Package ia32-libs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or is only available from another source
However the following packages replace it:
lib32z1 lib32ncurses5 lib32bz2-1.0

Package 'ia32-libs' has no installation candidate
14th August 2014, 01:09 PM |#8  
Calin's Avatar
OP Retired Forum Moderator / Recognized Developer
Flag Oradea
Thanks Meter: 5,380
 
Donate to Me
More
Quote:
Originally Posted by paulle

in ubuntu 14.04 (64bit) the ia32libs aren't available.

Package ia32-libs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or is only available from another source
However the following packages replace it:
lib32z1 lib32ncurses5 lib32bz2-1.0

Package 'ia32-libs' has no installation candidate

These are required optionally just in case the APKTool may fail during his running
but if they are necessary type the following commands:

Code:
sudo -i
cd /etc/apt/sources.list.d
echo "deb http://old-releases.ubuntu.com/ubuntu/ raring main restricted universe multiverse" >ia32-libs-raring.list
apt-get update
apt-get install ia32-libs
The Following User Says Thank You to Calin For This Useful Post: [ View ]
14th August 2014, 10:21 PM |#9  
Senior Member
Flag UK
Thanks Meter: 1,629
 
Donate to Me
More
I ve got Android sdk, Java and adb already on my 64 bit system, is it ok to leave out installation of those bits and just start by installing the APK tool, but miss out the 32bit libs cos I already have them ? Thanks
15th August 2014, 04:34 AM |#10  
Inactive Recognized Developer
Flag IHB
Thanks Meter: 4,828
 
Donate to Me
More
Quote:
Originally Posted by typos1

I ve got Android sdk, Java and adb already on my 64 bit system, is it ok to leave out installation of those bits and just start by installing the APK tool, but miss out the 32bit libs cos I already have them ? Thanks

Yeah just skip what you already have and install what you don't have
The Following User Says Thank You to ShinySide For This Useful Post: [ View ] Gift ShinySide Ad-Free
15th August 2014, 05:33 PM |#11  
brymaster5000's Avatar
Inactive Recognized Contributor
Flag New Hampshire
Thanks Meter: 3,167
 
Donate to Me
More
Excellent. Many users should find this very useful.

One thing I want people to note is that I have successfully been using 14.04 ubuntu with java 8 and apktool v2.0.0b9 installed. Granted I only build kernels from source and not AOSP...but figured I would let people know.
The Following 2 Users Say Thank You to brymaster5000 For This Useful Post: [ View ] Gift brymaster5000 Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes