Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Fixed folders showing up incorrectly as files in copy/move dialog ([#267])
- Fixed error when saving files with unsupported characters ([#250])
- Fixed File manager does not ask for file access permission if opened for the first time via "share" dialog ([#85])
Comment thread
jguegel marked this conversation as resolved.
Outdated

## [1.2.3] - 2025-09-15
### Fixed
Expand Down Expand Up @@ -76,6 +77,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#251]: https://github.com/FossifyOrg/File-Manager/issues/251
[#267]: https://github.com/FossifyOrg/File-Manager/issues/267
[#250]: https://github.com/FossifyOrg/File-Manager/issues/250
[#85]: https://github.com/FossifyOrg/File-Manager/issues/85

[Unreleased]: https://github.com/FossifyOrg/File-Manager/compare/1.2.3...HEAD
[1.2.3]: https://github.com/FossifyOrg/File-Manager/compare/1.2.2...1.2.3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import android.graphics.drawable.Drawable
import android.media.RingtoneManager
import android.net.Uri
import android.os.Bundle
import android.os.Environment
import android.os.Handler
import android.provider.Settings
import android.widget.ImageView
Expand Down Expand Up @@ -281,15 +280,6 @@ class MainActivity : SimpleActivity() {
}
}

@SuppressLint("NewApi")
override fun onActivityResult(requestCode: Int, resultCode: Int, resultData: Intent?) {
super.onActivityResult(requestCode, resultCode, resultData)
isAskingPermissions = false
if (requestCode == MANAGE_STORAGE_RC && isRPlus()) {
actionOnPermission?.invoke(Environment.isExternalStorageManager())
}
}

private fun updateMenuColors() {
updateStatusbarColor(getProperBackgroundColor())
binding.mainMenu.updateColors()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ package org.fossify.filemanager.activities

import android.content.Intent
import android.net.Uri
import android.os.Build
import android.os.Bundle
import androidx.annotation.RequiresApi
import androidx.core.net.toUri
import org.fossify.commons.dialogs.FilePickerDialog
import org.fossify.commons.extensions.*
import org.fossify.commons.helpers.NavigationIcon
Expand All @@ -15,8 +18,19 @@ import java.io.File
class SaveAsActivity : SimpleActivity() {
private val binding by viewBinding(ActivitySaveAsBinding::inflate)

companion object {
private const val MANAGE_STORAGE_RC = 201
}

Comment thread
jguegel marked this conversation as resolved.
Outdated
@RequiresApi(Build.VERSION_CODES.R)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (!isExternalStorageManager()) {
val intent = Intent(android.provider.Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION)
intent.data = "package:$packageName".toUri()
startActivityForResult(intent, MANAGE_STORAGE_RC)
return
}
setContentView(binding.root)

Comment thread
jguegel marked this conversation as resolved.
if (intent.action == Intent.ACTION_SEND && intent.extras?.containsKey(Intent.EXTRA_STREAM) == true) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package org.fossify.filemanager.activities

import android.annotation.SuppressLint
import android.content.Intent
import android.os.Environment
import org.fossify.commons.activities.BaseSimpleActivity
import org.fossify.commons.extensions.hasPermission
import org.fossify.commons.extensions.toast
import org.fossify.commons.helpers.PERMISSION_WRITE_STORAGE
import org.fossify.commons.helpers.isRPlus
import org.fossify.filemanager.R
Expand Down Expand Up @@ -31,10 +33,28 @@ open class SimpleActivity : BaseSimpleActivity() {
R.mipmap.ic_launcher_grey_black
)

companion object {
private const val MANAGE_STORAGE_RC = 201
}

override fun getAppLauncherName() = getString(R.string.app_launcher_name)

override fun getRepositoryName() = "File-Manager"

@SuppressLint("NewApi")
override fun onActivityResult(requestCode: Int, resultCode: Int, dataIntent: Intent?) {
super.onActivityResult(requestCode, resultCode, dataIntent)

if (requestCode == MANAGE_STORAGE_RC && isRPlus()) {
if (Environment.isExternalStorageManager()) {
recreate()
} else {
toast(R.string.no_storage_permissions)
finish()
}
}
}

Comment thread
jguegel marked this conversation as resolved.
Outdated
@SuppressLint("NewApi")
fun hasStoragePermission(): Boolean {
return if (isRPlus()) {
Expand Down
Loading