mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-05 18:25:31 +08:00
Fixed: Catch exceptions if failed to bypass hidden API restrictions
Attempting to bypass restrictions while tests are running will fail due to call to `TermuxApplication.onCreate()` -> `TermuxShellEnvironment.init()` -> `SELinuxUtils.getContext()`
This commit is contained in:
@@ -28,7 +28,12 @@ public class ReflectionUtils {
|
||||
public static void bypassHiddenAPIReflectionRestrictions() {
|
||||
if (!HIDDEN_API_REFLECTION_RESTRICTIONS_BYPASSED && Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
Logger.logDebug(LOG_TAG, "Bypassing android hidden api reflection restrictions");
|
||||
HiddenApiBypass.addHiddenApiExemptions("");
|
||||
try {
|
||||
HiddenApiBypass.addHiddenApiExemptions("");
|
||||
} catch (Throwable t) {
|
||||
Logger.logStackTraceWithMessage(LOG_TAG, "Failed to bypass hidden API reflection restrictions", t);
|
||||
}
|
||||
|
||||
HIDDEN_API_REFLECTION_RESTRICTIONS_BYPASSED = true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user