diff --git a/examples/with-thirdparty/.gitignore b/examples/with-thirdparty/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/examples/with-thirdparty/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/examples/with-thirdparty/.idea/.gitignore b/examples/with-thirdparty/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/examples/with-thirdparty/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/examples/with-thirdparty/.idea/.name b/examples/with-thirdparty/.idea/.name new file mode 100644 index 0000000..3474b18 --- /dev/null +++ b/examples/with-thirdparty/.idea/.name @@ -0,0 +1 @@ +SuperTokens Example \ No newline at end of file diff --git a/examples/with-thirdparty/.idea/compiler.xml b/examples/with-thirdparty/.idea/compiler.xml new file mode 100644 index 0000000..b589d56 --- /dev/null +++ b/examples/with-thirdparty/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/examples/with-thirdparty/.idea/deploymentTargetDropDown.xml b/examples/with-thirdparty/.idea/deploymentTargetDropDown.xml new file mode 100644 index 0000000..ea289a9 --- /dev/null +++ b/examples/with-thirdparty/.idea/deploymentTargetDropDown.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/with-thirdparty/.idea/gradle.xml b/examples/with-thirdparty/.idea/gradle.xml new file mode 100644 index 0000000..ae388c2 --- /dev/null +++ b/examples/with-thirdparty/.idea/gradle.xml @@ -0,0 +1,20 @@ + + + + + + + \ No newline at end of file diff --git a/examples/with-thirdparty/.idea/kotlinc.xml b/examples/with-thirdparty/.idea/kotlinc.xml new file mode 100644 index 0000000..fdf8d99 --- /dev/null +++ b/examples/with-thirdparty/.idea/kotlinc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/examples/with-thirdparty/.idea/misc.xml b/examples/with-thirdparty/.idea/misc.xml new file mode 100644 index 0000000..8978d23 --- /dev/null +++ b/examples/with-thirdparty/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/examples/with-thirdparty/README.md b/examples/with-thirdparty/README.md new file mode 100644 index 0000000..0309958 --- /dev/null +++ b/examples/with-thirdparty/README.md @@ -0,0 +1,60 @@ +## SuperTokens Example App + +### Add dependencies + +This example uses requires the following dependencies in addition to the default dependencies installed when creating an app: +- [supertokens-android](https://github.com/supertokens/supertokens-android) +- [play-services-auth](https://mvnrepository.com/artifact/com.google.android.gms/play-services-auth?repo=google) +- [retrofit](https://square.github.io/retrofit/) +- [AppAuth](https://github.com/openid/AppAuth-Android) + +Add the following to your project level `settings.gradle.kts`. Note: This app uses the settings file for dependency resolution but the older method of using the project level `build.gradle` can also be used. + +```gradle +dependencyResolutionManagement { + ... + repositories { + ... + maven { url = uri("https://jitpack.io") } + } +} +``` + +Add the folliwing to your app level `build.gradle` + +```gradle +implementation("com.github.supertokens:supertokens-android:0.3.5") +implementation ("com.google.android.gms:play-services-auth:20.7.0") +implementation("com.squareup.retrofit2:retrofit:2.9.0") +implementation("net.openid:appauth:0.11.1") +``` + +### Setup + +#### Google Login + +1. Create OAuth credentials for Android on [Google cloud console](https://console.cloud.google.com/). You will need to add your keystore's SHA-1 fingerprint when creating the credential +2. Create OAuth credentials for Web on [Google cloud console](https://console.cloud.google.com/). This is required because we need to get the authorization code in the Android app to be able to use SuperTokens. You need to provide all values (including domains and URLs) for Google login to work, you can use dummy values if you do not have a web application. +3. Replace all occurences of `GOOGLE_WEB_CLIENT_ID` with the client id for Web in both the Android code and the backend code +4. Replace all occurences of `GOOGLE_WEB_CLIENT_SECRET` with the client secret in the backend code + +#### Github login +1. Create credentials for an OAuth app from [Github Developer Settings](https://github.com/settings/developers) +2. Use `com.supertokens.supertokensexample://oauthredirect` when configuring the Authorization callback URL. +3. Replace all occurences of `GITHUB_CLIENT_ID` in both the frontend and backend +4. Replace all occurences of `GITHUB_CLIENT_SECRET` in the backend code +5. If you are using `http://` or `https://` for the callback URL in your Github developer settings you also need to update the `AndroidManifest.xml` to update the scheme for `net.openid.appauth.RedirectUriReceiverActivity` + +### Running the app + +1. Replace the value of the API domain in `backend/config` and `app/src/main/java/com/supertokens/supertokenxexample/resources/Constants.kt` to match your machines local IP address +2. Navigate to the `/backend` folder and run `npm run start` +3. Run open the app in Android studio and run on a device or emulator + +### How it works +- On app launch we check if a session exists and redirect to login if it doesnt +- We add the SuperTokens interceptor to the retrofit client so that the SuperTokens SDK can manage session tokens for us +- After logging in we call APIs exposed by the SuperTokens backend SDKs to create a session and redirect to the home screen + - In the case of Google we use the id token received after logging in to call the SuperTokens API + - For Github we use the code and state sent by GitHub to call the SuperTokens API +- On the home screen we call a protected API to fetch session information \ No newline at end of file diff --git a/examples/with-thirdparty/app/.gitignore b/examples/with-thirdparty/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/examples/with-thirdparty/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/examples/with-thirdparty/app/build.gradle.kts b/examples/with-thirdparty/app/build.gradle.kts new file mode 100644 index 0000000..bfd402d --- /dev/null +++ b/examples/with-thirdparty/app/build.gradle.kts @@ -0,0 +1,51 @@ +plugins { + id("com.android.application") + id("org.jetbrains.kotlin.android") +} + +android { + namespace = "com.supertokens.supertokensexample" + compileSdk = 33 + + defaultConfig { + applicationId = "com.supertokens.supertokensexample" + minSdk = 29 + targetSdk = 33 + versionCode = 1 + versionName = "1.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + } +} + +dependencies { + + implementation("androidx.core:core-ktx:1.9.0") + implementation("androidx.appcompat:appcompat:1.6.1") + implementation("com.google.android.material:material:1.8.0") + implementation("androidx.constraintlayout:constraintlayout:2.1.4") + implementation("com.github.supertokens:supertokens-android:0.3.5") + implementation ("com.google.android.gms:play-services-auth:20.7.0") + implementation("com.squareup.retrofit2:retrofit:2.9.0") + implementation("net.openid:appauth:0.11.1") + testImplementation("junit:junit:4.13.2") + androidTestImplementation("androidx.test.ext:junit:1.1.5") + androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") +} \ No newline at end of file diff --git a/examples/with-thirdparty/app/proguard-rules.pro b/examples/with-thirdparty/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/examples/with-thirdparty/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/examples/with-thirdparty/app/src/androidTest/java/com/supertokens/supertokensexample/ExampleInstrumentedTest.kt b/examples/with-thirdparty/app/src/androidTest/java/com/supertokens/supertokensexample/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..9353b85 --- /dev/null +++ b/examples/with-thirdparty/app/src/androidTest/java/com/supertokens/supertokensexample/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.supertokens.supertokensexample + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.supertokens.supertokensexample", appContext.packageName) + } +} \ No newline at end of file diff --git a/examples/with-thirdparty/app/src/main/AndroidManifest.xml b/examples/with-thirdparty/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..71ad957 --- /dev/null +++ b/examples/with-thirdparty/app/src/main/AndroidManifest.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/with-thirdparty/app/src/main/java/com/supertokens/supertokensexample/HomeActivity.kt b/examples/with-thirdparty/app/src/main/java/com/supertokens/supertokensexample/HomeActivity.kt new file mode 100644 index 0000000..c18ace9 --- /dev/null +++ b/examples/with-thirdparty/app/src/main/java/com/supertokens/supertokensexample/HomeActivity.kt @@ -0,0 +1,50 @@ +package com.supertokens.supertokensexample + +import android.content.Intent +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import android.util.Log +import android.widget.TextView +import androidx.appcompat.widget.AppCompatButton +import com.supertokens.session.SuperTokens +import com.supertokens.supertokensexample.services.network.APIManager +import kotlin.concurrent.thread + +class HomeActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_home) + + val userId = findViewById(R.id.tvUserId) + userId.text = SuperTokens.getUserId(this) + + val sessionInfoTv = findViewById(R.id.tvSessionInfo) + + val callApiButton = findViewById(R.id.btCallApi) + callApiButton.setOnClickListener { + thread { + val response = APIManager.getInstance().retrofitService.sessionInfo().execute() + val body = response.body() + + if (body != null) { + runOnUiThread { + sessionInfoTv.text = body.string() + } + } + } + } + + val signOutButton = findViewById(R.id.btSignOut) + signOutButton.setOnClickListener { + thread { + SuperTokens.signOut(baseContext) + + runOnUiThread { + val intent = Intent(baseContext, LoginActivity::class.java) + intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK + startActivity(intent) + } + } + } + } +} \ No newline at end of file diff --git a/examples/with-thirdparty/app/src/main/java/com/supertokens/supertokensexample/LoginActivity.kt b/examples/with-thirdparty/app/src/main/java/com/supertokens/supertokensexample/LoginActivity.kt new file mode 100644 index 0000000..be7421d --- /dev/null +++ b/examples/with-thirdparty/app/src/main/java/com/supertokens/supertokensexample/LoginActivity.kt @@ -0,0 +1,192 @@ +package com.supertokens.supertokensexample + +import android.content.Intent +import android.content.Intent.FLAG_ACTIVITY_CLEAR_TASK +import android.content.Intent.FLAG_ACTIVITY_NEW_TASK +import android.net.Uri +import android.os.Bundle +import android.util.Log +import android.widget.Toast +import androidx.activity.result.ActivityResult +import androidx.activity.result.ActivityResultLauncher +import androidx.activity.result.contract.ActivityResultContracts +import androidx.appcompat.app.AppCompatActivity +import androidx.appcompat.widget.AppCompatButton +import com.google.android.gms.auth.api.signin.GoogleSignIn +import com.google.android.gms.auth.api.signin.GoogleSignInOptions +import com.google.android.gms.common.SignInButton +import com.supertokens.supertokensexample.services.network.APIManager +import net.openid.appauth.AuthorizationException +import net.openid.appauth.AuthorizationRequest +import net.openid.appauth.AuthorizationResponse +import net.openid.appauth.AuthorizationService +import net.openid.appauth.AuthorizationServiceConfiguration +import net.openid.appauth.ResponseTypeValues +import okhttp3.MediaType +import okhttp3.RequestBody +import okhttp3.ResponseBody +import org.json.JSONObject +import retrofit2.Call +import retrofit2.Callback +import retrofit2.Response + + +class LoginActivity : AppCompatActivity() { + private lateinit var googleResultLauncher: ActivityResultLauncher + private lateinit var githubResultLauncher: ActivityResultLauncher + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_login) + + val googleButton = findViewById(R.id.btGoogle) + val githubButton = findViewById(R.id.btGithub) + + googleButton.setOnClickListener { + signInWithGoogle() + } + + githubButton.setOnClickListener { + signInWithGitHub() + } + + googleResultLauncher = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { + onGoogleResultReceived(it) + } + + githubResultLauncher = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { + onGithubResultReceived(it) + } + } + + private fun signInWithGoogle() { + val gso = GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) + .requestServerAuthCode("GOOGLE_WEB_CLIENT_ID") + .requestEmail() + .build() + + val googleClient = GoogleSignIn.getClient(this, gso) + val signInIntent = googleClient.signInIntent + + googleResultLauncher.launch(signInIntent) + } + + private fun signInWithGitHub() { + val serviceConfig = AuthorizationServiceConfiguration(Uri.parse("https://github.com/login/oauth/authorize"), Uri.parse("https://github.com/login/oauth/access_token")) + val builder = AuthorizationRequest.Builder( + serviceConfig, + "GITHUB_CLIENT_ID", + ResponseTypeValues.ID_TOKEN, + Uri.parse("com.supertokens.supertokensexample://oauthredirect"), + ) + val request = builder + .setScope("user") + .build() + + val service = AuthorizationService(this) + val intent = service.getAuthorizationRequestIntent(request) + + githubResultLauncher.launch(intent) + } + + private fun onGithubResultReceived(it: ActivityResult) { + val data = it.data + + if (data == null) { + Toast.makeText(baseContext, "Github sign in failed", Toast.LENGTH_SHORT).show() + return + } + + val response = AuthorizationResponse.fromIntent(data) + val exception = AuthorizationException.fromIntent(data) + + if (exception != null) { + exception.message?.let { msg -> Log.e("Login Activity", msg) } + Toast.makeText(baseContext, "Github sign in failed", Toast.LENGTH_SHORT).show() + return + } + + if (response == null) { + Toast.makeText(baseContext, "Github sign in failed", Toast.LENGTH_SHORT).show() + return + } + + val code = response.authorizationCode + + val body = JSONObject() + body.put("thirdPartyId", "github") + + if (code != null) { + val redirectURIInfo = JSONObject() + redirectURIInfo.put("redirectURIOnProviderDashboard", "com.supertokens.supertokensexample://oauthredirect") + + val redirectURIQueryParams = JSONObject() + redirectURIQueryParams.put("code", code) + + redirectURIInfo.put("redirectURIQueryParams", redirectURIQueryParams) + body.put("redirectURIInfo", redirectURIInfo) + } + + val requestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), body.toString()) + APIManager.getInstance().retrofitService.signInUp(requestBody).enqueue(object: Callback { + override fun onResponse( + call: Call, + response: Response + ) { + if (response.isSuccessful) { + val intent = Intent(baseContext, MainActivity::class.java) + intent.flags = FLAG_ACTIVITY_NEW_TASK or FLAG_ACTIVITY_CLEAR_TASK + startActivity(intent) + } + } + + override fun onFailure(call: Call, t: Throwable) { + t.message?.let { msg -> Log.e("Login Activity", msg) } + Toast.makeText(baseContext, "Github sign in failed", Toast.LENGTH_SHORT).show() + } + }) + } + + private fun onGoogleResultReceived(it: ActivityResult) { + val task = GoogleSignIn.getSignedInAccountFromIntent(it.data) + + try { + val account = task.result + + val body = JSONObject() + body.put("thirdPartyId", "google") + + val redirectURIInfo = JSONObject() + // For the native flow we do not have a redirect uri + redirectURIInfo.put("redirectURIOnProviderDashboard", "") + + val redirectURIQueryParams = JSONObject() + redirectURIQueryParams.put("code", account.serverAuthCode!!) + + redirectURIInfo.put("redirectURIQueryParams", redirectURIQueryParams) + body.put("redirectURIInfo", redirectURIInfo) + + val requestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), body.toString()) + APIManager.getInstance().retrofitService.signInUp(requestBody).enqueue(object: Callback { + override fun onResponse( + call: Call, + response: Response + ) { + if (response.isSuccessful) { + val intent = Intent(baseContext, MainActivity::class.java) + intent.flags = FLAG_ACTIVITY_NEW_TASK or FLAG_ACTIVITY_CLEAR_TASK + startActivity(intent) + } + } + + override fun onFailure(call: Call, t: Throwable) { + t.message?.let { msg -> Log.e("Login Activity", msg) } + Toast.makeText(baseContext, "Google sign in failed", Toast.LENGTH_SHORT).show() + } + }) + } catch (e: Exception) { + e.message?.let { msg -> Log.e("Login Activity", msg) } + Toast.makeText(this, "Google sign in failed", Toast.LENGTH_SHORT).show() + } + } +} \ No newline at end of file diff --git a/examples/with-thirdparty/app/src/main/java/com/supertokens/supertokensexample/MainActivity.kt b/examples/with-thirdparty/app/src/main/java/com/supertokens/supertokensexample/MainActivity.kt new file mode 100644 index 0000000..96e1fd8 --- /dev/null +++ b/examples/with-thirdparty/app/src/main/java/com/supertokens/supertokensexample/MainActivity.kt @@ -0,0 +1,20 @@ +package com.supertokens.supertokensexample + +import android.content.Intent +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import com.supertokens.session.SuperTokens + +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) + + // We check if a session exists and route the user accordingly + if (SuperTokens.doesSessionExist(applicationContext)) { + startActivity(Intent(baseContext, HomeActivity::class.java)) + } else { + startActivity(Intent(baseContext, LoginActivity::class.java)) + } + } +} \ No newline at end of file diff --git a/examples/with-thirdparty/app/src/main/java/com/supertokens/supertokensexample/MyApplication.kt b/examples/with-thirdparty/app/src/main/java/com/supertokens/supertokensexample/MyApplication.kt new file mode 100644 index 0000000..7957238 --- /dev/null +++ b/examples/with-thirdparty/app/src/main/java/com/supertokens/supertokensexample/MyApplication.kt @@ -0,0 +1,12 @@ +package com.supertokens.supertokensexample + +import android.app.Application +import com.supertokens.session.SuperTokens +import com.supertokens.supertokensexample.resources.Constants + +class MyApplication: Application() { + override fun onCreate() { + super.onCreate() + SuperTokens.Builder(applicationContext, Constants.apiDomain).build() + } +} \ No newline at end of file diff --git a/examples/with-thirdparty/app/src/main/java/com/supertokens/supertokensexample/resources/Constants.kt b/examples/with-thirdparty/app/src/main/java/com/supertokens/supertokensexample/resources/Constants.kt new file mode 100644 index 0000000..440654f --- /dev/null +++ b/examples/with-thirdparty/app/src/main/java/com/supertokens/supertokensexample/resources/Constants.kt @@ -0,0 +1,9 @@ +package com.supertokens.supertokensexample.resources + +class Constants { + companion object { + // TODO: Replace this with your machine's local IP address + @JvmStatic + val apiDomain = "http://192.168.29.87:3001" + } +} \ No newline at end of file diff --git a/examples/with-thirdparty/app/src/main/java/com/supertokens/supertokensexample/services/network/APIManager.kt b/examples/with-thirdparty/app/src/main/java/com/supertokens/supertokensexample/services/network/APIManager.kt new file mode 100644 index 0000000..5b54abc --- /dev/null +++ b/examples/with-thirdparty/app/src/main/java/com/supertokens/supertokensexample/services/network/APIManager.kt @@ -0,0 +1,36 @@ +package com.supertokens.supertokensexample.services.network + +import com.supertokens.session.SuperTokensInterceptor +import com.supertokens.supertokensexample.resources.Constants +import retrofit2.Retrofit + +class APIManager private constructor(){ + companion object { + @Volatile + private var instance: APIManager? = null + + fun getInstance(): APIManager { + instance ?: synchronized(this) { + instance ?: APIManager().also { instance = it } + } + + instance!!.initialiseService() + return instance!! + } + + } + + lateinit var retrofitService: RetrofitService + + private fun initialiseService() { + val clientBuilder = okhttp3.OkHttpClient.Builder() + clientBuilder.addInterceptor(SuperTokensInterceptor()) + + val retrofit = Retrofit.Builder() + .baseUrl(Constants.apiDomain) + .client(clientBuilder.build()) + .build() + + retrofitService = retrofit.create(RetrofitService::class.java) + } +} \ No newline at end of file diff --git a/examples/with-thirdparty/app/src/main/java/com/supertokens/supertokensexample/services/network/RetrofitService.kt b/examples/with-thirdparty/app/src/main/java/com/supertokens/supertokensexample/services/network/RetrofitService.kt new file mode 100644 index 0000000..4a1a0c8 --- /dev/null +++ b/examples/with-thirdparty/app/src/main/java/com/supertokens/supertokensexample/services/network/RetrofitService.kt @@ -0,0 +1,16 @@ +package com.supertokens.supertokensexample.services.network + +import okhttp3.RequestBody +import okhttp3.ResponseBody +import retrofit2.Call +import retrofit2.http.Body +import retrofit2.http.GET +import retrofit2.http.POST + +interface RetrofitService { + @POST("/auth/signinup") + fun signInUp(@Body body: RequestBody): Call + + @GET("/sessioninfo") + fun sessionInfo(): Call +} \ No newline at end of file diff --git a/examples/with-thirdparty/app/src/main/res/drawable/home_container_bg.xml b/examples/with-thirdparty/app/src/main/res/drawable/home_container_bg.xml new file mode 100644 index 0000000..231cc59 --- /dev/null +++ b/examples/with-thirdparty/app/src/main/res/drawable/home_container_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/examples/with-thirdparty/app/src/main/res/drawable/ic_launcher_background.xml b/examples/with-thirdparty/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/examples/with-thirdparty/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/with-thirdparty/app/src/main/res/drawable/ic_launcher_foreground.xml b/examples/with-thirdparty/app/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/examples/with-thirdparty/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/examples/with-thirdparty/app/src/main/res/drawable/user_id_container.xml b/examples/with-thirdparty/app/src/main/res/drawable/user_id_container.xml new file mode 100644 index 0000000..d5ed2bb --- /dev/null +++ b/examples/with-thirdparty/app/src/main/res/drawable/user_id_container.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/examples/with-thirdparty/app/src/main/res/layout/activity_home.xml b/examples/with-thirdparty/app/src/main/res/layout/activity_home.xml new file mode 100644 index 0000000..bb5ac55 --- /dev/null +++ b/examples/with-thirdparty/app/src/main/res/layout/activity_home.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/with-thirdparty/app/src/main/res/layout/activity_login.xml b/examples/with-thirdparty/app/src/main/res/layout/activity_login.xml new file mode 100644 index 0000000..8001c45 --- /dev/null +++ b/examples/with-thirdparty/app/src/main/res/layout/activity_login.xml @@ -0,0 +1,44 @@ + + + + + + + + + + \ No newline at end of file diff --git a/examples/with-thirdparty/app/src/main/res/layout/activity_main.xml b/examples/with-thirdparty/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..282b161 --- /dev/null +++ b/examples/with-thirdparty/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,20 @@ + + + + + + \ No newline at end of file diff --git a/examples/with-thirdparty/app/src/main/res/mipmap-anydpi/ic_launcher.xml b/examples/with-thirdparty/app/src/main/res/mipmap-anydpi/ic_launcher.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/examples/with-thirdparty/app/src/main/res/mipmap-anydpi/ic_launcher.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/examples/with-thirdparty/app/src/main/res/mipmap-anydpi/ic_launcher_round.xml b/examples/with-thirdparty/app/src/main/res/mipmap-anydpi/ic_launcher_round.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/examples/with-thirdparty/app/src/main/res/mipmap-anydpi/ic_launcher_round.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/examples/with-thirdparty/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/examples/with-thirdparty/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c209e78 Binary files /dev/null and b/examples/with-thirdparty/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/examples/with-thirdparty/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/examples/with-thirdparty/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..b2dfe3d Binary files /dev/null and b/examples/with-thirdparty/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/examples/with-thirdparty/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/examples/with-thirdparty/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..4f0f1d6 Binary files /dev/null and b/examples/with-thirdparty/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/examples/with-thirdparty/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/examples/with-thirdparty/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..62b611d Binary files /dev/null and b/examples/with-thirdparty/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/examples/with-thirdparty/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/examples/with-thirdparty/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..948a307 Binary files /dev/null and b/examples/with-thirdparty/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/examples/with-thirdparty/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/examples/with-thirdparty/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1b9a695 Binary files /dev/null and b/examples/with-thirdparty/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/examples/with-thirdparty/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/examples/with-thirdparty/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..28d4b77 Binary files /dev/null and b/examples/with-thirdparty/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/examples/with-thirdparty/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/examples/with-thirdparty/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9287f50 Binary files /dev/null and b/examples/with-thirdparty/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/examples/with-thirdparty/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/examples/with-thirdparty/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..aa7d642 Binary files /dev/null and b/examples/with-thirdparty/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/examples/with-thirdparty/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/examples/with-thirdparty/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9126ae3 Binary files /dev/null and b/examples/with-thirdparty/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/examples/with-thirdparty/app/src/main/res/values-night/themes.xml b/examples/with-thirdparty/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..f592df7 --- /dev/null +++ b/examples/with-thirdparty/app/src/main/res/values-night/themes.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/examples/with-thirdparty/app/src/main/res/values/colors.xml b/examples/with-thirdparty/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..c8524cd --- /dev/null +++ b/examples/with-thirdparty/app/src/main/res/values/colors.xml @@ -0,0 +1,5 @@ + + + #FF000000 + #FFFFFFFF + \ No newline at end of file diff --git a/examples/with-thirdparty/app/src/main/res/values/strings.xml b/examples/with-thirdparty/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..6a0fb8a --- /dev/null +++ b/examples/with-thirdparty/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + SuperTokens Example + \ No newline at end of file diff --git a/examples/with-thirdparty/app/src/main/res/values/themes.xml b/examples/with-thirdparty/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..51b67b5 --- /dev/null +++ b/examples/with-thirdparty/app/src/main/res/values/themes.xml @@ -0,0 +1,9 @@ + + + + +