Skip to content

Instantly share code, notes, and snippets.

View xiaomi7732's full-sized avatar
๐Ÿ˜ƒ
Active

Saar Shen xiaomi7732

๐Ÿ˜ƒ
Active
View GitHub Profile
@xiaomi7732
xiaomi7732 / ApiVersionAttribute.cs
Created July 31, 2023 21:04 — forked from commonsensesoftware/ApiVersionAttribute.cs
Implement Custom API Version Format
public sealed class ApiVersionAttribute : Asp.Versioning.ApiVersionAttribute
{
public ApiVersionAttribute( string version )
: base( CustomApiVersionParser.Default, version ) { }
public ApiVersionAttribute( string token1, string token2, string? token3 = default )
: base( new CustomApiVersion( token1, token2, token3 ) ) { }
}
@xiaomi7732
xiaomi7732 / Xamarin.Android.PlatformEncryptionKeyHelper.cs
Created January 19, 2022 05:33 — forked from MSiccDev/Xamarin.Android.PlatformEncryptionKeyHelper.cs
Helper class to securely create encryption keys without the need of user interaction on Android. There are way to much samples that use some hardcoded values which could be compromised. The keys of this class are only available for usage within the app that created them. Plus, if the app gets uninstalled, the keys get deleted.
using Android.Content;
using Android.OS;
using Android.Security;
using Android.Security.Keystore;
using Java.Math;
using Java.Security;
using Javax.Security.Auth.X500;
using Calendar = Android.Icu.Util.Calendar;
using CalendarField = Android.Icu.Util.CalendarField;