File | Save all
Zelix KlassMaster saves all opened classes in their current state. If you have used the Tools|Obfuscate
menu option then the classes will be saved in their obfuscated state.
Zelix KlassMaster saves class files, into the selected directory, using the current class names and the ".class" extension.
It places the files into directories that reflect the classes package and will automatically
create directories if necessary. So a Class named package1.Class1 will be saved in a file called
Class1.class in the package1 directory.
See below for more detail on
If you opened any classes directly from directories then they will be saved into corresponding directories.
In the interests of safety, you should not save your classes back into the directories from which you opened them,
especially if you no longer have the source code. Zelix KlassMaster will not warn you before overwriting existing class files.
If you opened classes from JAR, WAR, EAR or ZIP archive files, then Zelix KlassMaster's Smart Save will save the
class files to a new, identically named archive file in the selected directory.
If a file with the same name already exists in the selected directory, then the existing file will be renamed by appending the ".BACKUP" extension.
Zelix KlassMaster automatically handles nested archive files such an EAR archive that contains a WAR archive that contains a JAR archive.
Also, it will create new archives as uncompressed if the source archive was uncompressed.
The following special handling is provided for files appearing in the
META-INF
directory.
- If a manifest file (ie.
META-INF/MANIFEST.MF ) appears in a particular archive, then a manifest file will be created in the
new archive. The following standard attributes will be re-created in the new manifest
Manifest-Version
Class-Path
Main-Class
Sealed
Name
Java-Bean
The Main-Class and Name attribute values will be translated to reflect any new obfuscated class names.
However, all signing information is lost. Non-standard attributes in the main section and the entry sections of the manifest will be copied across after translation.
- If an EJB deployment descriptor file (ie.
META-INF/ejb-jar.xml ) appears in a particular archive, then it will be copied
to the new archive after
ejb-class
home
remote
local
local-home
prim-key-class
dependent-class
method-param
values have been translated to reflect new obfuscated class names and
values, where they appear within an entity segment, have been translated to reflect new obfuscated field names and
values have been translated to reflect potentially new obfuscated path names. Note that method names are never translated and
that Zelix KlassMaster does not yet support the field and method name conventions of the EJB 2 specification.
However, Zelix KlassMaster does support the the updating of EJB 3 annotations which provide an alterative to putting field and method names in XML.
- Spring XML files will be copied across
- with class names updated to reflect obfuscated names
- with the names of properties updated to reflect obfuscated getter and setter method names
- However, the default
destroy-method specified in the <beans> tag will not be updated.
- Hibernate XML files will be copied across
- with class names updated to reflect obfuscated names
- with the names of properties updated to reflect obfuscated getter and setter method names
- However, HQL queries embedded as strings within Java classes will not be updated.
- Google Android AndroidManifest.xml files will be copied across with class and package names updated to reflect obfuscated names.
- All other XML files will be copied to the new archive after values have been translated to reflect new obfuscated class names. These include
application.xml
web.xml
application-client.xml
tld (tag library definition)
files.
- All files in the
META-INF/services directory will be saved to the corresponding directory in the new archive file after
- the file names have been translated to reflect the new fully qualified name of the abstract service classes
- the names of the concrete provider classes listed within each file have been translated to reflect their new obfuscated names.
- The INDEX-LIST file will be copied across and updated if necessary to reflect obfuscated class names.
- Any SF, DSA, RSA or PGP files in the META-INF directory will NOT be copied across.
Zelix KlassMaster Smart Save provides special handling of non-class files such as image and properties files.
All non-class files contained in the an opened archive will be copied across to the corresponding archive file in the selected directory.
Note that files within the META-INF directory are specially handled.
If package names have been obfuscated, the paths of non-class files stored in
directories corresponding to Java packages will be changed to match the new package names. Thus calls to methods
such as Class.getResource(String) and Class.getResourceAsStream(String) that use relative paths
will not be broken. Similar calls using absolute paths will not be broken provided the path does NOT include a Java package
directory name that has been obfuscated.
|