Class Hardening
java.lang.Object
com.codename1.security.hardening.Hardening
Read-only reporting of whether this build was hardened, and with what.
App Hardening is an Enterprise, build-server transform: it renames classes, encrypts strings and obfuscates control flow in the shipped binary across every port. This class does not perform any of that -- it only reports what the build server stamped into the app, so app code (and the crash reporter) can tell an honestly-hardened build apart from an unhardened one such as a local or simulator build.
The values are stamped as display properties by the build; in the simulator
and in local builds they report false / "off", because those are never
obfuscated.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetLevel()The hardening level the build shipped with.static StringThe id of the obfuscation mapping this build was hardened with, matching the mapping the build server retained for crash symbolication.static booleanWhether the shipped binary was hardened.
-
Method Details
-
isHardened
public static boolean isHardened()Whether the shipped binary was hardened. Alwaysfalsein the simulator and in local or source-project builds, which are never obfuscated.- Returns:
- true if the build server applied hardening to this build
-
getLevel
The hardening level the build shipped with.- Returns:
- one of
"off","standard","aggressive","paranoid"
-
getMappingId
The id of the obfuscation mapping this build was hardened with, matching the mapping the build server retained for crash symbolication. Empty when the build was not hardened.- Returns:
- the mapping id, or an empty string
-