diff --git a/README.md b/README.md new file mode 100644 index 0000000..c72fd28 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +## Prerequisute + +### Flutter Sample App + +- flutter 3.10.0 + +### Xamarin Sample App + +- .NET 5+ + - Xamarin Workload in Visual Studio + +## Note On Credential + +This sample app isn't meant to be relased or used so no attempt is made to secure the keystore. diff --git a/XamarinFormSample/Sample.Shared/MainViewModel.cs b/XamarinFormSample/Sample.Shared/MainViewModel.cs index ed0e0dc..597e934 100644 --- a/XamarinFormSample/Sample.Shared/MainViewModel.cs +++ b/XamarinFormSample/Sample.Shared/MainViewModel.cs @@ -19,7 +19,7 @@ public class MainViewModel : INotifyPropertyChanged public delegate void ErrorRaisedHandler(object sender, Exception e); private AuthgearSdk authgear; private readonly IAuthgearFactory authgearFactory; - public readonly string RedirectUri = "com.authgear.exampleapp.xamarin://host/path"; + public readonly string RedirectUri = "com.authgear.migrate.tool.xamarin.flutter.sample://host/path"; public string ClientId { get; set; } = Preferences.Get("authgear.clientID", Config.AuthgearClientId); public string AuthgearEndpoint { get; set; } = diff --git a/XamarinFormSample/XamarinFormSample.Android/MainActivity.cs b/XamarinFormSample/XamarinFormSample.Android/MainActivity.cs index 3c46bf7..f6ad7ee 100644 --- a/XamarinFormSample/XamarinFormSample.Android/MainActivity.cs +++ b/XamarinFormSample/XamarinFormSample.Android/MainActivity.cs @@ -10,7 +10,7 @@ namespace XamarinFormSample.Droid { - [Activity(Label = "Authgear SDK XamarinFormSample", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize )] + [Activity(Label = "Authgear Migrate Tool XamarinToFlutter Xamarin", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize )] public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity { protected override void OnCreate(Bundle savedInstanceState) diff --git a/XamarinFormSample/XamarinFormSample.Android/Properties/AndroidManifest.xml b/XamarinFormSample/XamarinFormSample.Android/Properties/AndroidManifest.xml index 7eea42e..2333639 100644 --- a/XamarinFormSample/XamarinFormSample.Android/Properties/AndroidManifest.xml +++ b/XamarinFormSample/XamarinFormSample.Android/Properties/AndroidManifest.xml @@ -1,7 +1,7 @@  - + - + diff --git a/XamarinFormSample/XamarinFormSample.Android/WebAuthenticationCallbackActivity.cs b/XamarinFormSample/XamarinFormSample.Android/WebAuthenticationCallbackActivity.cs index f03f3fe..b7bb330 100644 --- a/XamarinFormSample/XamarinFormSample.Android/WebAuthenticationCallbackActivity.cs +++ b/XamarinFormSample/XamarinFormSample.Android/WebAuthenticationCallbackActivity.cs @@ -12,7 +12,7 @@ namespace XamarinFormSample.Droid [Activity(NoHistory = true, LaunchMode = LaunchMode.SingleTop, Exported = true)] [IntentFilter(new[] { Android.Content.Intent.ActionView }, Categories = new[] { Android.Content.Intent.CategoryDefault, Android.Content.Intent.CategoryBrowsable }, - DataScheme = "com.authgear.exampleapp.xamarin")] + DataScheme = "com.authgear.migrate.tool.xamarin.flutter.sample")] public class WebAuthenticationCallbackActivity : Xamarin.Essentials.WebAuthenticatorCallbackActivity { } diff --git a/XamarinFormSample/XamarinFormSample.Android/XamarinFormSample.Android.csproj b/XamarinFormSample/XamarinFormSample.Android/XamarinFormSample.Android.csproj index 2b95a6b..d485e54 100644 --- a/XamarinFormSample/XamarinFormSample.Android/XamarinFormSample.Android.csproj +++ b/XamarinFormSample/XamarinFormSample.Android/XamarinFormSample.Android.csproj @@ -37,6 +37,11 @@ false false + true + D:\work\authgear-tool-migrate-xamarin-flutter\keystore-main.jks + Abcd1234! + main + Abcd1234! true @@ -47,6 +52,11 @@ 4 true false + true + D:\work\authgear-tool-migrate-xamarin-flutter\keystore-main.jks + Abcd1234! + main + Abcd1234! diff --git a/XamarinFormSample/XamarinFormSample.Android/XamarinFormSample.Android.csproj.user b/XamarinFormSample/XamarinFormSample.Android/XamarinFormSample.Android.csproj.user index 64ee147..b512129 100644 --- a/XamarinFormSample/XamarinFormSample.Android/XamarinFormSample.Android.csproj.user +++ b/XamarinFormSample/XamarinFormSample.Android/XamarinFormSample.Android.csproj.user @@ -4,5 +4,6 @@ Google Pixel 7a PhysicalDevice Google Pixel 7a %28Android 14.0 - API 34%29 + Windows Subsystem for Android \ No newline at end of file diff --git a/XamarinFormSample/XamarinFormSample.iOS/Entitlements.plist b/XamarinFormSample/XamarinFormSample.iOS/Entitlements.plist index 7affdcb..06eb299 100644 --- a/XamarinFormSample/XamarinFormSample.iOS/Entitlements.plist +++ b/XamarinFormSample/XamarinFormSample.iOS/Entitlements.plist @@ -4,7 +4,7 @@ keychain-access-groups - com.authgear.exampleapp.xamarin + com.authgear.migrate.tool.xamarin.flutter.sample diff --git a/XamarinFormSample/XamarinFormSample.iOS/Info.plist b/XamarinFormSample/XamarinFormSample.iOS/Info.plist index e28eba7..0db4c71 100644 --- a/XamarinFormSample/XamarinFormSample.iOS/Info.plist +++ b/XamarinFormSample/XamarinFormSample.iOS/Info.plist @@ -14,10 +14,10 @@ CFBundleTypeRole Editor CFBundleURLName - com.authgear.exampleapp.xamarin://host/path + com.authgear.migrate.tool.xamarin.flutter.sample://host/path CFBundleURLSchemes - com.authgear.exampleapp.xamarin + com.authgear.migrate.tool.xamarin.flutter.sample diff --git a/flutter-example/android/app/build.gradle b/flutter-example/android/app/build.gradle index 8b2c2bf..a7b61d5 100644 --- a/flutter-example/android/app/build.gradle +++ b/flutter-example/android/app/build.gradle @@ -43,7 +43,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.authgear.exampleapp.flutter" + applicationId "com.authgear.migrate.tool.xamarin.flutter.sample" // minSdkVersion flutter.minSdkVersion // 21 is required to use androidx.security minSdkVersion 21 @@ -53,11 +53,20 @@ android { } signingConfigs { + def file = rootProject.file("keystore-main.properties") + def props = new Properties() + props.load(new FileInputStream(file)) + debug { + storeFile new File(file.parent, props['storeFile']) + keyAlias props['keyAlias'] + storePassword props['storePassword'] + keyPassword props['keyPassword'] + } release { - storeFile file("keystore.jks") - storePassword project.ext.has("STORE_PASSWORD") ? project.ext["STORE_PASSWORD"] : "" - keyAlias project.ext.has("KEY_ALIAS") ? project.ext["KEY_ALIAS"] : "" - keyPassword project.ext.has("KEY_PASSWORD") ? project.ext["KEY_PASSWORD"] : "" + storeFile new File(file.parent, props['storeFile']) + keyAlias props['keyAlias'] + storePassword props['storePassword'] + keyPassword props['keyPassword'] } } diff --git a/flutter-example/android/app/src/main/AndroidManifest.xml b/flutter-example/android/app/src/main/AndroidManifest.xml index b932a1f..1a4eb37 100644 --- a/flutter-example/android/app/src/main/AndroidManifest.xml +++ b/flutter-example/android/app/src/main/AndroidManifest.xml @@ -6,7 +6,7 @@ android:allowBackup="true" android:fullBackupContent="@xml/full_backup_content" android:dataExtractionRules="@xml/data_extraction_rules" - android:label="Authgear Flutter" + android:label="Authgear Migrate Tool XamarinToFlutter Flutter" android:name="${applicationName}" android:icon="@mipmap/ic_launcher">