forked from Ivasoft/mattermost-mobile
Remove mock locations from jailbrake detection (#7005)
This commit is contained in:
@@ -78,7 +78,7 @@ class ManagedApp {
|
||||
|
||||
const jailbreakProtection = config!.jailbreakProtection === 'true';
|
||||
if (jailbreakProtection && !this.isTrustedDevice()) {
|
||||
this.alertDeviceIsUntrusted();
|
||||
this.alertDeviceIsNotTrusted();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -88,14 +88,17 @@ class ManagedApp {
|
||||
}
|
||||
};
|
||||
|
||||
alertDeviceIsUntrusted = () => {
|
||||
alertDeviceIsNotTrusted = () => {
|
||||
// We use the default device locale as this is an app wide setting
|
||||
// and does not require any server data
|
||||
const locale = DEFAULT_LOCALE;
|
||||
const translations = getTranslations(locale);
|
||||
Alert.alert(
|
||||
translations[t('mobile.managed.blocked_by')].replace('{vendor}', this.vendor),
|
||||
translations[t('mobile.managed.jailbreak')].replace('{vendor}', this.vendor),
|
||||
translations[t('mobile.managed.jailbreak')].
|
||||
replace('{vendor}', this.vendor).
|
||||
replace('{reason}', JailMonkey.jailBrokenMessage() || translations[t('mobile.managed.jailbreak_no_reason')]).
|
||||
replace('{debug}', JSON.stringify(JailMonkey.androidRootedDetectionMethods || translations[t('mobile.managed.jailbreak_no_debug_info')])),
|
||||
[{
|
||||
text: translations[t('mobile.managed.exit')],
|
||||
style: 'destructive',
|
||||
@@ -139,7 +142,7 @@ class ManagedApp {
|
||||
};
|
||||
|
||||
isTrustedDevice = () => {
|
||||
return __DEV__ || JailMonkey.trustFall();
|
||||
return __DEV__ || !JailMonkey.isJailBroken();
|
||||
};
|
||||
|
||||
onAppStateChange = async (appState: AppStateStatus) => {
|
||||
|
||||
@@ -527,7 +527,9 @@
|
||||
"mobile.login_options.sso_continue": "Continue with",
|
||||
"mobile.managed.blocked_by": "Blocked by {vendor}",
|
||||
"mobile.managed.exit": "Exit",
|
||||
"mobile.managed.jailbreak": "Jailbroken devices are not trusted by {vendor}, please exit the app.",
|
||||
"mobile.managed.jailbreak": "Jailbroken devices are not trusted by {vendor}.\n\nReason {reason}\n\n\n\nDebug info: {debug}\n\nPlease exit the app.",
|
||||
"mobile.managed.jailbreak_no_debug_info": "Not available",
|
||||
"mobile.managed.jailbreak_no_reason": "Not available",
|
||||
"mobile.managed.not_secured.android": "This device must be secured with a screen lock to use Mattermost.",
|
||||
"mobile.managed.not_secured.ios": "This device must be secured with a passcode to use Mattermost.\n\nGo to Settings > Face ID & Passcode.",
|
||||
"mobile.managed.not_secured.ios.touchId": "This device must be secured with a passcode to use Mattermost.\n\nGo to Settings > Touch ID & Passcode.",
|
||||
|
||||
Reference in New Issue
Block a user