Looks like a great tool. Can't wait to see the other elements included.
On Linux using apk compression, it isn't removing the apk from the "original_apps" folder. Looks like it performs the rm command but leaves off the file extension so it can't find the file to remove.
EDIT: I get this between each file.
Code:rm: cannot remove '/home/tmartin/android-utility/working-folder/mod-here-multi/original_apps/HtcProfileWidget': No such file or directory HtcProfileWidget.apk decompressed Decompressing HtcRingtoneWidget.apk /home/tmartin/android-utility/working-folder/mod-here-multi/original_apps/HtcRingtoneWidget: No such file or directory
EDIT #2: Looks like it made ever file 24.2mb & unreadable??
decomp_it ()
{
cd $e
for F in *.apk ; do
echo "Decompressing $F"
cd $e
$HOME/bin/7z x -y -o"${F/.apk}" $F &>/dev/null
cd $e/${F/.apk}
zip -"$COMP"r $d/decompressed_apps/$F *
rm -r $d/original_apps/${F/.apk}
echo "$F Decompressed"
done
}
d=$HOME/android-utility/working-folder/mod-here-multi
e=$d/original_apps
COMP=compression level
Welcome to Apk Compression Manager
Compression Level set to 5
[0 = no compression | 9 = high compression]
Please set compression level [default=5 ; 0 -> 9]: 0
Compression Level set to 0
Please Place apks in /home/tommytomatoe/android-utility/working-folder/mod-here-multi/original_apps
(nautilus:2168): Eel-CRITICAL **: eel_preferences_get_boolean: assertion `preferences_is_initialized ()' failed
Please press [enter] when ready
Preparing to decompress Apks with Compression Level 0
Decompressing Rosie-v0.9.9a.apk
adding: AndroidManifest.xml (stored 0%)
adding: classes.dex (stored 0%)
adding: META-INF/ (stored 0%)
adding: res/ (stored 0%)
<snipped snipped>
adding: resources.arsc (stored 0%)
Rosie-v0.9.9a.apk Decompressed
Decompressing Rosie-v0.9.9.apk
adding: AndroidManifest.xml (stored 0%)
adding: classes.dex (stored 0%)
adding: META-INF/ (stored 0%)
<snipped snipped>
adding: resources.arsc (stored 0%)
Rosie-v0.9.9.apk Decompressed
Remove Original Apks? [Y/n]: y
Thank you for choosing Android Utility
brought to you by tommytomatoe :-)
Please Don't Drink and Drive
Hey TMartin.
I checked the script. The only error I can see is the "open" command, which doesn't regard our situation with the "rm" command.
Here is the code I used:
In the above, here are the variables:Code:decomp_it () { cd $e for F in *.apk ; do echo "Decompressing $F" cd $e $HOME/bin/7z x -y -o"${F/.apk}" $F &>/dev/null cd $e/${F/.apk} zip -"$COMP"r $d/decompressed_apps/$F * rm -r $d/original_apps/${F/.apk} echo "$F Decompressed" done }
Code:d=$HOME/android-utility/working-folder/mod-here-multi e=$d/original_apps COMP=compression level
For some reason "$HOME/bin/7z x -y -o"${F/.apk}" $F &>/dev/null" isn't creating the correct output directory for you. The compression script first decompresses the apk into a directory inside /original_apps with same name (Rosie.apk -> Rosie), then compresses contents in "Rosie" into a Rosie.apk inside /decompressed_apps. Then the "Rosie" folder gets deleted. In your case...the output folder "HtcProfileWidget" was never created. Your error wasn't the "rm" that removes the apk, but the directory that was created during the decompression.
Let me run this script with some other apks and we'll find out the issue.
Here is my output:
Code:Welcome to Apk Compression Manager Compression Level set to 5 [0 = no compression | 9 = high compression] Please set compression level [default=5 ; 0 -> 9]: 0 Compression Level set to 0 Please Place apks in /home/tommytomatoe/android-utility/working-folder/mod-here-multi/original_apps (nautilus:2168): Eel-CRITICAL **: eel_preferences_get_boolean: assertion `preferences_is_initialized ()' failed Please press [enter] when ready Preparing to decompress Apks with Compression Level 0 Decompressing Rosie-v0.9.9a.apk adding: AndroidManifest.xml (stored 0%) adding: classes.dex (stored 0%) adding: META-INF/ (stored 0%) adding: res/ (stored 0%) <snipped snipped> adding: resources.arsc (stored 0%) Rosie-v0.9.9a.apk Decompressed Decompressing Rosie-v0.9.9.apk adding: AndroidManifest.xml (stored 0%) adding: classes.dex (stored 0%) adding: META-INF/ (stored 0%) <snipped snipped> adding: resources.arsc (stored 0%) Rosie-v0.9.9.apk Decompressed Remove Original Apks? [Y/n]: y Thank you for choosing Android Utility brought to you by tommytomatoe :-) Please Don't Drink and Drive
Edit 1. Are you placing the apk file inside "original_apps"?
You're right...it's not creating that folder which explains why I'm getting both errors but all the apk's files coming out to 24.2mb seems a bit odd. I was testing compression level 9 for sh*ts & giggles.
EDIT: Yes, I had around 10 apk's in the original_apps folder
Lol. Sh*ts and giggles makes me laugh. One time my fiancée told me that wasn't a thing and that it was kicks and giggles. We Google it and urban dictionary told her it was a private school sheltered version of sh*ts and giggles. Hehe.
Did you go through the entire install process? My only guess is that 7z didn't install properly. Do you care to check $HOME/bin to see if 7z and 7z.so are both there? Perhaps the 7z version I packed with au isn't supported on your version of Ubuntu. It is 9.04 7zip binary by Igor Pavlov but I'm pretty sure it should. Works on karmic koala.
Sent from my PC36100 using Tapatalk
Yea...I'll double check her in a few. I have a GoToMeeting in 10 then I'll pull out my laptop. My 11.04 already has 7z support so I'm not sure if that effects anything negatively.
Work first!
I don't think it would. The script calls for the 7z tthat is in $HOME/bin. I dunno. I have 7z installed too but when using au it Calls for the one in $home/bin. If that is the issue then I will rework the script and make it call from the default 7z tthat people have installed. I think /usr/local/bin is where mine is and /usr/lib/pzip is where the 7z.so is. I will check later. I'm at work too ;-)
Sent from my PC36100 using Tapatalk
Yea both 7z and 7z.so are both there in $HOME/bin. I didn't overwrite my bin folder during install because I had beyond compare installed and it uses the same folder. But like I said, it looks like all the right files are there.
mmmm. Do you care to try a couple more things for me? I know you're a smart guy so don't take this the wrong way lol.
in terminal do:
$HOME/bin/7z
See if the output is what it's supposed to be. And lastly, have you tried again? Perhaps with just one apk. Maybe the first time was a fluke.
exec: 2: /usr/lib/p7zip/7z: not found
### Update. July 14, 2011
>version 1.0.1
>updated sign script
>updated main menu
>added ROM Utility
>added apk Optimization
>added change-log creator
>fixed error logging for decompiling and recompile process
>added resources.arsc decompression
Welcome back Tommy,
Android Utility by tommytomatoe
----------------------
Blue Waffle Magic Pack v 1.0.1
|-------------------------------||-------------------------------|
|-------------------------------||-------------------------------|
| BASIC TOOLS || ADVANCE TOOLS |
|-------------------------------||-------------------------------|
| 1. adb tools || 6. apk Re-Engineering |
| 2. keystore manager || 7. apk Optimization |
| 3. sign apk and update.zip || 8. smali and baksmali |
| 4. zipalign || 9. draw9patch utilities |
| 5. change-log creator ||10. AU ROM Utility |
| || |
|----------------------------------------------------------------|
| SETUP TOOLS |
|----------------------------------------------------------------|
| x. Run Installation Guide || e. Extras |
| i. Install Android SDK || q. Quit |
|-------------------------------||-------------------------------|
|-------------------------------||-------------------------------|
Select an Option:
sudo cp $HOME/bin/7z /usr/lib/p7zip/7z
sudo cp $HOME/bin/7z.so /usr/lib/p7zip/7z
Good morning, Tommy --
Here's what happened when I tried running apktool on the G5 Mac:
++++++++++++++++++++++++++++++++++++
Welcome to Android Application Re-Engineering Manager
|----------------------------------------------------------------|
/Users/Leonard/android-utility/utility/apk_tool: line 202: apktool: command not found
/Users/Leonard/android-utility/utility/apk_tool: line 202: /usr/bin/sed: Bad CPU type in executable
|### |
|----------------------------------------------------------------|
| Apktool Utility |
|-----------------------------------------------------|
| 1. Install framework first (ie. framework-res.apk)|
| 2. Decompile Apk |
| 3. Decompile Multiple Apk |
| 4. Recompile Apk |
| 5. Recompile Multiple Apk |
|-----------------------------------------------------|
| Optional Flavors |
|-----------------------------------------------------|
| a. Use different version of apktool |
| b. Use different version of aapt |
| q. Go Back to Main Menu |
|-----------------------------------------------------|
Please Select Feature: 2
Android Utility found this apk: DeskClock.apk
Would you like to decode it? [default=Yes]
1. Yes
2. No
Decoding DeskClock.apk to ../mod-here-solo/DeskClock:
/Users/Leonard/android-utility/utility/apk_dec: line 167: apktool: command not found
Would you like to extract original META-INF? [default=Yes]
1. Yes
2. No
Extracting Original META-INF from DeskClock.apk
......
Please check decode_log for apks with errors
Please press [enter] to continue
Welcome to Android Application Re-Engineering Manager
|----------------------------------------------------------------|
/Users/Leonard/android-utility/utility/apk_tool: line 202: apktool: command not found
/Users/Leonard/android-utility/utility/apk_tool: line 202: /usr/bin/sed: Bad CPU type in executable
|### |
|----------------------------------------------------------------|
| Apktool Utility |
|-----------------------------------------------------|
| 1. Install framework first (ie. framework-res.apk)|
| 2. Decompile Apk |
| 3. Decompile Multiple Apk |
| 4. Recompile Apk |
| 5. Recompile Multiple Apk |
|-----------------------------------------------------|
| Optional Flavors |
|-----------------------------------------------------|
| a. Use different version of apktool |
| b. Use different version of aapt |
| q. Go Back to Main Menu |
|-----------------------------------------------------|
Please Select Feature:
++++++++++++++++++++++++++++++++++++++
From the decode_log: "On Jul20_111201, DeskClock.apk was not Decoded Properly"
But, we knew that already....
It did extract the META-INF directory, but that's all it did.
I do have an Intel Mac at home -- and it all appears to be working there. I was just hoping it would work on my at-work rig. Oh, well... I guess I can do this stuff at home...
Linux v 1.0.1 will release soon. I am testing. Updated 7z scripts to "unzip" and "zip".
Linux Download:
Android Utility Github Direct Download Version 1.0.1
Update Package - 1.0.0 -> 1.0.1 - ONLY USE IF RUNNING VERSION 1.0.0. Extract "update" folder into root of android-utility, then run "update_script" by clicking on it.
October 12. 2011.
Dear AU users:
I want to make a list of all the projects/themes/ROMs that AU helped make/optimize/perfect. If you all could be so kind as to post a link to your projects and I can put in op.
The goal: (a.) to demonstrate the scope of AU, and (b.) to show off all of your ideas and projects.
I would appreciate your help with this.
Sincerely yours,
Tommy
Welcome back tommytomatoe,
Android Utility by tommytomatoe. Version 1.0.7. Special Edition
|-------------------------------||-------------------------------|
|-------------------------------||-------------------------------|
| BASIC TOOLS || ADVANCE TOOLS |
|-------------------------------||-------------------------------|
| 1. adb tools || 7. apk Re-Engineering |
| 2. keystore manager || 8. apk Optimization |
| 3. sign apk and update.zip || 9. dex code utility |
| 4. zipalign ||10. draw9patch utilities |
| 5. change-log creator ||11. AU ROM Utility |
| 6. png swap themer ||12. 3vodex |
|-------------------------------||-------------------------------|
| K. Run dsixda's Android Kitchen |
|----------------------------------------------------------------|
|----------------------------------------------------------------|
| x. Run Installation Guide || e. Extras |
| i. Install Android SDK || q. Quit |
| u. Update Android-Utility || |
|-------------------------------||-------------------------------|
Select an Option:
The GoalChange apktool versions 1.3.1, 1.3.2, 1.4.1 on the fly
Apk optimization
Apk re-engineering (via apktool)
Keystore manager
Easy ADB
Draw9Patch compiler/decompiler
Zipalign
Dex Editing (via smali and baksmali)
Dex2Jar
Pngout
pngcrush
advpng
optipng
Auto ODEX
Auto dex-removal
Android Kitchen Integration
Much much more
The GoodsA tool for Mac! AU will provide the tools necessary to begin theming projects, apk modifications, optimizations, and hacks. At the end of the day, I hope this project has helped you in doing these things.
AU can also help the user install and utilize apktool even if the user chooses not to use the Android Utility Interface.
Note, in some instances of the utility superuser permissions must be granted (sudo). Please be aware that the changes made are reversible and are not destructive to the Host Operating System.
Please READ Posts #1, 2, and 3 in their Entirety before proceeding.
Feel free to post concerns and bugs. This is still in development! Thank you.
Install Instructions and Frequently Asked QuestionsVersion History
Android Utility Source Code and information
Mac OS X Version 1.0.2 Download:
Android Utility Mac OS X Version 1.0.2
Linux Version 1.x.x Download:
Android Utility Universal Installer Automated Script
Download tar file. Open with Archive Manager. Extract au.installer. Run in terminal by double clicking on it. Follow on-screen prompts. Done.
Old Versions
Mac OS X
Android Utility Github Direct Download Version 1.0.1
Mirror - Full Version 1.0.1 Download
Mac Mirror Version b-1.0.0
Android Utility Github Direct Download Version b-1.0.0
Android Utility Github Direct Download Version 1.0.2
Update Package - 1.0.1 -> 1.0.2 - ONLY USE IF RUNNING VERSION 1.0.1. Extract "update" folder into root of android-utility, then run "update_script" by clicking on it.
Patch Update 1.0.2.b - Fixes three scripts. Extract "update" folder into root of android-utility, then run "update_script" by clicking on it.
Linux
Android Utility Github Direct Download Version 1.0.1
Update Package - 1.0.0 -> 1.0.1 - ONLY USE IF RUNNING VERSION 1.0.0. Extract "update" folder into root of android-utility, then run "update_script" by clicking on it.
Android Utility Github Direct Download Version 1.0.2
Patch Update 1.0.2.b - Fixes two scripts. Extract "update" folder into root of android-utility, then run "update_script" by clicking on it.
Android Utility Mirror Mediafire Full Version 1.0.2 Linux
Prerequisite: JAVA (standard on Mac OS X)
1. Download from Github.com link or direct link or mirror.
2. Unpack the archive (tar.gx or zip) to your HOME folder.
HOME folder is located in /Users/username. To determine HOME folder, open Terminal in Applications Drawer and type:
open $HOME
3. Place the unzipped folder in the finder window that opens.
4. Rename the folder to "android-utility" - ATTENTION! CASE SENSITIVE (ie. Android-utility ≠ android-utility).
5. Double check and make sure name of folder is "android-utility".
6 From here, you have two options (A or B).
# Option A
Open in Finder the android-utility
Look for the file "andutil"
Double click on "andutil"
A Terminal Window will open up with Welcome Screen (Which you will see only on initial install)
Continue through the installation
# Option B
Open a Terminal Window
Type these lines followed by ENTER key:
cd $HOME/android-utility
./andutil
Continue through the installation
From now on, to run AU, you can either double click on the andutil icon, or simply type "andutil" in Terminal from any directory. AU adds necessary files to your PATH.
*** Windows ***Prerequisite: JAVA
If you have Java, continue. If not, run these commands (pressing ENTER key after each one) in Terminal to install Java:
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-bin sun-java6-jre
sudo apt-get -f install
sudo apt-get install sun-java6-bin sun-java6-jre
1. Download from Github.com link or direct link or mirror.
2. Unpack the archive (tar.gx or zip) to your HOME folder.
HOME folder is located in /home/username. To determine HOME folder, open Terminal in Applications Drawer and type (for Gnome Environment):
nautilus $HOME
3. Place the unzipped folder in the window that opens.
4. Rename the folder to "android-utility" - ATTENTION! CASE SENSITIVE (ie. Android-utility ≠ android-utility).
5. Double check and make sure name of folder is "android-utility".
6 From here, you have two options (A or B).
# Option A
Open in Finder the android-utility
Look for the file "andutil"
Double click on "andutil"
A Terminal Window will open up with Welcome Screen (Which you will see only on initial install)
Continue through the installation
# Option B
Open a Terminal Window
Type these lines followed by ENTER key:
cd $HOME/android-utility
./andutil
Continue through the installation
From now on, to run AU, you can either double click on the andutil icon, or simply type "andutil" in Terminal from any directory. AU adds necessary files to your PATH.