33 lines
862 B
C#
33 lines
862 B
C#
using Android.Provider;
|
|
|
|
namespace IronLicensing.Client;
|
|
|
|
public partial class MachineIdentifier
|
|
{
|
|
private partial List<string> GetMachineComponents()
|
|
{
|
|
var components = new List<string>();
|
|
|
|
try
|
|
{
|
|
// Android ID - unique to each app/device combination
|
|
var context = Android.App.Application.Context;
|
|
var androidId = Settings.Secure.GetString(context.ContentResolver, Settings.Secure.AndroidId);
|
|
if (!string.IsNullOrEmpty(androidId))
|
|
{
|
|
components.Add(androidId);
|
|
}
|
|
|
|
components.Add(Android.OS.Build.Brand ?? "");
|
|
components.Add(Android.OS.Build.Model ?? "");
|
|
components.Add(Android.OS.Build.Serial ?? "");
|
|
}
|
|
catch
|
|
{
|
|
// Fallback
|
|
}
|
|
|
|
return components;
|
|
}
|
|
}
|