Skip to main content

Questions tagged [selinux]

For questions relating to error messages and other problems that throw up references to selinux.

Filter by
Sorted by
Tagged with
1 vote
0 answers
116 views

Android Keystore error from GMS and NordVPN

I am having a problem on my Android TV Box X96 Max Plus Ultra (s905x4 4/64) Android 11. Tested on stock and on Slimbox ATV / AOSP with root and Magisk. When I want to log in and connect to VPN in the ...
Amalia's user avatar
  • 21
1 vote
0 answers
61 views

How to successfully execute a script from init.rc

I have an old stock Android 5.1.1. It has custom twrp recovery and is rooted. I have the stock boot.img file and am able to edit the init.rc and repack and flash it back with fastboot flash boot boot....
randomuser's user avatar
2 votes
0 answers
578 views

How to redirect DNS traffic to dnsmasq on Android

I’m trying filter all DNS traffic using dnsmasq on Android (LineageOS). Here is what I did (thanks to the help of @IrfanLatif): I installed it using termux: pkg i root-repo && pkg up &&...
ellat's user avatar
  • 101
1 vote
0 answers
218 views

Unpack boot.img and add "androidboot.selinux=enforcing" to boot.img-cmdline not work on Samsung

After flashing Android 13 of LineageOS to Galaxy Note 10+, I'm trying to set SELinux permissive following the steps. Unpack boot.img and add androidboot.selinux=permissive to boot.img-cmdline use ...
Nelson's user avatar
  • 11
0 votes
0 answers
153 views

Starting service with su -c "start vendor.diag-router" in SeLinux enforced mode gives error

While being in enforced mode i ran below in Termux: su -c "start vendor.diag-router" which gave me output: Unable to start service 'vendor.diag-router' See dmesg for error reason. In logs ...
gurmel singh's user avatar
0 votes
0 answers
95 views

Terminal - restorecon -R isn' running recursively

Device info: I'm running Phh-Treble GSI Android 13 on a Lenovo TB-9707F device. Rooted Tablet. I'm trying to run restorecon -R on a folder to recursively restore SElinux context for the whole tree. If ...
Sruly's user avatar
  • 1,028
1 vote
0 answers
373 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
98 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
333 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
132 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
1 vote
0 answers
359 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
1 answer
190 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
430 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
2k 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
2 votes
0 answers
339 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
  • 71
0 votes
0 answers
1k 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
  • 129
1 vote
0 answers
305 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
279 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
770 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
55 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
61 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
258 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
2k 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
334 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
506 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
951 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
2k 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
169 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
2 votes
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
  • 129
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
101 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
5k 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
3k 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
428 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
  • 41.3k
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
7 votes
1 answer
14k 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
  • 457
0 votes
0 answers
7k 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
3k 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
3 votes
1 answer
29k 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
1 vote
0 answers
4k 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
9k 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
16 votes
4 answers
66k 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
8 votes
2 answers
55k 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
4k 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