Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,768,353 Members 46,498 Now Online
XDA Developers Android and Mobile Development Forum

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

Tip us?
 
chubbzlou
Old
#21  
chubbzlou's Avatar
Recognized Contributor
Thanks Meter 3021
Posts: 1,318
Join Date: Jul 2007
Location: NYC NY

 
DONATE TO ME
Awesome Tommy Thanks checking it out now.


The Following User Says Thank You to chubbzlou For This Useful Post: [ Click to Expand ]
 
tommytomatoe
Old
#22  
tommytomatoe's Avatar
Recognized Developer - OP
Thanks Meter 6806
Posts: 6,255
Join Date: Dec 2010
Location: Knoxville USA

 
DONATE TO ME
Quote:
Originally Posted by TMartin View Post
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"?
 
tommytomatoe
Old
#23  
tommytomatoe's Avatar
Recognized Developer - OP
Thanks Meter 6806
Posts: 6,255
Join Date: Dec 2010
Location: Knoxville USA

 
DONATE TO ME
V 1.0.1 releasing later today. Mac first then Linux.

Sent from my PC36100 using XDA Premium App
 
TMartin
Old
(Last edited by TMartin; 15th July 2011 at 02:20 PM.)
#24  
TMartin's Avatar
Recognized Developer
Thanks Meter 1579
Posts: 2,112
Join Date: Jun 2008
Location: Westerville, Ohio

 
DONATE TO ME
Quote:
Originally Posted by tommytomatoe View Post
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
Unofficial ChameleonOS (Sprint HTC One) | ClassicNerd (Touchpad) | Taste of Sense 4.0 (Evo 3D)
For all the latest RUU leaks...
Check out themikmik
If you like my work....
Donate to TMartin
P.S. All donations go toward a pc that I can build from source in under 4 hours...yea, it's taking me over 4 hours at the moment
 
tommytomatoe
Old
#25  
tommytomatoe's Avatar
Recognized Developer - OP
Thanks Meter 6806
Posts: 6,255
Join Date: Dec 2010
Location: Knoxville USA

 
DONATE TO ME
Quote:
Originally Posted by TMartin View Post
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
 
TMartin
Old
#26  
TMartin's Avatar
Recognized Developer
Thanks Meter 1579
Posts: 2,112
Join Date: Jun 2008
Location: Westerville, Ohio

 
DONATE TO ME
Quote:
Originally Posted by tommytomatoe View Post
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.
Unofficial ChameleonOS (Sprint HTC One) | ClassicNerd (Touchpad) | Taste of Sense 4.0 (Evo 3D)
For all the latest RUU leaks...
Check out themikmik
If you like my work....
Donate to TMartin
P.S. All donations go toward a pc that I can build from source in under 4 hours...yea, it's taking me over 4 hours at the moment
 
tommytomatoe
Old
#27  
tommytomatoe's Avatar
Recognized Developer - OP
Thanks Meter 6806
Posts: 6,255
Join Date: Dec 2010
Location: Knoxville USA

 
DONATE TO ME
Quote:
Originally Posted by TMartin View Post
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
 
TMartin
Old
#28  
TMartin's Avatar
Recognized Developer
Thanks Meter 1579
Posts: 2,112
Join Date: Jun 2008
Location: Westerville, Ohio

 
DONATE TO ME
Quote:
Originally Posted by tommytomatoe View Post
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.
Unofficial ChameleonOS (Sprint HTC One) | ClassicNerd (Touchpad) | Taste of Sense 4.0 (Evo 3D)
For all the latest RUU leaks...
Check out themikmik
If you like my work....
Donate to TMartin
P.S. All donations go toward a pc that I can build from source in under 4 hours...yea, it's taking me over 4 hours at the moment
 
tommytomatoe
Old
#29  
tommytomatoe's Avatar
Recognized Developer - OP
Thanks Meter 6806
Posts: 6,255
Join Date: Dec 2010
Location: Knoxville USA

 
DONATE TO ME
Quote:
Originally Posted by TMartin View Post
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.
 
jonas2295
Old
#30  
jonas2295's Avatar
Recognized Contributor
Thanks Meter 2426
Posts: 4,849
Join Date: Jan 2010
Location: Bavaria

 
DONATE TO ME
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



You want 20gb free cloud storage ?
use my referral link and you get them right away at copy.com !
Thanks!


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

Advanced Search
Display Modes