[Android Software/Hacking General [Developers Only]] the.gangster:
Sign-em-anywhere 3.0

So here we go... although I would have liked an answere by ryuinferno, as this is his thread.

This is now: sign-em-anywhere 3.0.

It is only an extension to sign-em 2.0, so the download will provide both versions.

I really tried to make it noob-safe. Hope I managed to do that.

And I never asked for pressing thank-button, but this time I think it would only be fair you would use it, if you like my 650 lines of code.

Have fun.

Best regards

the.gangster

Taken from the README:

If you don't change anything sign-em-anywhere 3.0 will behave like Ryuinferno's sign-em.bat 2.0,

except that it

- is no longer prone to spaces or even brackets in paths or filenames,

- uses Java autodetection

- should leave no doubt if finished successfully or not

- writes unique md5-files (like supported by modern recoveries) instead of dumping all hashes into one md5.txt

The signing itself will still be done with the certificates by RYU.

Whenever the script "thinks" that it could have been started from explorer it will offer you the chance to optionally provide additional parameters.

But I also added some more features.

For the hottest one, that will bring you the windows explorer integration, you need to edit the script,

but it will even tell you what to modify and where in the script.

You will see something like:

. . . . checking prerequisites first...

____ ERROR: YOU HAVE TO DEFINE wkSignem variable in the script first

++++ Advice:

Change from line 20:set wkSignEm=PLEASE_ENTER_PATH_TO_signapk.jar

change to line 20:set wkSignEm=x:\whereever you extracted this to\Tools

____ SORRY: Failed prerequisite

As almost all parameters should be explained in the script's help already, I will only paste it's output in here. Please read it, not to miss a feature.

For all supported configuration settings use /? variables. Editing should only be done in the configuration section.

e.g. wkJavaXmxSize has to be lowered on machines with less than 8GB RAM or 32bit-Java editions.

I left it preconfigured to 4000 MB to cope even with uncompressed ROM.zip files of CyanDelta.

Tested on Windows x64 with 8GB RAM and (portable) 64bit-Java.

This is the help output:

_________________________________________________________________________________________________________

Sign-em-anywhere v3.0 by the.gangster @ XDA 2015

originally based upon Sign-em v2.0 by Ryuinferno @ XDA 2013

- modded by the.gangster to support some more stuff:

- added support for: Files as well as foldernames now are allowed to have spaces

- added support for: Autosearch Java.exe in default directories and registry

- added support for: Defining an explicit Java directory (useful for portable versions)

- added error detection: in most cases it will leave no doubt if an error occured

- added support for: Commandline parameters

- * /? show usage and help info

- * /SIM simulation only if you only want to see what would be done

- * /SearchJava search for installed Java versions

- * /JavaInfo show java.exe version and possible extended non-standard commandline parameters

- * /SendTo copy script for enabling integration into Explorer's SendTo functionality

- * /out use output directory instead of source directory for writing signed files

- * /out path use named path as output directory

- * ZipFile(s) inputfile(s) can be given by commandline or by using "send to" in explorer now

You called: sign-em-anywhere.cmd **** with paras: /?

Detected screen resolution of 1920x1080

resized console to 230 colums

using local paths...

########################## H E L P #################################################

sign-em-anywhere.cmd Script for signing zip files

SYNTAX: sign-em-anywhere.cmd [/SIM] [/OUT [alternate path]] [ZipFile1 [ZipFile2] ...]

or sign-em-anywhere.cmd /SendTo

or sign-em-anywhere.cmd /SearchJava

or sign-em-anywhere.cmd /JavaInfo

Supported parameters (COMMANDS) are:

/?

Show help in case someone asks for it

/debug

Can be used to override preconfigured setting by commandline

- '/debug off' to turn off verbose mode

- '/debug on' (or only /debug) to turn on verbose mode

/sim

Used only for simulation or testing.

This will show commands instead of executing them.

Must be first parameter if combined with '/SendTo'

/out

Used for defining the target directory of signed files

Can be very useful if 'sending to' from a read-only filesystem

or an MTP mounted device where zips get opened in some temp folder first

- if used followed by a foldername, that foldername will be used

- otherwise, the signed files will be written to "X:\%YourPath%\Output"

/SearchJava

Allows you to search for installed Java.exe files.

Will search default file and registry paths.

/javainfo

Show Java version information as well as extended non-standard

commandline parameter information that could be used

/SendTo

This allows you to copy the current script to the SENDTO folder.

- Once done you will be able to use Windows Explorer to right-click on a zip

or a selection of multiple zip files and choose 'Send To sign-em-anywhere.cmd'

So no copying to any Input folder needed.

- Then by default the signed ZIP will be written to the folder where the unsigned

zip originated from. But that outputfolder can also be overruled by /out parameter.

- Also a named file will be created with the md5 sum

/config

Edit this script at the location it is currently running from.

- making it easier to edit the copy in e.g. SendTo-Folder for having

a configuration that differs from the main one.

DETAILED CONFIGURATION SETTINGS HELP:

/? variables

will give detailed description of the settings in the config section header

ADDITIONAL INFORMATION:

if a signed file already exists at the target location it will be overwritten

CURRENT CONFIGURATION:

wkSignEm : X:\%YourPath%\Tools

Configured for autodetecting a Java version

(You can use parameter /SearchJava or /Sim for searching beforehand)

Java parameters: -Xdiag -Xmx4000m