|
@@ -35,19 +35,19 @@ class MainFragment : BaseFragment(R.layout.layout_fragment_main_yuki) {
|
|
private val YUKI_DOWNLOAD = "https://www.dropbox.com/s/uzvfo7jahmcl8pe/Khmer9_Yuki_devDebug_1.0.1-dev.apk?dl=1"
|
|
private val YUKI_DOWNLOAD = "https://www.dropbox.com/s/uzvfo7jahmcl8pe/Khmer9_Yuki_devDebug_1.0.1-dev.apk?dl=1"
|
|
private val YUKI_PACKAGE = "com.khmer9.yuki"
|
|
private val YUKI_PACKAGE = "com.khmer9.yuki"
|
|
|
|
|
|
- private val LOTTO_APP_ID = ""
|
|
|
|
- private val LOTTO_DOWNLOAD = ""
|
|
|
|
- private val LOTTO_PACKAGE = ""
|
|
|
|
|
|
+ private val LOTTO_APP_ID = "630780f0f635dd035329f5b7"
|
|
|
|
+ private val LOTTO_DOWNLOAD = "https://www.dropbox.com/s/j3h5d3bjp91nsmr/Khmer9_Lotto_devDebug_1.0.3-dev.apk?dl=1"
|
|
|
|
+ private val LOTTO_PACKAGE = "com.khmer9.lotto"
|
|
|
|
|
|
- private val LOTTO_PLUS_APP_ID = ""
|
|
|
|
- private val LOTTO_PLUS_DOWNLOAD = ""
|
|
|
|
- private val LOTTO_PLUS_PACKAGE = ""
|
|
|
|
|
|
+ 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.sbc"
|
|
|
|
|
|
- private val COCK_FIGHT_APP_ID = ""
|
|
|
|
|
|
+ private val COCK_FIGHT_APP_ID = "631c17831da02749e7e23f35"
|
|
private val COCK_FIGHT_DOWNLOAD = ""
|
|
private val COCK_FIGHT_DOWNLOAD = ""
|
|
private val COCK_FIGHT_PACKAGE = ""
|
|
private val COCK_FIGHT_PACKAGE = ""
|
|
|
|
|
|
- private val APONG_APP_ID = ""
|
|
|
|
|
|
+ private val APONG_APP_ID = "631c1d1a0d213229fc5fd11a"
|
|
private val APONG_DOWNLOAD = ""
|
|
private val APONG_DOWNLOAD = ""
|
|
private val APONG_PACKAGE = ""
|
|
private val APONG_PACKAGE = ""
|
|
|
|
|
|
@@ -131,9 +131,31 @@ class MainFragment : BaseFragment(R.layout.layout_fragment_main_yuki) {
|
|
val launchIntent = it.intent
|
|
val launchIntent = it.intent
|
|
launchIntent?.putExtra("token", it.tokenData?.token)
|
|
launchIntent?.putExtra("token", it.tokenData?.token)
|
|
startActivity(launchIntent)
|
|
startActivity(launchIntent)
|
|
|
|
+ Log.d("XXXXXXXXXXXXXX", it.tokenData?.token.toString())
|
|
|
|
+ it.intent = null
|
|
|
|
+ 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)
|
|
|
|
+ }
|
|
|
|
+ LOTTO_PLUS_APP_ID -> {
|
|
|
|
+ doDownload(LOTTO_PLUS_DOWNLOAD, it.tokenData?.token)
|
|
|
|
+ }
|
|
|
|
+ YUKI_APP_ID -> {
|
|
|
|
+ doDownload(YUKI_DOWNLOAD, it.tokenData?.token)
|
|
|
|
+ }
|
|
|
|
+ APONG_APP_ID -> {
|
|
|
|
+ doDownload(APONG_DOWNLOAD, it.tokenData?.token)
|
|
|
|
+ }
|
|
|
|
+ COCK_FIGHT_APP_ID -> {
|
|
|
|
+ doDownload(COCK_FIGHT_DOWNLOAD, it.tokenData?.token)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
it.intent = null
|
|
it.intent = null
|
|
it.tokenData = null
|
|
it.tokenData = null
|
|
|
|
+ it.appId = null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -178,27 +200,8 @@ class MainFragment : BaseFragment(R.layout.layout_fragment_main_yuki) {
|
|
shareViewModel.getModuleToken(appId, launchIntent)
|
|
shareViewModel.getModuleToken(appId, launchIntent)
|
|
} else {
|
|
} else {
|
|
//installed
|
|
//installed
|
|
- doDownload(YUKI_DOWNLOAD)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- LOTTO_APP_ID -> {
|
|
|
|
- (requireActivity() as ShareActivity).apply {
|
|
|
|
- val launchIntent = packageManager.getLaunchIntentForPackage(LOTTO_PACKAGE)
|
|
|
|
- if (launchIntent != null) {
|
|
|
|
- shareViewModel.getModuleToken(appId, launchIntent)
|
|
|
|
- } else {
|
|
|
|
- doDownload(LOTTO_DOWNLOAD)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- LOTTO_PLUS_APP_ID -> {
|
|
|
|
- (requireActivity() as ShareActivity).apply {
|
|
|
|
- val launchIntent = packageManager.getLaunchIntentForPackage(LOTTO_PLUS_PACKAGE)
|
|
|
|
- if (launchIntent != null) {
|
|
|
|
- shareViewModel.getModuleToken(appId, launchIntent)
|
|
|
|
- } else {
|
|
|
|
- doDownload(LOTTO_PLUS_DOWNLOAD)
|
|
|
|
|
|
+ shareViewModel.getModuleToken(appId, null)
|
|
|
|
+ //doDownload(YUKI_DOWNLOAD)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -208,7 +211,8 @@ class MainFragment : BaseFragment(R.layout.layout_fragment_main_yuki) {
|
|
if (launchIntent != null) {
|
|
if (launchIntent != null) {
|
|
shareViewModel.getModuleToken(appId, launchIntent)
|
|
shareViewModel.getModuleToken(appId, launchIntent)
|
|
} else {
|
|
} else {
|
|
- doDownload(COCK_FIGHT_DOWNLOAD)
|
|
|
|
|
|
+ //doDownload(COCK_FIGHT_DOWNLOAD)
|
|
|
|
+ shareViewModel.getModuleToken(appId, null)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -218,7 +222,8 @@ class MainFragment : BaseFragment(R.layout.layout_fragment_main_yuki) {
|
|
if (launchIntent != null) {
|
|
if (launchIntent != null) {
|
|
shareViewModel.getModuleToken(appId, launchIntent)
|
|
shareViewModel.getModuleToken(appId, launchIntent)
|
|
} else {
|
|
} else {
|
|
- doDownload(APONG_DOWNLOAD)
|
|
|
|
|
|
+ //doDownload(APONG_DOWNLOAD)
|
|
|
|
+ shareViewModel.getModuleToken(appId, null)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -229,10 +234,10 @@ class MainFragment : BaseFragment(R.layout.layout_fragment_main_yuki) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private fun doDownload(url: String) {
|
|
|
|
|
|
+ private fun doDownload(url: String, token: String? = null) {
|
|
try {
|
|
try {
|
|
(requireActivity() as ShareActivity).apply {
|
|
(requireActivity() as ShareActivity).apply {
|
|
- downloadController = DownloadController(this, url)
|
|
|
|
|
|
+ downloadController = DownloadController(this, url, token)
|
|
checkStoragePermission()
|
|
checkStoragePermission()
|
|
}
|
|
}
|
|
|
|
|