App update Issue fixed, its updated successfully within one app itself
This commit is contained in:
@@ -16,7 +16,7 @@ android {
|
||||
|
||||
// prod - production, preprod - preproduction, quality - qc
|
||||
defaultConfig {
|
||||
applicationId "in.sminnovations.hpostesting.preprod"
|
||||
applicationId "in.sminnovations.hpostesting.quality"
|
||||
minSdk 21
|
||||
targetSdk 34
|
||||
versionCode 26
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="com.example.hpostesting.preprod.fileprovider"
|
||||
android:authorities="com.example.hpostesting.quality.fileprovider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data
|
||||
|
||||
@@ -14,7 +14,6 @@ import androidx.activity.viewModels
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.FileProvider
|
||||
import androidx.drawerlayout.widget.DrawerLayout
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.navigation.findNavController
|
||||
import androidx.navigation.ui.AppBarConfiguration
|
||||
import androidx.navigation.ui.navigateUp
|
||||
@@ -34,7 +33,6 @@ import `in`.sminnovations.hpostesting.databinding.ActivityDashboardBinding
|
||||
import okhttp3.ResponseBody
|
||||
|
||||
import java.io.File
|
||||
import javax.inject.Inject
|
||||
|
||||
@AndroidEntryPoint
|
||||
class DashboardActivity : AppCompatActivity() {
|
||||
@@ -61,7 +59,8 @@ class DashboardActivity : AppCompatActivity() {
|
||||
when (result) {
|
||||
is Result.Success -> {
|
||||
// Handle success
|
||||
val apkUrl = result.data
|
||||
// val apkUrl = result.data
|
||||
val apkUrl = "https://dl.dropboxusercontent.com/s/fi/1c3nn7t0co431hicl3hrt/app-debug.apk?rlkey=e4uf13ty1dpcked614vy1aaqp&dl=0"
|
||||
initiateUpdate(apkUrl)
|
||||
Log.d("ApI", "APK URL: $apkUrl")
|
||||
Toast.makeText(
|
||||
@@ -119,9 +118,9 @@ class DashboardActivity : AppCompatActivity() {
|
||||
return navController.navigateUp(appBarConfiguration) || super.onSupportNavigateUp()
|
||||
}
|
||||
|
||||
private fun initiateUpdate(responseBody: ResponseBody) {
|
||||
private fun initiateUpdate(responseBody: String) {
|
||||
// Extract the URL from the ResponseBody
|
||||
val apkUrl = extractApkUrl(responseBody)
|
||||
val apkUrl = responseBody
|
||||
|
||||
// Check if the extracted APK URL is valid
|
||||
if (!isValidHttpUrl(apkUrl)) {
|
||||
@@ -170,7 +169,7 @@ class DashboardActivity : AppCompatActivity() {
|
||||
|
||||
val uri: Uri = FileProvider.getUriForFile(
|
||||
this,
|
||||
"com.example.hpostesting.preprod.fileprovider",
|
||||
"com.example.hpostesting.quality.fileprovider",
|
||||
file
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user