add package name dynamically in provider

This commit is contained in:
Pritimay Sarkar
2024-02-09 13:49:16 +05:30
parent 37c8dde5bd
commit de74da3135

View File

@@ -156,9 +156,10 @@ class DashboardActivity : AppCompatActivity(), IDataCollector {
val file = File(getExternalFilesDir("Updates"), "update.apk")
file.setReadable(true, false) // Ensure the file is readable
val pInfo = baseContext.packageManager.getPackageInfo(baseContext.packageName, 0)
val uri: Uri = FileProvider.getUriForFile(
this,
"com.example.hpostesting.fileprovider",
"${pInfo}.fileprovider",
file
)