yashsingh1/xdaforums huggingface dataset:
[Optimus One, P500 Original Android Development] Lycan:
The output I get on image resizing in the CMD

ScriptDir = C:\mDroidd-StudioAndroid-GtkUI-15d5542
File = C:\mDroidd-StudioAndroid-GtkUI-15d5542\SAP.py
Resize percentage is 80%
'rm' is not recognized as an internal or external command,
operable program or batch file.
The syntax of the command is incorrect.
SrcDir = C:\Users\WIN7\Desktop/
DstDir = C:\mDroidd-StudioAndroid-GtkUI-15d5542/Resized/
C:\Users\WIN7\Desktop/Capture.PNG -> C:\mDroidd-StudioAndroid-GtkUI-15d5542/Resized
zed/Capture.PNG

Invalid Parameter - /Capture.PNG
C:\Users\WIN7\Desktop/Capture2.PNG -> C:\mDroidd-StudioAndroid-GtkUI-15d5542/Res
ized/Capture2.PNG

Invalid Parameter - /Capture2.PNG

Also on checking C:\mDroidd-StudioAndroid-GtkUI-15d5542\

there is no such folder named 'Resized' ,but a folder named 'Resize' does exist.

Renaming it to 'Resized' only resulted in the program remaking a new folder 'Resize' every time I tried to execute the resize option.

Typo probably :/
[Optimus One, P500 Original Android Development] williamcharles:
I will definitely look upon you for advices whenever i start learning python..atm...life is pretty messed up....

P.S. have plans for learning python pretty soon....:)
[Optimus One, P500 Original Android Development] Lycan:
Do :

- From the Desktop, right-click My Computer and click Properties.

- In the System Properties window, click on the Advanced tab.

- In the Advanced section, click the Environment Variables button.

- Finally, in the Environment Variables window (as shown below), highlight the Path variable in the Systems Variable section and click the Edit button.

- Then add a semicolon after the last line (if it already exists, good enough)

- Then add your SAI folder path, in your case 'C:\mDroidd-StudioAndroid-GtkUI-15d554'
[Optimus One, P500 Original Android Development] williamcharles:
rm should not be used on Windows...It wont work, the command you are looking for is 'del'...for windows cmd...

and second,

the script seems to have some issues with the directory fetching...see the slashes, it includes in the path..

SrcDir = C:\Users\WIN7\Desktop/

DstDir = C:\mDroidd-StudioAndroid-GtkUI-15d5542/Resized/

C:\Users\WIN7\Desktop/Capture.PNG -> C:\mDroidd-StudioAndroid-GtkUI-15d5542/Resized/Capture.PNG

It should have fetched '\' rather than '/' in the red highlighted area.
[Optimus One, P500 Original Android Development] algie17:
,its working now,thanks for the support,ill try to play with this,^^
[Optimus One, P500 Original Android Development] mDroidd:
Thanks for the reply, mind if I include it in OP?
[Optimus One, P500 Original Android Development] mDroidd:
Indeed, I'll switch to os.path.rm or something like that.

About the slashes: Windows is still a pain ** *** ***, because I have a Windows64 os. I can't get it to work :P plus I hate windows.

BuildSource is ALMOST finished, and after that I will fix every bug present and release the first beta.

Sorry @All-windows-guys, I will try everything I can when I have time.

Specificly the Resize mode is something I really want to get ported on windows :D
[Optimus One, P500 Original Android Development] mDroidd:
Not a typo :P

The Resize folder is meant to be there - because some users may find it easier when they have a directory to put it in instead of choosing it.

The Resized folder SHOULD be made when the images are resized, but they are not in your case, so the folder will not be made.

The problem is (I think) imagemagick handling the filenames.

Because imagemagick is built for Windows only on windows, it will not support '/', but '\'.

So that should be edited, I think.
[Optimus One, P500 Original Android Development] williamcharles:
have you tried separating the functions based on OS, in if else....
[Optimus One, P500 Original Android Development] mDroidd:
I did first, but removed it when I figured out Python handles it.

I am not gonna do that, sorry.

If possible, I want support for all platforms with the same number of lines. If not possible, then I will focus on Linux first.

Sorry for that, but I do promise that I will investigate what is possible.
[Optimus One, P500 Original Android Development] williamcharles:
processed file: C:\mDroidd-StudioAndroid-GtkUI-15d5542\Utils\7za
processed file: C:\mDroidd-StudioAndroid-GtkUI-15d5542\Utils\aapt
processed file: C:\mDroidd-StudioAndroid-GtkUI-15d5542\Utils\adb
processed file: C:\mDroidd-StudioAndroid-GtkUI-15d5542\Utils\apktool
processed file: C:\mDroidd-StudioAndroid-GtkUI-15d5542\Utils\apktool.jar
processed file: C:\mDroidd-StudioAndroid-GtkUI-15d5542\Utils\baksmali-1.3.2.jar
processed file: C:\mDroidd-StudioAndroid-GtkUI-15d5542\Utils\media.pk8
processed file: C:\mDroidd-StudioAndroid-GtkUI-15d5542\Utils\media.x509.pem
processed file: C:\mDroidd-StudioAndroid-GtkUI-15d5542\Utils\optipng
processed file: C:\mDroidd-StudioAndroid-GtkUI-15d5542\Utils\platform.pk8
processed file: C:\mDroidd-StudioAndroid-GtkUI-15d5542\Utils\platform.x509.pem
processed file: C:\mDroidd-StudioAndroid-GtkUI-15d5542\Utils\README
processed file: C:\mDroidd-StudioAndroid-GtkUI-15d5542\Utils\Script.sh
processed file: C:\mDroidd-StudioAndroid-GtkUI-15d5542\Utils\shared.pk8
processed file: C:\mDroidd-StudioAndroid-GtkUI-15d5542\Utils\shared.x509.pem
processed file: C:\mDroidd-StudioAndroid-GtkUI-15d5542\Utils\signapk.jar
processed file: C:\mDroidd-StudioAndroid-GtkUI-15d5542\Utils\smali-1.3.2.jar
processed file: C:\mDroidd-StudioAndroid-GtkUI-15d5542\Utils\superuser.pk8
processed file: C:\mDroidd-StudioAndroid-GtkUI-15d5542\Utils\superuser.x509.pem
processed file: C:\mDroidd-StudioAndroid-GtkUI-15d5542\Utils\testkey.pk8
processed file: C:\mDroidd-StudioAndroid-GtkUI-15d5542\Utils\testkey.x509.pem
processed file: C:\mDroidd-StudioAndroid-GtkUI-15d5542\Utils\zipalign
Successfully processed 22 files; Failed processing 0 files
OS = Win
Cores = 8
Home = C:\Users\Parvez
ScriptDir = C:\mDroidd-StudioAndroid-GtkUI-15d5542
File = C:\mDroidd-StudioAndroid-GtkUI-15d5542\SAP.py
Resize percentage is 50%
SrcDir = C:\mDroidd-StudioAndroid-GtkUI-15d5542\Resize
DstDir = C:\mDroidd-StudioAndroid-GtkUI-15d5542\Resized
C:\mDroidd-StudioAndroid-GtkUI-15d5542\Resize\rascarlo_team_kang_037.png -> C:\m
Droidd-StudioAndroid-GtkUI-15d5542\Resized\rascarlo_team_kang_037.png

solved image resizing in windows using if else conditions...
[Optimus One, P500 Original Android Development] williamcharles:
DstDir = ScriptDir + "/Resized/"

Yes, but then you are fetching the present working directory and then appending "/Resized/", now the path becomes

C:\mDroidd-StudioAndroid-GtkUI-15d5542/Resized/"

so this will definitely give you error...hope you understand what i mean here...

EDIT: Please update ur aokp source repo manifest with repo init -u https://github.com/AOKP/platform_manifest.git -b ics

the branch has been changed to ics...
[Optimus One, P500 Original Android Development] mDroidd:
Updated with new AOKP sources,

Updated with choose device from top-bar and remind choice.

Resize updated with "os.path.join" instead of "ScriptDir + "/Resize/", wich is platform independent.

Some bugs fixed and code-cleanup

Build from Source now includes choosing device also and recognize your choice, but not able to "lunch" or "brunch" yet..

@WilliamCharles, could you test this one for me please?
[Optimus One, P500 Original Android Development] mDroidd:
Tell me wich files are inside APK\DEC
[Optimus One, P500 Original Android Development] williamcharles:
there are still problems with the directory structure

WindowsError: [Error 3] The system cannot find the path specified: 'C:\\mDroidd-
StudioAndroid-GtkUI-1f83801\\Resized/*.*'

For Windows to Recognise the directory structure

[b][COLOR=RED]C:\mDroidd-StudioAndroid-GtkUI-1f83801\Resized[/COLOR][/b]
[Optimus One, P500 Original Android Development] mDroidd:
I still want a combined script :P

My script is still messy coded.. I'll look at it when I am at home...

The point is I want the sub-directories inside Resized also. Just the images is easy.

Maybe I'll make a check option to enable/disable sub-directories.
[Optimus One, P500 Original Android Development] mDroidd:
Ok, I think I fixed it.

I am now replacing all stuff like "ScriptDir + "/APK/IN" with "os.path.join(ScriptDir, "APK", "IN")", wich works the same, but is platform-independent.

Lycan, when you decompile an APK, my Script should pick the name, split ".apk" off, make a directory inside APK\DEC called that name (So "WhatsApp" if APK was "WhatsApp.apk"), and decompile the apk in there.

Is that what happened on Windows?

If so, please check if APK\DEC\WhatsApp\apktool.yml exists.

If it does exist, I do know how to solve the problem.

If not, I do know how to solve the problem. :P

Thanks @Lycan, @WilliamCharles, @Nativi for your Windows testing.

I'll add you guys to the credit list.

I hope you will continue helping me here!

PS: I will release this version when Lycan replied.

Pps: from now on, this releases are SuperEarlyPreAlpha releases. SEPA, remember that :P

When I ported all options, it will become Alpha.
[Optimus One, P500 Original Android Development] williamcharles:
will test resize option on windows and let you know....currently on linux building aokp...:D
[Optimus One, P500 Original Android Development] mDroidd:
Yeah, about building, when the bug-free releases are released, I want to talk with you about fixing build errors.

I know I would be very popular when my tool would fix at least some of the errors.

You have Windows 64 or 32??

Ps: sorry, I was talking about DeCompile :P

I still have work on Resize, indeed.

And I did not update my git yet.
[Optimus One, P500 Original Android Development] williamcharles:
Windows-64 bit
[Optimus One, P500 Original Android Development] mDroidd:
If you run the script now using "python SAP.py", it will give no errors anymore.

os.path.abspath() was the solution.

@WC: Uploaded sources, could you test Compiling and resizing again please?
[Optimus One, P500 Original Android Development] williamcharles:
WindowsError: [Error 3] The system cannot find the path specified: 'C:\\mDroidd-StudioAndroid-GtkUI-90c023f\\Resized/*.*'

The os.path adds '\\', windows wont recognize these..and at the end it add...'/'..which is still not supported by windows...
[Optimus One, P500 Original Android Development] mDroidd:
Is '\\' already present at the 'Home =' or 'ScriptDir = '??

Really strange...

I also tried the

str = str.replace('/', '\')

But \ is an escape sequence (I think, don't know how to say it in english), so it is not recognised...

I'll look for some other ways.

Thanks again.
[Optimus One, P500 Original Android Development] Lycan:
I decompiled ContractKiller.apk

There is no 'apktool.yml' folder or file in the decompiled folder

Have a look, I uploaded the folder contents

*Download me*
[Optimus One, P500 Original Android Development] mDroidd:
Only a smali dir?!

Damn...

Decompiling is the problem...

I'll fix this tomorrow, I am really tired right now...

Thanms
[Optimus One, P500 Original Android Development] mDroidd:
Updated.

WC, could you try Resizing again? Sorry...

APK Decompiling still won't work...
[Optimus One, P500 Original Android Development] williamcharles:
DstDir = C:\mDroidd-StudioAndroid-GtkUI-2c47d56\Resized[b][COLOR=RED]/[/COLOR][/b]

the Resize option now works...but change the one highlighted in red above to '\' in windows to avoid any errors furthers...

Plus,

try resizing with HDPI->MDPI method (i.e. second option), you will get resize percentage as 66.66 but in the end you will get resized image as 67*67

Now, try resizing through percentage method (i.e. first method) and give the percentage as 66.66, now you will get resized image as 320*320...

both give different results...do check this out....
[Optimus One, P500 Original Android Development] mDroidd:
Thank you so much.

I'll edit it.

And yes, APK resize, and DPI resize is still messy :(

Thanks
[Optimus One, P500 Original Android Development] mDroidd:
Edited and fixed.

Everything should work now (EasyResize and DpiResize).

Could you try DeCompile and Extract/Repackage now for me??

I added you guys to the credit list:rolleyes::rolleyes::rolleyes:
[Optimus One, P500 Original Android Development] Lycan:
Testing your latest release -

Resize(d) folders are empty

OS = Win
Cores = 2
Home = C:\Users\WIN7
ScriptDir = C:\mDroidd-StudioAndroid-GtkUI-e79d7da
File = C:\mDroidd-StudioAndroid-GtkUI-e79d7da\SAP.py
Resize percentage is 50%
SrcDir = C:\Users\WIN7\Desktop\
DstDir = C:\mDroidd-StudioAndroid-GtkUI-e79d7da\Resized\
C:\Users\WIN7\Desktop\Capture.PNG -> C:\mDroidd-StudioAndroid-GtkUI-e79d7da\Resi
zed\Capture.PNG

Invalid Parameter - -resize
C:\Users\WIN7\Desktop\Capture2.PNG -> C:\mDroidd-StudioAndroid-GtkUI-e79d7da\Res
ized\Capture2.PNG

Invalid Parameter - -resize

On decompiling, the only directory in the DEC folder is the smali dir

I: Baksmaling...
testI: Loading resource table...
W: null
Exception in thread "main" java.lang.NullPointerException
at brut.androlib.res.data.value.ResValueFactory.factory(ResValueFactory.
java:66)
at brut.androlib.res.decoder.ARSCDecoder.readValue(ARSCDecoder.java:222)

at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:177)

at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:165
)
at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:130)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:10
5)
at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:82)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:48)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibRes
ources.java:315)
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.jav
a:50)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.jav
a:43)
at brut.androlib.Androlib.getResTable(Androlib.java:44)
at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:148)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:98)
at brut.apktool.Main.cmdDecode(Main.java:128)
at brut.apktool.Main.main(Main.java:65)
Decompile C:\mDroidd-StudioAndroid-GtkUI-e79d7da\APK\IN\CONTRACT_KILLER_v1.2.4.a
pk

---------- Post added at 11:32 AM ---------- Previous post was at 11:28 AM ----------

Ohh, and here's the extract APK O/P

OS = Win
Cores = 2
Home = C:\Users\WIN7
ScriptDir = C:\mDroidd-StudioAndroid-GtkUI-e79d7da
File = C:\mDroidd-StudioAndroid-GtkUI-e79d7da\SAP.py
C:\mDroidd-StudioAndroid-GtkUI-e79d7da\APK\IN\CONTRACT_KILLER_v1.2.4.apk
'C:\mDroidd-StudioAndroid-GtkUI-e79d7da\7za' is not recognized as an internal or
external command,
operable program or batch file.
[Optimus One, P500 Original Android Development] mDroidd:
Ehm, that can only be the wrong version of imagemagick...

On Windows it is working (WC), and linux also...

I'll look at it again tonight.

About the Decompiling: do you have java installed? I think so..

I'll make some test versions.

Thanks again
[Optimus One, P500 Original Android Development] Lycan:
1. Image Magick Version is : 'ImageMagick-6.7.6-Q16'

Java Version is 'V7 Update 3'

A newer update is available.

Should I download it just to be sure?

Yeah, I'm always ready for testing, mainly because I love this tool on Ubuntu (when i used to use it) but my sister is noob enough for ubuntu hence the Windows OS :(
[Optimus One, P500 Original Android Development] mDroidd:
Yeah download it.

But actually that can't be the problem either...

I'll create a debug system.

Expect an update this evening.
[Optimus One, P500 Original Android Development] williamcharles:
for imagemagick install this version:

http://www.imagemagick.org/download/binaries/ImageMagick-6.7.7-5-Q16-windows-dll.exe

---------- Post added at 12:07 PM ---------- Previous post was at 12:05 PM ----------

couldnt see my name there....:p

EDIT 2: HDPI-> MDPI resize now works fine....
[Optimus One, P500 Original Android Development] mDroidd:
I edited the link in my script, should install the proper version now.

And yeah sorry, I didn't :confused::confused:

I did now :P

@Lycan + WC: I uploaded a new version with a "Debug" option (In the top bar). click it and you will enter the Debug mode.

Then try to resize again Lycan, and give me the full output please.

Thanks.

BTW, if you right-click StudioAndroid icon in the task bar when my script is running, what do you see? Do you see the Option options??

Thanks again

EDIT: Lycan, could you try decompiling an other APK instead for me please??
[Optimus One, P500 Original Android Development] mDroidd:
And now in the APK/DEC/YourAPK/ there should be a smali and res folder, manifest.xml and apktool.yml right?

So installing that other imagemagick version fixed it??

Ok then, up to Recompiling!
[Optimus One, P500 Original Android Development] mDroidd:
Updated!
[Optimus One, P500 Original Android Development] mDroidd:
HEY THERE!

I need someone willing to design new icons as title for the tabs

ALso, an new icon for the whole tool would be nice :)

A SplashScreen is also on my wishlist (Just an image that will be shown on startup).

Thanks in advance!!!
[Optimus One, P500 Original Android Development] mDroidd:
Ow yeah!

Deodexing done :D

I will look at the new toolchain for signing, so you can sign the newly created deodexed update.zip.

I will update this and make it more like a replacement for the Android Kitchen.
[Optimus One, P500 Original Android Development] mDroidd:
Including Binary Port ROM.

Wich means (for example) that AOKP, Gummy, CNA etc can ALL be ported to ANY device with my tool.

After that, I will resume including all functions and then release first BETA.

Will be released in Android Software and Hacking General also this time :D:D:D
[Optimus One, P500 Original Android Development] vlt96:
Can you add possibility to select a custom source URL?

Also, no need to new thread, ask a mod to move it;)

Does it work on windows if it is made as exe with py2exe? You would make it a looooooooooot more easy to windows users;)

I just started python developing, I love it! So intuitive, lot shorter and Java is too looooong an C++ too normal:)

Sent from my LG-P500
[Optimus One, P500 Original Android Development] mDroidd:
Why would you do that?

And yes it would work. i tried freeze and pyinstall already, did not work...

Yeah, python is awesome.

Are you interested in joining the team to help me? I'm sure you can help me, and I will teach you if necessary!
[Optimus One, P500 Original Android Development] vlt96:
Custom source URL for building ROM from source:)

I would gladly join the team, one more week of school, but be aware I know python and did the basics, but today was my 1st day (and I spent an hour trying to realise that my whole project was %@&#ed because I put pi=3,14 instead of pi=3.14)

It is your choice, and I am more of a Guy who loves the math side of the force:)

Sent from my LG-P500
[Optimus One, P500 Original Android Development] mDroidd:
Me too, one more week school..

When I started this GTK project, I had 0 experience in anything but bash.

You can join ;)

You can do the resize project if you want, to calculate (=math) the resize percentage?
[Optimus One, P500 Original Android Development] vlt96:
You mean

percentage = final_size*100//initial_size

I will learn how to get the size of files 1st lol:) I am the part where I do terminal apps:| but this made me great at any kind of algorithm ;)

Sent from my LG-P500
[Optimus One, P500 Original Android Development] williamcharles:
You can included options for aokp/gummy/cna to build from source...but do make a point in thread that these roms require additional armv6 support which they dont have it in general...:)
[Optimus One, P500 Original Android Development] mDroidd:
Nah, you don't need the image size, only the resize percentage.

With stock DPIs, that is (width of screen you want to port to)/(screen width from) * 100

That's not hard.

But then people appeared withput stock DPIs :/

That's the problem on Resizing.

@WC: Yes, I know, but sorry, I have other priorities atm :(
[Optimus One, P500 Original Android Development] mDroidd:
I need a windows guy to test something for me.

Windows users currently have to install a bunch of packages before they are able to use my tool.

If you want to prevent this in the future, please follow this instructions:

Full credit will be given!
[Optimus One, P500 Original Android Development] vlt96:
I tried to run the file without extension, but cmd can't run it... .py gives error cannot find module I don't remember what

Sent from my LG-P500
[Optimus One, P500 Original Android Development] mDroidd:
Ow yeah, I forgot, you need to open the .py file with a text editor, and remove the 2 lines that look like this:

from Source.SourceStock import *

from Source.SourceP500 import *

@Line 12 or something.

Then try again.
[Optimus One, P500 Original Android Development] vlt96:
I didn't remove anything and they worked eventually:)

I tried py2exe and it doesn't compile additional modules, still working hard to find a way to install pyinstaller

Sent from my LG-P500
[Optimus One, P500 Original Android Development] mDroidd:
Install PyInstaller?

Just click my link?

Or you go to their website, download the "Source" folder, and extract it. then read the README.txt
[Optimus One, P500 Original Android Development] shinobisoft:
@mDroidd

I see that you are using python, as the installer I guess, for sai. I would like to offer my skills as a c programmer for windows to write an installer for sai. If you are interested, contact me thru pm. I have a regular day job, electrician, so I may not respond immediately. Basically I just need to know what goes where.
[Optimus One, P500 Original Android Development] Rookie407:
Resize Issue With Windows

im using the windows version of this and idk if im doing something wrong or if the feature just doesnt work but when i try to resize images it goes all the way to the end where it says "images will be found in resized folder" but nothings there.

steps i've tryed are as follows

put each folder into the resize folder and linked it using option 2

and put the whole .apk into the folder and linked it using option 3

havent tryed option 1 as i dont know the precentages for MDPI or HDPI. any help is appreciated...

thanks
[Optimus One, P500 Original Android Development] mDroidd:
Insidethe terminal, does it give output like "resized xxx -> xxx"?

If not, it doesn't find the images. Please delete the log, and try to reproduce the issue. Then give me the EXACT log output please.

Thanks in advance!
[Optimus One, P500 Original Android Development] Rookie407:
using windows version... no terminal but the python cmd just shows

where it says give ..DPI in option 2 am i supposed to put HDPI/MDPI or the percentage??? if its the percentage then idk what it is for either H or M. =\
[Optimus One, P500 Original Android Development] mDroidd:
In the "Enter ...DPI", you need to fill in "HDPI" or "MDPI".

OK, I found the bug.

you need to replace the "/" in the text box with "\". Windows does not recognise "/"... Will not show up anymore in next release.

THANKS!!
[Optimus One, P500 Original Android Development] Rookie407:
even doing that there is still no images in the "Resized" folder. trying to convert HDPI to MDPI posted screenshot to show how i set it up...

yields the same result "no image found" in the "Resized" folder
[Optimus One, P500 Original Android Development] mDroidd:
The last thing I need to fix is the zipalign failure, and then we have our next release.

I hope someone on Windows is willing to do something for me: compile my tool.

That means, no one would have to install Python and PyGTK anymore, but can just run an exe.

If you are interested, and are using Windows, Please, I BEG YOU, PM me :crying::crying:

A Bug Reporting function has been added also, the log content will be copied to the clipboard and a new reply will be opened.

Thanks to all who support me!
[Optimus One, P500 Original Android Development] Rookie407:
more then willing to help if you know how to compile .exe's =)

---------- Post added at 10:15 AM ---------- Previous post was at 10:12 AM ----------

seems no matter which direction the /\ is I still get

again using option 2 cuz i dont understand option 3 and dont know the percentages for option 1