From a7351b2cf1211c23f99d306c7b91c7aa8f877b1f Mon Sep 17 00:00:00 2001 From: Matthieu <24-artectrex@users.noreply.shinice.net> Date: Thu, 20 May 2021 12:15:12 +0200 Subject: [PATCH] Fix some applicationId issues --- .../pixeldroid/app/LoginActivityOnlineTest.kt | 7 ++-- .../org/pixeldroid/app/testUtility/Values.kt | 4 +++ app/src/main/AndroidManifest.xml | 36 +++++++++---------- 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/app/src/androidTest/java/org/pixeldroid/app/LoginActivityOnlineTest.kt b/app/src/androidTest/java/org/pixeldroid/app/LoginActivityOnlineTest.kt index ab1b7338..3bb7dde5 100644 --- a/app/src/androidTest/java/org/pixeldroid/app/LoginActivityOnlineTest.kt +++ b/app/src/androidTest/java/org/pixeldroid/app/LoginActivityOnlineTest.kt @@ -24,6 +24,7 @@ import org.junit.Rule import org.junit.Test import org.junit.rules.Timeout import org.junit.runner.RunWith +import org.pixeldroid.app.testUtility.PACKAGE_ID @RunWith(AndroidJUnit4::class) class LoginActivityOnlineTest { @@ -39,7 +40,7 @@ class LoginActivityOnlineTest { fun setup() { context = ApplicationProvider.getApplicationContext() context = ApplicationProvider.getApplicationContext() - pref = context.getSharedPreferences("org.pixeldroid.app.pref", Context.MODE_PRIVATE) + pref = context.getSharedPreferences("${PACKAGE_ID}.pref", Context.MODE_PRIVATE) pref.edit().clear().apply() db = initDB(context) db.clearAllTables() @@ -76,7 +77,7 @@ class LoginActivityOnlineTest { .putString("clientID", "iwndoiuqwnd") .putString("clientSecret", "wlifowed") .apply() - val uri = Uri.parse("oauth2redirect://org.pixeldroid.app?code=sdfdqsf") + val uri = Uri.parse("oauth2redirect://${PACKAGE_ID}?code=sdfdqsf") val intent = Intent(ACTION_VIEW, uri, context, LoginActivity::class.java) ActivityScenario.launch(intent) onView(withId(R.id.editText)).check(matches( @@ -86,7 +87,7 @@ class LoginActivityOnlineTest { @Test fun incompleteIntentReturnInfoFailsTest() { - val uri = Uri.parse("oauth2redirect://org.pixeldroid.app?code=") + val uri = Uri.parse("oauth2redirect://${PACKAGE_ID}?code=") val intent = Intent(ACTION_VIEW, uri, context, LoginActivity::class.java) ActivityScenario.launch(intent) onView(withId(R.id.editText)).check(matches( diff --git a/app/src/androidTest/java/org/pixeldroid/app/testUtility/Values.kt b/app/src/androidTest/java/org/pixeldroid/app/testUtility/Values.kt index 3d40505a..04f8408c 100644 --- a/app/src/androidTest/java/org/pixeldroid/app/testUtility/Values.kt +++ b/app/src/androidTest/java/org/pixeldroid/app/testUtility/Values.kt @@ -4,6 +4,10 @@ import org.pixeldroid.app.BuildConfig.* import org.pixeldroid.app.utils.db.entities.InstanceDatabaseEntity import org.pixeldroid.app.utils.db.entities.UserDatabaseEntity + +const val PACKAGE_ID = APPLICATION_ID + + val testiTestoInstance = InstanceDatabaseEntity( uri = INSTANCE_URI, title = "PixelDroid CI instance", diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index ff17319e..749ceef5 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -15,7 +15,7 @@ - + - + @@ -46,25 +46,25 @@ + android:value="org.pixeldroid.app.searchDiscover.SearchActivity" /> @@ -115,13 +115,13 @@ android:resource="@xml/searchable" />