Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[UTILITY] Android Utility - [apktool|dex2jar|smali|more][Mac & Linux][Feb13, 2012]

OP tommytomatoe

15th July 2011, 12:00 AM   |  #21  
chubbzlou's Avatar
Recognized Contributor
Flag NYC NY
Thanks Meter: 3,104
 
1,347 posts
Join Date:Joined: Jul 2007
Donate to Me
More
Awesome Tommy Thanks checking it out now.
The Following User Says Thank You to chubbzlou For This Useful Post: [ View ]
15th July 2011, 05:22 AM   |  #22  
tommytomatoe's Avatar
OP Recognized Developer
Flag Knoxville USA
Thanks Meter: 6,825
 
6,256 posts
Join Date:Joined: Dec 2010
Donate to Me
More
Quote:
Originally Posted by TMartin

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??

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:
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
}
In the above, here are the variables:
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"?
15th July 2011, 02:45 PM   |  #23  
tommytomatoe's Avatar
OP Recognized Developer
Flag Knoxville USA
Thanks Meter: 6,825
 
6,256 posts
Join Date:Joined: Dec 2010
Donate to Me
More
V 1.0.1 releasing later today. Mac first then Linux.

Sent from my PC36100 using XDA Premium App
15th July 2011, 03:16 PM   |  #24  
TMartin's Avatar
Recognized Developer
Flag Westerville, Ohio
Thanks Meter: 1,579
 
2,118 posts
Join Date:Joined: Jun 2008
Donate to Me
More
Quote:
Originally Posted by tommytomatoe

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:

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
}
In the above, here are the variables:
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
Last edited by TMartin; 15th July 2011 at 03:20 PM.
15th July 2011, 03:25 PM   |  #25  
tommytomatoe's Avatar
OP Recognized Developer
Flag Knoxville USA
Thanks Meter: 6,825
 
6,256 posts
Join Date:Joined: Dec 2010
Donate to Me
More
Quote:
Originally Posted by TMartin

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
15th July 2011, 03:40 PM   |  #26  
TMartin's Avatar
Recognized Developer
Flag Westerville, Ohio
Thanks Meter: 1,579
 
2,118 posts
Join Date:Joined: Jun 2008
Donate to Me
More
Quote:
Originally Posted by tommytomatoe

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.
15th July 2011, 03:44 PM   |  #27  
tommytomatoe's Avatar
OP Recognized Developer
Flag Knoxville USA
Thanks Meter: 6,825
 
6,256 posts
Join Date:Joined: Dec 2010
Donate to Me
More
Quote:
Originally Posted by TMartin

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
15th July 2011, 07:47 PM   |  #28  
TMartin's Avatar
Recognized Developer
Flag Westerville, Ohio
Thanks Meter: 1,579
 
2,118 posts
Join Date:Joined: Jun 2008
Donate to Me
More
Quote:
Originally Posted by tommytomatoe

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.
15th July 2011, 10:03 PM   |  #29  
tommytomatoe's Avatar
OP Recognized Developer
Flag Knoxville USA
Thanks Meter: 6,825
 
6,256 posts
Join Date:Joined: Dec 2010
Donate to Me
More
Quote:
Originally Posted by TMartin

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.
15th July 2011, 10:08 PM   |  #30  
jonas2295's Avatar
Recognized Contributor
Flag Bavaria
Thanks Meter: 2,505
 
4,934 posts
Join Date:Joined: Jan 2010
Donate to Me
More
Awesome tool but can't use it atm because I have no Linux distro atm
Can we run the tool via cgwin ?
Thanks in advance

Sent from my HD2 using XDA Premium App

Post Reply Subscribe to Thread

Tags
apktool, draw9patch compiler, mac
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes