|
@@ -16,6 +16,7 @@ import com.khmer9.sbcmain.app.App
|
|
|
import com.khmer9.sbcmain.app.DownloadController
|
|
|
import com.khmer9.sbcmain.app.ShareActivity
|
|
|
import com.khmer9.sbcmain.base.BaseFragment
|
|
|
+import com.khmer9.sbcmain.config.Config
|
|
|
import com.khmer9.sbcmain.extension.btnClick
|
|
|
import com.khmer9.sbcmain.remote.User
|
|
|
import com.khmer9.sbcmain.remote.service.ConnectivityStates
|
|
@@ -32,26 +33,6 @@ class MainFragment : BaseFragment(R.layout.layout_fragment_main_yuki) {
|
|
|
private lateinit var recyclerView: RecyclerView
|
|
|
private lateinit var betTouch: MediaPlayer
|
|
|
|
|
|
- private val YUKI_APP_ID = "630478c22983a591133f0492"
|
|
|
- private val YUKI_DOWNLOAD = "https://www.dropbox.com/s/xkk1g5h4282yx0l/Khmer9_Yuki_devDebug_1.0.1-dev.apk?dl=1"
|
|
|
- private val YUKI_PACKAGE = "com.khmer9.yuki"
|
|
|
-
|
|
|
- private val LOTTO_APP_ID = "630780f0f635dd035329f5b7"
|
|
|
- private val LOTTO_DOWNLOAD = "https://www.dropbox.com/s/00s1s4f3dtdgyyg/Khmer9_Lotto_devDebug_1.0.4-dev.apk?dl=1"
|
|
|
- private val LOTTO_PACKAGE = "com.khmer9.lotto"
|
|
|
-
|
|
|
- private val LOTTO_PLUS_APP_ID = "62e397edae71cfa8782aa3a0"
|
|
|
- private val LOTTO_PLUS_DOWNLOAD = "https://www.dropbox.com/s/3rz6v50tjn6f2jg/Lottery-Mobile_devDebug_1.0.30-dev.apk?dl=1"
|
|
|
- private val LOTTO_PLUS_PACKAGE = "com.sambath.lottoplus"
|
|
|
-
|
|
|
- private val COCK_FIGHT_APP_ID = "631c17831da02749e7e23f35"
|
|
|
- private val COCK_FIGHT_DOWNLOAD = "https://www.dropbox.com/s/5hvduce4mgzi6bs/SBC-Mobile_devDebug_1.1.2-dev.apk?dl=1"
|
|
|
- private val COCK_FIGHT_PACKAGE = "com.sambath.sbc"
|
|
|
-
|
|
|
- private val APONG_APP_ID = "631c1d1a0d213229fc5fd11a"
|
|
|
- private val APONG_DOWNLOAD = "https://www.dropbox.com/s/2aht1p54yvpnb4e/APONG_devDebug_1.0.12-dev.apk?dl=1"
|
|
|
- private val APONG_PACKAGE = "com.sambath.apong"
|
|
|
-
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
|
super.onCreate(savedInstanceState)
|
|
|
(requireActivity() as ShareActivity).apply {
|
|
@@ -145,20 +126,20 @@ class MainFragment : BaseFragment(R.layout.layout_fragment_main_yuki) {
|
|
|
it.tokenData = null
|
|
|
} else if (it.intent == null && it.tokenData != null && it.appId != null) {
|
|
|
when (it.appId) {
|
|
|
- LOTTO_APP_ID -> {
|
|
|
- doDownload(LOTTO_DOWNLOAD, it.tokenData?.token)
|
|
|
+ Config.LOTTO_APP_ID -> {
|
|
|
+ doDownload(Config.LOTTO_DOWNLOAD, it.tokenData?.token)
|
|
|
}
|
|
|
- LOTTO_PLUS_APP_ID -> {
|
|
|
- doDownload(LOTTO_PLUS_DOWNLOAD, it.tokenData?.token)
|
|
|
+ Config.LOTTO_PLUS_APP_ID -> {
|
|
|
+ doDownload(Config.LOTTO_PLUS_DOWNLOAD, it.tokenData?.token)
|
|
|
}
|
|
|
- YUKI_APP_ID -> {
|
|
|
- doDownload(YUKI_DOWNLOAD, it.tokenData?.token)
|
|
|
+ Config.YUKI_APP_ID -> {
|
|
|
+ doDownload(Config.YUKI_DOWNLOAD, it.tokenData?.token)
|
|
|
}
|
|
|
- APONG_APP_ID -> {
|
|
|
- doDownload(APONG_DOWNLOAD, it.tokenData?.token)
|
|
|
+ Config.APONG_APP_ID -> {
|
|
|
+ doDownload(Config.APONG_DOWNLOAD, it.tokenData?.token)
|
|
|
}
|
|
|
- COCK_FIGHT_APP_ID -> {
|
|
|
- doDownload(COCK_FIGHT_DOWNLOAD, it.tokenData?.token)
|
|
|
+ Config.COCK_FIGHT_APP_ID -> {
|
|
|
+ doDownload(Config.COCK_FIGHT_DOWNLOAD, it.tokenData?.token)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -221,9 +202,9 @@ class MainFragment : BaseFragment(R.layout.layout_fragment_main_yuki) {
|
|
|
}
|
|
|
} else {
|
|
|
when (appId) {
|
|
|
- YUKI_APP_ID -> {
|
|
|
+ Config.YUKI_APP_ID -> {
|
|
|
(requireActivity() as ShareActivity).apply {
|
|
|
- val launchIntent = packageManager.getLaunchIntentForPackage(YUKI_PACKAGE)
|
|
|
+ val launchIntent = packageManager.getLaunchIntentForPackage(Config.YUKI_PACKAGE)
|
|
|
if (launchIntent != null) {
|
|
|
//launch
|
|
|
shareViewModel.getModuleToken(appId, launchIntent)
|
|
@@ -234,9 +215,9 @@ class MainFragment : BaseFragment(R.layout.layout_fragment_main_yuki) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- COCK_FIGHT_APP_ID -> {
|
|
|
+ Config.COCK_FIGHT_APP_ID -> {
|
|
|
(requireActivity() as ShareActivity).apply {
|
|
|
- val launchIntent = packageManager.getLaunchIntentForPackage(COCK_FIGHT_PACKAGE)
|
|
|
+ val launchIntent = packageManager.getLaunchIntentForPackage(Config.COCK_FIGHT_PACKAGE)
|
|
|
if (launchIntent != null) {
|
|
|
shareViewModel.getModuleToken(appId, launchIntent)
|
|
|
} else {
|
|
@@ -245,9 +226,9 @@ class MainFragment : BaseFragment(R.layout.layout_fragment_main_yuki) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- APONG_APP_ID -> {
|
|
|
+ Config.APONG_APP_ID -> {
|
|
|
(requireActivity() as ShareActivity).apply {
|
|
|
- val launchIntent = packageManager.getLaunchIntentForPackage(APONG_PACKAGE)
|
|
|
+ val launchIntent = packageManager.getLaunchIntentForPackage(Config.APONG_PACKAGE)
|
|
|
if (launchIntent != null) {
|
|
|
shareViewModel.getModuleToken(appId, launchIntent)
|
|
|
} else {
|