Skip to content
Advertisement

Tag: permissions

How to handle the Usb Permission Dialog Event on android when using the “device filter” solution?

I’m trying to handle the event when a user presses “ok” or “cancel” on the automatic permission dialog presented when I connect a “known” USB device to the android phone. I’m using the android.usb.host library and can send and receive between the android phone and the device. Futhermore do I handle the “USB_DEVICE_ATTACHED” and “USB_DEVICE_DETACHED” using a BroadcastReceiver without any

Create directory without manage all files permission

How can i create directory in ( /storage/emulated/0/ ) without manage all files permission. This is my code : On android 11 its not working because it need manage all files permission. Answer From SDK 30 you can not access all file system without using MANAGE_EXTERNAL_STORAGE. If your app is in following categories you can ask for this permission: File

Setting file permissions returns FALSE always

The code: On Ubuntu all 3 calls return false. On my Windows only the 3rd call to setWritable returns false. The target is to create the file/dir so the user (tomcat) and the group will be able to read/write. BUT the file created on Ubuntu without permissions for the group to write. Answer I found the solution and will answer

Get path from FileDescriptor in Java

Some quick background on my problem: I’m writing a compiler that converts Domain Type Enforcement specs into Java Security Manager code. In a nutshell, DTE defines “types” (objects), assigns paths to those types; then defines “domains” (subjects), and defines what permissions (rwxdc) domains have to various types. I need to emulate this behavior as closely as possible in the JSM.

Advertisement