- 22 Jan 2025
- 2 Minutes à lire
- SombreLumière
- PDF
App Shielding error reporting
- Mis à jour le 22 Jan 2025
- 2 Minutes à lire
- SombreLumière
- PDF
If an application has to shut down (either because it is terminating unexpectedly, or it detected a security problem), the application can exit and log a proper stack trace.
If the application is installed via Google Play, the user will be prompted to report the problem, and it will appear in the Google Play Console. Otherwise, the shutdown reason is accessible via logcat.
A shutdown reason that points back to App Shielding will be a subclass of ShieldException with a hex-coded string message for additional encoded information.
An example of a de-obfuscated crash report with stack trace may look something like this:
FATAL EXCEPTION:
at no.promon.shield.ex.RepackagingException: 01 at no.promon.shield.Report.getException(Report.java:38) at no.promon.shield.Report.report(Report.java:76) at no.promon.shield.LibStarter.appCreated(Native Method) at no.promon.shield.LibStarter.doPhase2(LibStarter.java:124) at no.promon.shield.LibStarter.startLibWithContext(LibStarter.java:95) at no.promon.shield.LibStarter.startLibFromAppMonitor(LibStarter.java:66) at no.promon.shield.AppMonitor.onCreate(AppMonitor.java:17) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1032) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5970) at android.app.ActivityThread.-wrap3(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1710) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6776) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
The stack trace will have distinct exception classes depending on the reason for the shutdown. By default, the stack trace will contain obfuscated class names. These can be decoded using the ProGuard retrace tool with the mappings.txt file as produced by the Shielding Tool. This mapping file can also be uploaded to Google Play for it to automatically decode stack traces in the Google Play Console.
The message part of this example stack trace points to 01, which indicates repackaging detection, and this is consistent with RepackagingException. Other shutdown reasons will use different exception classes and message encoding. The first two characters of the message refer to the shutdown reason. See the table below for a description of these reasons. The hex code is stripped on Google Play Console, but will be accessible via logcat. The classname will indicate what triggered the exit condition regardless, and are listed in the table below.
If more than two characters are present, App Shielding has encoded other types of information pertinent to the shutdown reason. For further analysis, forward the error message to OneSpanTechnical Support: support@onespan.com.
List of shutdown reasons
The following shutdown reasons are possible:
List of shutdown reasons | ||
Exception Class | Code | Description |
---|---|---|
RootException | 00 | Device is rooted, see Root detection. |
RepackagingException | 01 | Application is modified or repackaged, see Repackaging detection. |
EmulatorException | 02 | Application is being run in an emulator, see Emulator detection. |
DebuggerException | 03 | Java debugger attached to app, see Debugger protection. |
KeyboardException | 04 | Untrusted keyboard found, see Keylogger protection. |
ScreenReaderException | 05 | Untrusted screen reader found, see Screen reader protection. |
NativeHookException | 06 | Native code hooks, possibly inserted by malicious app, see Code injection protection. |
LicenseExpiredException | 07 | Time limited license expired |
ConfigException | 08 | App Shielding could not read configuration file |
NativeDebuggerException | 09 | Problem with Native Debugger Protection |
NativeDebuggerException | 0A | Problem with Native Debugger Protection |
NativeDebuggerException | 0B | Problem with Native Debugger Protection |
NativeDebuggerException | 0C | Problem with Native Debugger Protection |
NativeDebuggerException | 0D | Problem with Native Debugger Protection |
NativeDebuggerException | 0E | Problem with Native Debugger Protection |
NativeDebuggerException | 0F | Problem with Native Debugger Protection |
NativeDebuggerException | 10 | Problem with Native Debugger Protection |
NativeDebuggerException | 11 | Problem with Native Debugger Protection |
Not in Use | 12 | Reserved for future use |
RegisterNativesException | 13 | Problem initializing App Shielding |
NativeSignalException | 14 | App received termination signal |
CrashException | 15 | Application terminated unexpectedly outside of Java-code, either native library or App Shielding. |
HookingFrameworkException | 16 | Hooking frameworks detected, see Code injection protection. |
DebuggerException | 17 | Native debugger prevention not possible on this device. |
DeveloperOptionsException | 1a | Developer Options enabled on device |
UntrustedInstallerException | 1b | Untrusted Installer found on device |
AdbStatusException | 1c | Android Developer Bridge active on device |
AppInVirtualSpaceException | 1d | Application is launched via Virtual Space application |
EmulatedInputException | 1f | Emulated input detected |
PrivateSpaceException | 20 | Application is launched in a Private Space or WorkProfile. |
App Shielding can be configured to not create such stack traces by enabling the shutdownImmediately configuration option.