|
@@ -24,6 +24,7 @@ import com.khmer9.sbcmain.screen.report.StatementFragment
|
|
import com.khmer9.sbcmain.screen.setting.SettingFragment
|
|
import com.khmer9.sbcmain.screen.setting.SettingFragment
|
|
import com.khmer9.sbcmain.screen.splash.SplashScreenActivity
|
|
import com.khmer9.sbcmain.screen.splash.SplashScreenActivity
|
|
import java.io.File
|
|
import java.io.File
|
|
|
|
+import java.io.FileOutputStream
|
|
import java.io.InputStream
|
|
import java.io.InputStream
|
|
import java.io.OutputStream
|
|
import java.io.OutputStream
|
|
|
|
|
|
@@ -153,7 +154,8 @@ class MainFragment : BaseFragment(R.layout.layout_fragment_main_yuki) {
|
|
var outPutStream: OutputStream? = null
|
|
var outPutStream: OutputStream? = null
|
|
|
|
|
|
try {
|
|
try {
|
|
- inputStream = assetManager.open("yuki.apk")
|
|
|
|
|
|
+ inputStream = assetManager.open("Khmer9_Yuki_prodRelease_1.0.1.apk")
|
|
|
|
+ outPutStream = FileOutputStream(filesDir.path+ "/" + "Khmer9_Yuki_prodRelease_1.0.1.apk")
|
|
val buffer = ByteArray(1024)
|
|
val buffer = ByteArray(1024)
|
|
|
|
|
|
var read: Int
|
|
var read: Int
|
|
@@ -171,7 +173,8 @@ class MainFragment : BaseFragment(R.layout.layout_fragment_main_yuki) {
|
|
outPutStream = null
|
|
outPutStream = null
|
|
|
|
|
|
val intent: Intent = Intent(Intent.ACTION_VIEW)
|
|
val intent: Intent = Intent(Intent.ACTION_VIEW)
|
|
- intent.setDataAndType(Uri.fromFile(File("/sdcard/" + "yuki.apk")), "application/vnd.android.package-archive")
|
|
|
|
|
|
+ intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
|
|
|
+ intent.setDataAndType(Uri.fromFile(File(filesDir.path+ "/" + "Khmer9_Yuki_prodRelease_1.0.1.apk")), "application/vnd.android.package-archive")
|
|
startActivity(intent)
|
|
startActivity(intent)
|
|
} catch (e: Exception) {
|
|
} catch (e: Exception) {
|
|
e.printStackTrace()
|
|
e.printStackTrace()
|