Security is a very important point and little discussed when we talk about software development. As much as it is a topic that should be a priority, it is usually addressed only when there is a S. Problem.
In applications, I would say that security is a key point to be concerned about. Many people might even say: “It’s that Android there that can install any App from any source… I need to worry”.
Okay, but what about iOS? Wow, iOS apps don’t have to be approved by Apple? Sandbox? etc, etc? What if the owner has been jailbroken? Oh yeah, there’s this…
Many applications (such as banking) carry sensitive information, have internal purchases, and store various types of data that you would not want anyone to have access to.
For these reasons and others, today we are talking a little about how to prevent our Apps from running in conditions that can be considered unsafe. To make our life easier, Nico Milcoff came to help us with the BreachDetector plugin!
This easy-to-use plugin can tell us if our app is on an unlocked cell phone (Root on Android / Jailbreak on iOS), if the app was installed from the store, if it’s an emulator, etc. etc, etc, etc. With this, we can disable our APP, avoiding the loss or misuse of data 🙂
Let’s see how it works.
Platforms supported by the plugin are:
-> iOS +10
-> Android API +21
-> UWP Build +10240
Installing the Plugin
Let’s go to Nuget to install Plugin.BreachDetector in all our projects:
Now on iOS, we need to add some lines in the Info.plist (to verify the jailbreak):
If you want to use the function to verify the type of security/authentication of the iPhone that the app is installed on, you also need to add the following settings:
Done! Now just use 😀
Using the Plugin
To exemplify let’s create a simple screen with the functionalities:
Very simple and useful to ensure that our APP is safe, right?
There are more security tips from Nico Himself in the official repository.
And as you saw, this is writing Part 1 because I still intend to bring more things related to the theme. 🙂
If you want to see an example cited in the article: Click here.
Want to see other articles about Xamarin? Click here.
Hope this helps!
All the best!