Dola TENG 2 years ago
parent
commit
9a42b4d6a9

+ 13 - 13
app/src/dev/java/com/khmer9/yuki/config/Config.kt

@@ -6,53 +6,53 @@ object Config {
 
     const val MAIN_PACKAGE = "com.khmer9.wa855main"
 
-    const val YUKI_APP_ID = "62dfdfb85ef1fb28515a1a72"
+    const val YUKI_APP_ID = "635fddba2d019b2f306a1109"
     const val YUKI_APP_NAME = "Yuki"
     const val YUKI_DOWNLOAD = ""
     const val YUKI_PACKAGE = "com.khmer9.yuki"
 
-    const val LOTTO_APP_ID = "62e48485abc48561de3a470f"
+    const val LOTTO_APP_ID = "635fd6aad3d45ee768d7448b"
     const val LOTTO_APP_NAME = "EE7777"
     const val LOTTO_DOWNLOAD = ""
     const val LOTTO_PACKAGE = "com.khmer9.lotto"
 
-    const val LOTTO_PLUS_APP_ID = "62dfe1d65ef1fb28515a1a75"
+    const val LOTTO_PLUS_APP_ID = "635fda1c1142ebf1754ad671"
     const val LOTTO_PLUS_APP_NAME = "PP78"
     const val LOTTO_PLUS_DOWNLOAD = ""
     const val LOTTO_PLUS_PACKAGE = "com.sambath.lottoplus"
 
-    const val COCK_FIGHT_APP_ID = "631c17831da02749e7e23f35"
+    const val COCK_FIGHT_APP_ID = "635fd69d6511e264c7fa56e6"
     const val COCK_FIGHT_DOWNLOAD = ""
     const val COCK_FIGHT_PACKAGE = "com.sambath.sbc"
     const val COCK_APP_NAME = "CockFight"
 
-    const val MACHINE_APP_ID = "62dfdf6b5ef1fb28515a1a70"
+    const val MACHINE_APP_ID = "60af815c4bb822aaad3f00e3"
     const val MACHINE_APP_NAME = "Machine Game"
 
-    const val KD855_APP_ID = "6352aa5ebe6f42032c160bed"
+    const val KD855_APP_ID = "kd855"
     const val KD855_APP_NAME = "KD855 Casino Online"
 
-    const val APONG_APP_ID = "631c1d1a0d213229fc5fd11a"
+    const val APONG_APP_ID = "62f92808016e8046cccee5bc"
     const val APONG_APP_NAME = "Apong"
     const val APONG_DOWNLOAD = ""
     const val APONG_PACKAGE = "com.sambath.apong"
 
-    const val CARD_APP_ID = "6352aa5ebe6f42032c160bed"
+    const val CARD_APP_ID = "636f0985ab76373a54b9f522"
     const val CARD_APP_NAME = "Card"
     const val CARD_DOWNLOAD = ""
     const val CARD_PACKAGE = ""
 
-    const val SNK_APP_ID = "6352aa81be6f4281bc160bfc"
+    const val SNK_APP_ID = "snk"
     const val SNK_APP_NAME = "SNK Online"
     const val SNK_DOWNLOAD = ""
     const val SNK_PACKAGE = ""
 
-    const val RAT_APP_ID = "6352aa5ebe6f42032c160bed"
+    const val RAT_APP_ID = "6363ca87be8bf38628bfe57d"
     const val RAT_APP_NAME = "Rat"
-    const val RAT_DOWNLOAD = ""
-    const val RAT_PACKAGE = ""
+    const val RAT_DOWNLOAD = "https://www.dropbox.com/s/dcngmzkeegqj8l3/Rat_devDebug_1.1.2-dev.apk?dl=1"
+    const val RAT_PACKAGE = "com.sambath.rat_main"
 
-    const val Klaklouk_APP_ID = "6371f53073798150886bc23b"
+    const val Klaklouk_APP_ID = "6371f31113b15d4e1c0d04b8"
     const val Klaklouk_APP_NAME = "Klaklouk"
     const val Klaklouk_DOWNLOAD = ""
     const val Klaklouk_PACKAGE = ""

+ 42 - 0
app/src/main/java/com/khmer9/wa855main/screen/main/MainFragment.kt

@@ -141,6 +141,15 @@ class MainFragment : BaseFragment(R.layout.layout_fragment_main_yuki) {
                             Config.COCK_FIGHT_APP_ID -> {
                                 doDownload(Config.COCK_FIGHT_DOWNLOAD, it.tokenData?.token)
                             }
+                            Config.RAT_APP_ID -> {
+                                doDownload(Config.RAT_DOWNLOAD, it.tokenData?.token)
+                            }
+                            Config.Klaklouk_APP_ID -> {
+                                doDownload(Config.Klaklouk_DOWNLOAD, it.tokenData?.token)
+                            }
+                            Config.CARD_APP_ID -> {
+                                doDownload(Config.CARD_DOWNLOAD, it.tokenData?.token)
+                            }
                         }
 
                         it.intent = null
@@ -240,6 +249,39 @@ class MainFragment : BaseFragment(R.layout.layout_fragment_main_yuki) {
                                         }
                                     }
                                 }
+                                Config.RAT_APP_ID -> {
+                                    (requireActivity() as ShareActivity).apply {
+                                        val launchIntent = packageManager.getLaunchIntentForPackage(Config.RAT_PACKAGE)
+                                        if (launchIntent != null) {
+                                            shareViewModel.getModuleToken(appId, launchIntent)
+                                        } else {
+                                            //doDownload(APONG_DOWNLOAD)
+                                            shareViewModel.getModuleToken(appId, null)
+                                        }
+                                    }
+                                }
+                                Config.Klaklouk_APP_ID -> {
+                                    (requireActivity() as ShareActivity).apply {
+                                        val launchIntent = packageManager.getLaunchIntentForPackage(Config.Klaklouk_PACKAGE)
+                                        if (launchIntent != null) {
+                                            shareViewModel.getModuleToken(appId, launchIntent)
+                                        } else {
+                                            //doDownload(APONG_DOWNLOAD)
+                                            shareViewModel.getModuleToken(appId, null)
+                                        }
+                                    }
+                                }
+                                Config.CARD_APP_ID -> {
+                                    (requireActivity() as ShareActivity).apply {
+                                        val launchIntent = packageManager.getLaunchIntentForPackage(Config.CARD_PACKAGE)
+                                        if (launchIntent != null) {
+                                            shareViewModel.getModuleToken(appId, launchIntent)
+                                        } else {
+                                            //doDownload(APONG_DOWNLOAD)
+                                            shareViewModel.getModuleToken(appId, null)
+                                        }
+                                    }
+                                }
                             }
                         }
                     }

+ 33 - 0
app/src/main/java/com/khmer9/wa855main/screen/main/SubModuleFragment.kt

@@ -124,6 +124,39 @@ class SubModuleFragment : BaseFragment(R.layout.layout_sub_module) {
                                 }
                             }
                         }
+                        Config.RAT_APP_ID -> {
+                            (requireActivity() as ShareActivity).apply {
+                                val launchIntent = packageManager.getLaunchIntentForPackage(Config.RAT_PACKAGE)
+                                if (launchIntent != null) {
+                                    shareViewModel.getModuleToken(appId, launchIntent)
+                                } else {
+                                    shareViewModel.getModuleToken(appId, null)
+                                    //doDownload(LOTTO_PLUS_DOWNLOAD)
+                                }
+                            }
+                        }
+                        Config.Klaklouk_APP_ID -> {
+                            (requireActivity() as ShareActivity).apply {
+                                val launchIntent = packageManager.getLaunchIntentForPackage(Config.Klaklouk_PACKAGE)
+                                if (launchIntent != null) {
+                                    shareViewModel.getModuleToken(appId, launchIntent)
+                                } else {
+                                    shareViewModel.getModuleToken(appId, null)
+                                    //doDownload(LOTTO_PLUS_DOWNLOAD)
+                                }
+                            }
+                        }
+                        Config.CARD_APP_ID -> {
+                            (requireActivity() as ShareActivity).apply {
+                                val launchIntent = packageManager.getLaunchIntentForPackage(Config.CARD_PACKAGE)
+                                if (launchIntent != null) {
+                                    shareViewModel.getModuleToken(appId, launchIntent)
+                                } else {
+                                    shareViewModel.getModuleToken(appId, null)
+                                    //doDownload(LOTTO_PLUS_DOWNLOAD)
+                                }
+                            }
+                        }
                     }
                 }
             }