Răsfoiți Sursa

feat: Google登录

DoggyZhang 4 luni în urmă
părinte
comite
600008a75e

+ 2 - 1
app/build.gradle

@@ -3,7 +3,7 @@ import java.text.SimpleDateFormat
 plugins {
     id 'com.android.application'
     id 'org.jetbrains.kotlin.android'
-//    id 'com.google.gms.google-services'
+    id 'com.google.gms.google-services'
     id 'com.google.firebase.crashlytics'
     id 'org.jetbrains.kotlin.kapt'
     id 'com.tencent.vasdolly'
@@ -148,6 +148,7 @@ android {
             firebaseCrashlytics {
                 mappingFileUploadEnabled false
             }
+            applicationIdSuffix = '.debug'
         }
         release {
             debuggable false

+ 18 - 11
app/src/debug/google-services.json

@@ -1,42 +1,49 @@
 {
   "project_info": {
-    "project_number": "968451835912",
-    "project_id": "yoki-debug",
-    "storage_bucket": "yoki-debug.firebasestorage.app"
+    "project_number": "111172807665",
+    "project_id": "lanu-debug-171d9",
+    "storage_bucket": "lanu-debug-171d9.firebasestorage.app"
   },
   "client": [
     {
       "client_info": {
-        "mobilesdk_app_id": "1:968451835912:android:9f3093ae99d06fd5a629bd",
+        "mobilesdk_app_id": "1:111172807665:android:f19231a4ca9923c6e2f250",
         "android_client_info": {
-          "package_name": "com.partyjoy.yoki"
+          "package_name": "com.jiehe.lanu.debug"
         }
       },
       "oauth_client": [
         {
-          "client_id": "968451835912-ni8f8ith97nv5obgq1ttt3qvbajplku3.apps.googleusercontent.com",
+          "client_id": "111172807665-8im51nvocg9nb37d751erstvsbsctjtm.apps.googleusercontent.com",
           "client_type": 1,
           "android_info": {
-            "package_name": "com.partyjoy.yoki",
-            "certificate_hash": "a596581469039c165a4107e2a7224c22bb07b404"
+            "package_name": "com.jiehe.lanu.debug",
+            "certificate_hash": "37acab7290b5c818ec6124a0058293f58d8c30ed"
           }
         },
         {
-          "client_id": "968451835912-2kqb2tm5khcp59ukg528fbgclbvsicia.apps.googleusercontent.com",
+          "client_id": "111172807665-lfjp1nsh9m7uftpd1r1rnq7a42qqtj1p.apps.googleusercontent.com",
           "client_type": 3
         }
       ],
       "api_key": [
         {
-          "current_key": "AIzaSyCWc4fzoYDW7T9LQqm96ijJU7zb0gbY44I"
+          "current_key": "AIzaSyDW34XRD-Be1csASzrmL1nZzb0p_olfOrE"
         }
       ],
       "services": {
         "appinvite_service": {
           "other_platform_oauth_client": [
             {
-              "client_id": "968451835912-2kqb2tm5khcp59ukg528fbgclbvsicia.apps.googleusercontent.com",
+              "client_id": "111172807665-lfjp1nsh9m7uftpd1r1rnq7a42qqtj1p.apps.googleusercontent.com",
               "client_type": 3
+            },
+            {
+              "client_id": "111172807665-kq59ppl79227tt6v89j0skp7pemc6qsq.apps.googleusercontent.com",
+              "client_type": 2,
+              "ios_info": {
+                "bundle_id": "com.jiehe.lanu.debug"
+              }
             }
           ]
         }

BIN
app/src/main/res/drawable-xhdpi/ic_launcher.png


BIN
app/src/main/res/drawable-xhdpi/ic_launcher.webp


+ 1 - 1
app/src/main/res/values/strings.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
-    <string name="app_name" translatable="false">Yoki</string>
+    <string name="app_name" translatable="false">Lanu</string>
     <string name="app_official_reward_name" translatable="false">Yoki Reward</string>
     <string name="common_create">Create</string>
     <string name="common_send">Send</string>

+ 10 - 19
app/src/release/google-services.json

@@ -1,44 +1,35 @@
 {
   "project_info": {
-    "project_number": "114010344899",
-    "project_id": "yoki-b5692",
-    "storage_bucket": "yoki-b5692.firebasestorage.app"
+    "project_number": "345957325655",
+    "project_id": "lanu-9333d",
+    "storage_bucket": "lanu-9333d.firebasestorage.app"
   },
   "client": [
     {
       "client_info": {
-        "mobilesdk_app_id": "1:114010344899:android:0c11db555581312a304176",
+        "mobilesdk_app_id": "1:345957325655:android:821bfdae887619c7673c12",
         "android_client_info": {
-          "package_name": "com.partyjoy.yoki"
+          "package_name": "com.jiehe.lanu"
         }
       },
       "oauth_client": [
         {
-          "client_id": "114010344899-vt3eglaqml0k6mjt8c7l2dpv620gj3gr.apps.googleusercontent.com",
+          "client_id": "345957325655-deqn7bdv0sher0olg0gu2439nv60ksri.apps.googleusercontent.com",
           "client_type": 1,
           "android_info": {
-            "package_name": "com.partyjoy.yoki",
-            "certificate_hash": "f7aa467d1e0316971b58abd97d209a0265b9fc18"
+            "package_name": "com.jiehe.lanu",
+            "certificate_hash": "3c486cb298f4538d4f52e50b438f45fee3171032"
           }
-        },
-        {
-          "client_id": "114010344899-npgraqo8d30ee2nk85jvrlvv44b4fu5c.apps.googleusercontent.com",
-          "client_type": 3
         }
       ],
       "api_key": [
         {
-          "current_key": "AIzaSyBJNzSC9VGNXlHpYL6S4FIcnBZKPRVHGak"
+          "current_key": "AIzaSyAWRI1eNFBslzl1abVALV4YuY55rNk4is4"
         }
       ],
       "services": {
         "appinvite_service": {
-          "other_platform_oauth_client": [
-            {
-              "client_id": "114010344899-npgraqo8d30ee2nk85jvrlvv44b4fu5c.apps.googleusercontent.com",
-              "client_type": 3
-            }
-          ]
+          "other_platform_oauth_client": []
         }
       }
     }

BIN
keystore/debug/lanu-debug.jks


+ 4 - 2
module/account/src/main/java/com/adealink/weparty/account/constant/LoginConstants.kt

@@ -1,8 +1,9 @@
 package com.adealink.weparty.account.constant
 
 
-const val GOOGLE_CLIENT_ID = "114010344899-npgraqo8d30ee2nk85jvrlvv44b4fu5c.apps.googleusercontent.com"
-const val GOOGLE_CLIENT_ID_DEBUG = "968451835912-2kqb2tm5khcp59ukg528fbgclbvsicia.apps.googleusercontent.com"
+// TODO: zhangfei 补充正式环境clientId
+const val GOOGLE_CLIENT_ID = "111172807665-lfjp1nsh9m7uftpd1r1rnq7a42qqtj1p.apps.googleusercontent.com"
+const val GOOGLE_CLIENT_ID_DEBUG = "111172807665-lfjp1nsh9m7uftpd1r1rnq7a42qqtj1p.apps.googleusercontent.com"
 val fbReadPermissionNeeds = listOf(
     "email", "public_profile"
 )
@@ -10,6 +11,7 @@ val fbReadPermissionNeeds = listOf(
 const val STEP_AUTH = 0
 const val STEP_LOGIN = 0
 
+// TODO: zhangfei 补充正式环境clientId
 const val APPLE_CLIENT_ID = "com.wenext.chat"
 
 const val CODE_COUNT_DOWN_TIME = 60

+ 10 - 10
module/account/src/main/java/com/adealink/weparty/account/login/LoginActivity.kt

@@ -119,7 +119,7 @@ class LoginActivity : BaseLoginActivity() {
         initTikTokBtn()
         initTestLogin()
 
-        playVideoBg()
+//        playVideoBg()
     }
 
     private fun initTikTokBtn() {
@@ -250,15 +250,15 @@ class LoginActivity : BaseLoginActivity() {
         reportEnterPage(Page.LOGIN)
     }
 
-    @OptIn(UnstableApi::class)
-    private fun playVideoBg() {
-        binding.videoBg.setResizeMode(VideoViewResizeMode.Zoom)
-        binding.videoBg.setVideoScalingMode(VideoScalingMode.ScaleToFitWithCropping)
-        binding.videoBg.setLoopCount(-1)
-        binding.videoBg.setAutoPlay(true)
-        binding.videoBg.setShowControllerBar(false)
-        binding.videoBg.setUri(R.raw.login_bg.toRawUrl())
-    }
+//    @OptIn(UnstableApi::class)
+//    private fun playVideoBg() {
+//        binding.videoBg.setResizeMode(VideoViewResizeMode.Zoom)
+//        binding.videoBg.setVideoScalingMode(VideoScalingMode.ScaleToFitWithCropping)
+//        binding.videoBg.setLoopCount(-1)
+//        binding.videoBg.setAutoPlay(true)
+//        binding.videoBg.setShowControllerBar(false)
+//        binding.videoBg.setUri(R.raw.login_bg.toRawUrl())
+//    }
 
     private fun handleKickOutIfNeed() {
         if (kickOutReason == null) {

+ 8 - 8
module/account/src/main/java/com/adealink/weparty/account/login/viewmodel/LoginViewModel.kt

@@ -68,14 +68,14 @@ class LoginViewModel : BaseViewModel(), ILoginViewModel, ILoginListener {
     private var authStartTime = 0L
     private val authCallback = object : IAuthCallback {
         override fun onSuccess(authType: ThirdType, token: String, codeVerifier: String?) {
-            AccountLoginStatEvent(CommonEventValue.Action.AUTH).apply {
-                type to getReportLoginType(authType)
-                result to CommonEventValue.Result.SUCCESS
-                duration to SystemClock.elapsedRealtime() - authStartTime
-                source to getLoginStatSource()
-            }.send()
-            cancelCountdown()
-            authLogin(authType, token, codeVerifier = codeVerifier)
+//            AccountLoginStatEvent(CommonEventValue.Action.AUTH).apply {
+//                type to getReportLoginType(authType)
+//                result to CommonEventValue.Result.SUCCESS
+//                duration to SystemClock.elapsedRealtime() - authStartTime
+//                source to getLoginStatSource()
+//            }.send()
+//            cancelCountdown()
+//            authLogin(authType, token, codeVerifier = codeVerifier)
         }
 
         override fun onFailed(authType: ThirdType, errorMsg: String, errorCode: Int?) {

+ 10 - 10
module/account/src/main/res/layout/activity_login.xml

@@ -6,22 +6,22 @@
     android:layout_height="match_parent"
     android:background="@color/white">
 
-    <com.adealink.frame.effect.video.WeVideoView
-        android:id="@+id/video_bg"
-        android:layout_width="0dp"
-        android:layout_height="0dp"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toTopOf="parent"
-        app:surface_type="surface_view" />
+    <!--    <com.adealink.frame.effect.video.WeVideoView-->
+    <!--        android:id="@+id/video_bg"-->
+    <!--        android:layout_width="0dp"-->
+    <!--        android:layout_height="0dp"-->
+    <!--        app:layout_constraintBottom_toBottomOf="parent"-->
+    <!--        app:layout_constraintEnd_toEndOf="parent"-->
+    <!--        app:layout_constraintStart_toStartOf="parent"-->
+    <!--        app:layout_constraintTop_toTopOf="parent"-->
+    <!--        app:surface_type="surface_view" />-->
 
     <androidx.appcompat.widget.AppCompatImageView
         android:id="@+id/app_icon_iv"
         android:layout_width="match_parent"
         android:layout_height="150dp"
         android:layout_marginTop="120dp"
-        android:src="@drawable/account_login_top_icon"
+        android:src="@drawable/ic_launcher"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toTopOf="parent" />