nmilcoff / BreachDetector

Detect root, emulation, debug mode and other security concerns in your Xamarin apps
MIT License
88 stars 12 forks source link

[iOS] in TestFlight IsInstalledFromStore() returns false #9

Open gsgou opened 4 years ago

gsgou commented 4 years ago

In TestFlight IsInstalledFromStore() returns false. In Android closed track where i could test returns true (or null) as expected.

To be more precise i use following code snippet:

bool isRootOrJailbreak = CrossBreachDetector.Current.IsRooted() == true;
bool notFromStore = CrossBreachDetector.Current.InstalledFromStore() == false;
bool isVirtualDevice = CrossBreachDetector.Current.IsRunningOnVirtualDevice() == true;
if (isRootOrJailbreak || notFromStore || isVirtualDevice)
{
}

both two iOS testers i have confirm the phones are not jailbroken.

mina5500 commented 3 years ago

isrooted returns always true from any android emulator if Google Play Store is unchecked in Emulator Properties .. is that normal ? image

nmilcoff commented 3 years ago

Hi @mina5500, that is correct. All emulators are rooted 🙂

mina5500 commented 3 years ago

once i check on Google Play Store in Emulator Properties in previous image ... it shows isrooted() false

Hi @mina5500, that is correct. All emulators are rooted 🙂

@nmilcoff

thomasgalliker commented 2 years ago

What is a 'good practice' regarding TestFlight? We use BreachDetector's IsInstalledFromStore also in apps which are distributed for testing via Apple's official test app "TestFlight". Would you flag such TestFlight-builds in order to not annoy any test users by showing them security warnings?

Interesting article on Stackoverflow: https://stackoverflow.com/questions/26081543/how-to-tell-at-runtime-whether-an-ios-app-is-running-through-a-testflight-beta-i

Update: I added following method to my code in order to exclude TestFlight builds from tracking as 'insecure devices':

public bool IsTestFlightBuild()
{
    var appStoreReceiptUrl = NSBundle.MainBundle.AppStoreReceiptUrl;
    return appStoreReceiptUrl?.LastPathComponent.Contains("sandboxReceipt") == true;
}