Questions tagged [selinux]

The tag has no usage guidance, but it has a tag wiki.

Filter by
Sorted by
Tagged with
0 votes
0 answers
38 views

How to get avc logging ( selinux ) in Android working?

I am on Android 10. Whether I setenforce 0 or 1- I cannot get avc ( aka SeLinux ) errors logged. I checked ramoops files also and its ditto. root@m20lte:/ # setenforce 1 ...
user1874594's user avatar
0 votes
0 answers
48 views

How do I log denials for offline charging mode

I've been able to fix offline charging animation on my device but it only works in permissive domain and whilst in enforcing it shows me random lines and i can't figure out a way to address the ...
Om Patel's user avatar
1 vote
0 answers
164 views

How to fix a bootloop caused by accidental "fix contexts" from TWRP?

I am using TWRP recovery on my Redmi Note 10 Pro device for a long time, but recently while using TWRP recovery, I mistakenly clicked on 'fix contexts' option and now my phone is stuck in a bootloop. ...
AS Creations Limited's user avatar
1 vote
0 answers
84 views

How to make `/system` dir files readable using `sepolicy-inject` tool?

In enforcing SELinux state, Android /system files become unavailable to read in explorer. How to make /system dir files readable using sepolicy-inject tool? Also, need sepolicy-inject command for ...
user9330612's user avatar
0 votes
0 answers
57 views

init.rc won't run iptables-restore but runs iptables

I have this code in /system/etc/init/fw.sh that works great: on post-fs-data exec u:r:magisk:s0 -- /system/bin/iptables -P INPUT DROP But the line below does not work: exec u:r:magisk:s0 -- /...
user145453's user avatar
1 vote
0 answers
160 views

Access "data/tombstones/" dir from Android application

Trying to get access to "data/tombstones" directory from my rooted phone. I am implementing a crash collector application (system application) which would help to record the system's ANRs ...
Lavyansi's user avatar
1 vote
0 answers
65 views

SELinux denials after migrating application data between devices

I'm trying to migrate application data between devices. The application was installed to the work profile using Shelter The steps I did were: On source phone, tar cvf appdata.tar.gz /data/user/10/com....
marmistrz's user avatar
  • 259
3 votes
0 answers
165 views

Create custom SELinux domain using magiskpolicy

Tried to make custom domain for an app that is installed from PlayStore. I created a module that would patch the policy at boot and edited system/etc/selinux/plat_seapp_contexts to assign the app my ...
Wolverine's user avatar
2 votes
1 answer
469 views

Exploring options for customizing SeLinux policy ( SePolicy to enable bind-mounting ) , including kernel recompilation

As I realized selinux for Android is more than tad bit different creature than what I can get done on Linux . I need SeLinux policy to be modified so I can bind mount my folders. Unless that happens ...
Jason Reeves's user avatar
1 vote
0 answers
204 views

pstore/ramoops won't work on Poco M3, rooted

I'm trying to use pstore logs on my Poco M3. I tried everything. PSTORE configs are activated on the kernel, pstore module is loaded on the phone, phone is rooted, /sys/fs/pstore is mounted ...
Rafaelo's user avatar
  • 61
0 votes
0 answers
629 views

open failed: EACCES (Permission denied)

I am trying to copy the file from /storage/emulated/0/test.txt to /cache/SH_DIR/ via android user application , getting error like below : java.io.FileNotFoundException: /cache/SH_DIR/test.txt: open ...
GNK's user avatar
  • 119
1 vote
0 answers
239 views

Should SELinux be Permissive to access /dev/diag

I am trying to set the SELinux to permissive on Android with no luck. I tried the command su 0 setenforce 0 it returns OK while still being Enforcing if checking immediately using getenforce command. ...
MRDRAG's user avatar
  • 11
1 vote
0 answers
199 views

Stuck in boot loop after "Fixing SELinus contexts"

So, let's say that I have already "Fixed SELinux Contexts", and I am now in a boot loop. How could I resolve this issue. I am quite new to all of this, but I am eager to learn and fix my ...
jakmatix's user avatar
2 votes
0 answers
552 views

remount, turn off SElinux, all fails even though I am root

I have a device which is never hacked into before, mostly as nobody has it, it is a android tv box. I have temp root using the dirty cow exploit, and tried to remount system using the mount command. ...
satyamedh hulyalkar's user avatar
1 vote
0 answers
48 views

why DAC isn't sufficient for Android that it needs MAC(selinux)

I learned that each app is assigned a separate UID so that a rogue app cannot access other apps data and system sensetive data and files. What's problem with this that they have to use MAC(selinux)
kymere's user avatar
  • 11
2 votes
0 answers
56 views

How would the app DiskDigger be able to get past SELinux when adbd/SuperSU/etc. cannot?

Okay, so I was able to recover my deleted files after all. I am the furthest thing from a software developer, and I don't have more time to spend on this, but I wanted to explain how I fixed it and ...
An_Asymptote's user avatar
1 vote
0 answers
204 views

Attempting file recovery (deleted photos) on Note 4 via accessing /data/userdata; rooted phone, patched adbd, but now USB debugging won't work

I made a post about this yesterday, and I managed to make a lot of progress today, but I'm stuck again, and I am trying to decide what to do. I am not really experienced with coding, but I happen to ...
An_Asymptote's user avatar
1 vote
0 answers
1k views

How to mount a tmpfs directory that would be allowed to be read and written to by any app? (root available)

I am trying to create some volatile (tmpfs) storage for my Android, to avoid clutter. I am trying to follow the previous questions: making manually mounted partition folders write accessible to all ...
Vladimir Nikishkin's user avatar
1 vote
0 answers
293 views

Result of ls -la in adb shell

If I go into my unrooted phone's adb shell (Samsung galaxy s7 Android 8) I get a result similar to this: dr-xr-xr-x 921 root root 0 2020-01-26 10:06 acct -rw-r--r-- 1 root root 225 ...
user17915's user avatar
  • 381
1 vote
0 answers
333 views

Starting shell script at boot in SELinux enforcing mode [closed]

I am building Android Pie (tag android-9.0.0_r46, branch android-msm-marlin-3.18-pie-qpr2) from source. I am testing on a Pixel XL (marlin). I want to have a custom shell script run automatically when ...
onetyone's user avatar
  • 111
2 votes
0 answers
756 views

SUPolicy to allow custom service to read and write from Internal Storage

I'm setting up custom service with custom sepolicy using this as a base: How to fix SELinux "avc: denied" errors when launching DNSCrypt as init.d script? In 99% I follow the quick summary ...
Kirikan's user avatar
  • 79
1 vote
0 answers
1k views

How to force SELinux to permissive even when setenforce 0 is not working and kernel was 100% permissive when flashed?

I don't know what to do, I'm using Samsung Note 3 (Exynos) - N900 with custom Resurrection Remix 5.8.5 ROM (Android 7.1.2) with it's own permissive kernel and rooted with Magisk. Yesterday it turned ...
Marty's user avatar
  • 11
2 votes
1 answer
2k views

Run script using init.rc doesn't work

I'm trying to run a script that exectues when the device has finished booting. This particular device does not support running scripts from an init.d directory, which is why I am using init.rc. The ...
Ringo001's user avatar
2 votes
1 answer
145 views

How are apps installed on Android ? context - symbolic links of only some apps disappear after reboot

I am using Apps2sd to move some apps to ext4 partition mmcblk1p2. It successfully moved 1 app ( see code below ) but after linking another , the symblink for app gets deleted but data folder's ...
user1874594's user avatar
1 vote
1 answer
2k views

Need to add custom script as service in init.rc for Android 10

I am trying run shell script in device boot-up time. Steps: Created shell script and placed into /system/bin/usbmountd.sh Added test.sh in inir.rc. service usbmountd /system/bin/usbmountd.sh user ...
GNK's user avatar
  • 119
0 votes
0 answers
3k views

How to disable zip verification flag in stock recovery.img?

In stock recovery there is an option to install zip from the sdcard but it doesn't allow installing zips with unknown signature. Twrp can install any zip without concerning about the the zip signature....
Vatish Sharma's user avatar
1 vote
0 answers
76 views

How to add a simple file on /system without actually modifying it but with using kernel sources? [closed]

From the time system-as-root came, developers have rooted different devices by patching the Magisk su binaries in the kernel. I want to understand how exactly they have done this so to start from ...
Vatish Sharma's user avatar
4 votes
1 answer
3k views

How to mount system under super partion?

Google has recently changed the way to mount system and introduced Dynamic Partitions. Previously in a rooted adb shell, I used to run mount -o rw,remount /system to mount system in read-write mode. ...
Vatish Sharma's user avatar
4 votes
1 answer
2k views

What is 02 in the magisk patched vbmeta.img?

According to the Additional Info given for rooting the Android device that doesn't have ramdisk but can be rooted via recovery: we need an empty vbmeta.img and I am trying to check what it actually ...
Vatish Sharma's user avatar
1 vote
0 answers
386 views

How can I record call using c code(c executable that can run on Android-Linux) on rooted Android device?

I want to record a call that is called by my application for the call test purposes. We record a call and compare it with a high-quality WAV file to determine the call quality. But the call recording ...
Vatish Sharma's user avatar
4 votes
1 answer
5k views

SELinux permissive kernel - is it a security risk?

As in title. I am talking of Kernel, not ROM (plenty of questions dealing with ROM on this site). I have a OnePlus 7 running stock Android 10 and prefer a custom kernel. Of late, OnePlus hasn't ...
beeshyams's user avatar
  • 39.9k
0 votes
1 answer
1k views

how to extend support for EXT4 file system for microSD cards in stock or non lineage / CyanogenMod ROMS

As I am aware after Android 4.4 or some sort your storage card is no longer eXposed directly and needs to be carefully interfaced through specific Mount points that need to be aware through vold ...
user1874594's user avatar
1 vote
2 answers
2k views

How to add SELinux policy on a user-debug ROM that has `split` policy scheme?

I have a Sony device that supports treble and is a system-as-root and A/B device. It has a user-debug ROM installed on it so, its adb shell is rooted. I have disabled dm-verity using adb disable-...
Vatish Sharma's user avatar
4 votes
1 answer
4k views

How to disable dm-verity on `Treble` , `system-as-root` device?

Background: Please check following links How to disable dm-verity on Android with “user” build type ROM? Stuck in boot-loop when unpack and pack system.img? Update: So, I am trying to disable dm-...
Vatish Sharma's user avatar
6 votes
1 answer
12k views

What does TWRP "Fix Contexts" do?

In my blu_spark TWRP, I have an option (under "Advanced") named 'Fix Contexts'. When I press it, it says: Note: Fixing contexts is rarely needed Fixing SELinux Contexts may cause your ...
Tom Hale's user avatar
  • 427
0 votes
0 answers
5k views

How to enforce Selinux (setprop ro.boot.selinux=enforcing)

I have a Xiaomi Redmi K20 Pro (raphael, China Version) device. I set the prop "ro.boot.selinux" to "permissive", by installing this Magisk Module. Now I'd like to set it back to "enforcing", but didn'...
doener's user avatar
  • 11
0 votes
0 answers
3k views

Stuck in boot-loop when unpack and pack `system.img`?

Background: I have a treble and system-as-root but it is not an A/B Samsung device. I am trying to modify the system.img. Before that, I have rooted it with the steps given here. After following these ...
Vatish Sharma's user avatar
0 votes
0 answers
2k views

How to patch `system.img` using MagiskManager patch feature to root the device?

I have a treble and system-as-root but it is not an A/B device. I have rooted it with the help of the MagiskManager patch feature. My understanding is: MagiskManager has modified the following three ...
Vatish Sharma's user avatar
2 votes
1 answer
23k views

How to fix: only official released binaries are allowed to be flashed(recovery) on device / FAIL! (Auth) on Odin3 v3.13?

I have Samsung S10 5G(Qualcomm) device. This device has unlocked bootloader but it is not rooted yet. I am trying to learn Unpack-Modify-Pack the ROM images. Currently, I have VZW stock ROM ...
Vatish Sharma's user avatar
0 votes
0 answers
3k views

How to get rid of SeLinux Denials in Permissive mode?

Need some help with 3 issues: In Permissive mode I get denials, why does this happen and how do I fix that? If I am enforced, how do I give access to my Partitions to various processes. Right now I ...
user1874594's user avatar
5 votes
1 answer
2k views

How to run a program in an app context with Magisk?

Let's say I'm currently as root in Bash on a terminal, outside any app like Termux. I'm running Magisk. Now I want to synchronously invoke Termux's Bash, such that it behaves the same way as it would ...
user541686's user avatar
1 vote
1 answer
7k views

SELinux always set to permissive, how to set enforcing permanently?

I flash a custom ROM to my HTC B2UL. The ROM, by default, has the SELinux policy set to Permissive instead of Enforcing. I can use adb shell setenforce 1 to make SElinux enforcing. But after reboot, ...
Sasuke's user avatar
  • 13
12 votes
3 answers
54k views

How to unpack/repack system.img of android ROM?

I have OnePlus 6T device which has A/B partition system and has a ROM of user type i.e [ro.build.type]: [user]. This device is rooted with Magisk. I have a requirement(Want to place customized ...
Vatish Sharma's user avatar
6 votes
2 answers
47k views

How to disable dm-verity on Android with "user" build type ROM?

I have One Plus 6T Android device which has a ROM of build type user. This device is rooted with Magisk and I want to disable dm-verity on this device. I have tried to run adb disable-verity but I got ...
Vatish Sharma's user avatar
6 votes
2 answers
3k views

How to make SELinux injected rules persistent without unpacking-packing boot.img?

I am working on an application that needs root access and I have a device which is rooted but not with Magisk. This device has only adb shell root available. So, I need an alternative to call the ...
Vatish Sharma's user avatar
-2 votes
1 answer
1k views

SELinux temporary set to permissive

I am using a Galaxy s10+, rooted with magisk, no custom ROM, no custom kernel and no custom recovery. The rooting is heavily limited because of the SELinux enforce mode. Actually, no root command in ...
Selinuxguy's user avatar
2 votes
1 answer
6k views

How to set SELinux enforcing, config file not found?

I have Samsung Galaxy J7 Core (SM-J701F), I'm running Magisk on my device and I ran the SafteyNet test and it failed. While trying to solve this I tried to change selinux state to enforced by editing /...
Basel Qarabash's user avatar
0 votes
0 answers
1k views

How to create Android sepolicy based on the denial "execute_no_trans"?

I am trying to execute my script /vendor/bin/init.inmod.sh using below method: Script init.inmod.sh: #!/shebang??? /vendor/bin/test_disp hdcp disable In vendor specific .rc file: on ??? start ...
rahuls's user avatar
  • 1
0 votes
1 answer
2k views

SELinux Policy from Permissive to Enforcing

Using Nexus 5 with AospExtended ROM (Android 9) 19/04/05 The ROM, by default, has the SELinux policy set to Permissive instead of Enforcing. Is there any way, perhaps using TWRP Recovery, to change ...
sheldonm301's user avatar
1 vote
1 answer
865 views

Adding custom bootup script to Android-x86 Nougat

I've been happy using Android-x86 Nougat on my system. Thanks to everyone who made that work. I'm now trying to make one small change which is that I want to run a custom init script (a shell script) ...
Jaya Kumar's user avatar