yashsingh1/xdaforums huggingface dataset:
[Android Software Development] moonbutt74:
C,

hi, you can only work with what's in the policy if i'm doing the following correctly

for -s <source type>

sepolicy-inject -s [COLOR="Red"]hack[/COLOR] -t system -c process -p write -P sepolicy -o sepolicy-UNdead
libsepol.policydb_index_others: security: 1 users, 2 roles, 1331 types, 0 bools
libsepol.policydb_index_others: security: 1 sens, 1024 cats
libsepol.policydb_index_others: security: 86 classes, 15661 rules, 0 cond rules
source type hack does not exist
Could not add rule

same for -t <target type>

sepolicy-inject -s shell -t [COLOR="Red"]hack[/COLOR] -c process -p write -P sepolicy -o sepolicy-UNdead
"blah blah"
target type hack does not exist
Could not add rule

NOT the same for -c <class> , with class i was looking through external/sepolicy/security_classes to find a valid class not in policy

# More SE-X Windows stuff

class x_resource	# userspace

so

sepolicy-inject -s shell -t system -c [COLOR="Red"]x_resource[/COLOR] -p write -P sepolicy -o sepolicy-UNdead
libsepol.policydb_index_others: security: 1 users, 2 roles, 1331 types, 0 bools
libsepol.policydb_index_others: security: 1 sens, 1024 cats
libsepol.policydb_index_others: security: 86 classes, 15661 rules, 0 cond rules

sesearch -A -c x_resource sepolicy-UNdead
Found 1 semantic av rules:
allow shell system_server : [COLOR="Red"]x_resource[/COLOR] write ;

so, again i am probably doing the first two wrong but i'm having a difficult time finding out what valid entries i can attempt

for <source> and <target> that aren't in the policy. <class> was easier as i figured there would be any x_window stuff.

m
[Android Software Development] zombiegoaste:
Hi and thank you for the awesome tool!

A little question (probably also a dumb one) - will it work if called for init service, user root group root, default init service context?

Something like

service humble_sepatcher /system/bin/sh /system/xbin/sepolicy-inject "[ [I]parameters go here I suppose ;)[/I] ]"
user root
group root
class core
oneshot

Usecase:

I want to temporarily switch Selinux to Permissive mode very early in the init sequence (adding early initd to a ROM I don't have sources for)

setenforce and "write /sys/fs/selinux/enforce 0" do not work during init (but after the system boots completely and SUperSu finally does its deed, I can do setenforce 0 and enter permissive mode)

Also, since I am rather lame when it comes to Selinux :( what would be the best way to go about it ? (I suspect that allowing /system/bin/sh and echo to write to /sys/fs/selinux/enforce might be enough, but so far I can't even think of where to start)
[Android Software Development] pittvandewitt:
Hello [MENTION=1912440]Mikos[/MENTION],

I was wondering if your tool would get an update to support android 6 and policydb version 30. In the attachment is the error I receive.
[Android Software Development] Phoenix Wright:
I made a modification to sepolicy-inject to add a command (sepolicy-inject -R) to revert all the sepolicy changes. It does this by simply loading the original sepolicy in the ramdisk (/sepolicy) without modifying it.

http://pastebin.com/fKTu3FRC
[Android Software Development] Mikos:
[MENTION=4539728]pittvandewitt[/MENTION] I have uploaded new version 1.2 which does support policydb version 30 (Android 6) and also supports 64-bit architectures (arm64-v8a, mips64, x86_64).
[Android Software Development] pittvandewitt:
This is awesome news! Thank you for your work and also for letting me know
[Android Software Development] brymaster5000:
Is there anywhere that explains the usage of the injection tools - specifically how to manipulate the commands to achieve your intent? The instructions are limited and my time with selinux has only just begun and I am having a difficult time getting good search results on making the sepolicy changes I need. I specifically need to create an allowance to let a kernel script run at boot. I currently have a kernel script that gets pushed to the system partition during the flash and runs on boot without superSU installed in marshmallow, but on N-preview it does not run and I get sepolicy denials. If anyone can either give me a few pointers on using this tool, or knows of a good guide somewhere for me to get going - it would be much appreciated. TIA.
[Android Software Development] darkmen:
delete this somehow plz
[Android Software Development] darkmen:
Hy, everyone

This tool is musthave for the root\kernel devs, but it is so "unfinished"

I have added a few lines of code to make it powerfull and understand tool.

This way it can work lke this:

.

Attaching the source and precompiled cygwin and android binaries
[Android Software Development] ka_ru:
Help me please with the rule. I'm having an error when running the APPS.

E dex2oat : Failed to create oat file: /data/dalvik-cache/arm/data@app@com.android.socketcan-1@split_lib_dependencies_apk.apk@classes.dex: Permission denied

E dex2oat : Failed to create oat file: /data/dalvik-cache/arm/data@app@com.android.socketcan-1@split_lib_slice_0_apk.apk@classes.dex: Permission denied

I think "sepolicy-inject" help me.

Andrew.
[Android Software Development] psndna88:
can u update it to inject into android 7.1.x sepolicy ...
[Android Software Development] killernos:
Bump
[Android Software Development] androforn:
Already have sepolicy-inject in Magisk

So seems sepolicy-inject is part of Magisk 13.1 at least.

But I still cannot quite wrap my head around the syntax. If I want to grant an application , say a music player, to a customer mounted partion on /sd-ext how do I go about getting it access to read the files. Standard unix perms on the SD card don't seem to work but if SELinux is involved then it will be an acl issue. Trouble is I am familiar with setfacl, which is not included in android, and not at all familiar with sepolicy-inject

As someone above asked, are there some examples of achieving different tasks with sepolicy-inject? How do I grant a specific app (or a group of apps) permission to a folder on a filesystem not mounted as /sdcard?

Thanks.
[Android Software Development] Mikos:
I have published new version 1.3 which should now work without problems on Android N (and hopefully also on Android O, but I haven't tested it yet).
[Android Software Development] Goutam NB:
any flashable zip through recovery to do this changes ....
[Android Software Development] cloooned:
Thanks for this great tool. It is now possible to add new sources to an existing sepolicy which is a major improvement.

I need to add a custom init context, like supersu from chainfire, which is loaded by the init process. My custom_init source has the same context configuration as the default init source. The permission of execute files has been granted, running the following command in the init.rc:

exec u:r:custom_init:s0 root root -- /init.custom.sh

But as soon as the service has been started, it crashes with SIGNAL 6 (SIGABRT). I have analysed the patched sepolicy file and the only difference is in the mlsconstraints:

seinfo --constrain sepolicy_custom

For every mlsconstraint, there is an entry for init but custom_init is not added to the constraints automatically.

Is there a way to add a constraint with sepolicy-inject?

Update

Found a way to set a type attribute, used the fork of phhusson with additional commands: https://github.com/phhusson/sepolicy-inject

./sepolicy-inject -s custom_init -a mlstrustedsubject -P sepolicy

My custom_init source type is now listed in the constraints but my process will still be killed with SIGABRT...
[Android Software Development] Naveen Singh:
How to inject rules generated by audit2allow?

I got a bunch of selinux avc denied errors in my rom using logcat | grep avc. I've generated all the rules to be injected using audit2allow, just want to know how to inject all at once. I was able to patch using [MENTION=631273]Chainfire[/MENTION] supolicy but some of them failed like debuggerd.

I've attached the text in .te file generated.

Thanks in advance!
[Android Software Development] drolll:
Note that ndk16b is the last ndk which can be used to build the current version at the time of writing this post. In ndk17, armeabi was removed.
[Android Software Development] lyoks:
Anybody help me add service to sepolicy? I'am already enter changes in init.rc in ramdisk. But i got an error - init: service gxfpdaemon does not have a selinux domain defined.

service fingerprintd /system/bin/fingerprintd
class late_start
user system

service gxFpDaemon /system/bin/gxFpDaemon
class late_start
user root
group root system

service gx_fpcmd /system/bin/gx_fpcmd
class late_start
user root
group system
disabled

on property:sys.ftp.emode.test-start=1
start gx_fpcmd

on property:sys.ftp.emode.test-start=0
stop gx_fpcmd
[Android Software Development] lebigmac:
Hi thanks for this awesome tool (y)

I'm not very familiar with sepolicy-inject

Could you please tell me how to translate these avc errors into an ALLOW rule for bypassing that annoying "permission denied" message as shell user? Thanks! (y)

mount : type=1400 audit(0.0:645): avc: denied { dac_override } for capability=1 scontext=u:r:shell:s0 tcontext=u:r:shell:s0 tclass=capability permissive=0
mount : type=1400 audit(0.0:646): avc: denied { dac_read_search } for capability=2 scontext=u:r:shell:s0 tcontext=u:r:shell:s0 tclass=capability permissive=0
mount : type=1400 audit(0.0:647): avc: denied { mounton } for path="/system" dev="dm-0" ino=2 scontext=u:r:shell:s0 tcontext=u:object_r:system_file:s0 tclass=dir permissive=0
mount : type=1400 audit(0.0:648): avc: denied { read } for name="dm-0" dev="tmpfs" ino=20822 scontext=u:r:shell:s0 tcontext=u:object_r:dm_device:s0 tclass=blk_file permissive=0

cat : type=1400 audit(0.0:755): avc: denied { syslog } for capability=34 scontext=u:r:shell:s0 tcontext=u:r:shell:s0 tclass=capability2 permissive=0
cat : type=1400 audit(0.0:756): avc: denied { sys_admin } for capability=21 scontext=u:r:shell:s0 tcontext=u:r:shell:s0 tclass=capability permissive=0

ls : type=1400 audit(0.0:1130): avc: denied { dac_override } for capability=1 scontext=u:r:shell:s0 tcontext=u:r:shell:s0 tclass=capability permissive=0
ls : type=1400 audit(0.0:1131): avc: denied { dac_read_search } for capability=2 scontext=u:r:shell:s0 tcontext=u:r:shell:s0 tclass=capability permissive=0
[Android Software Development] gckim250:
Hmm.... This can be helpful...?

Android SELinux avc dennied permission problem solution - actorsfit

blog.actorsfit.com
[Android Software Development] quangnguyen7616:
I received an error message:

I execute the command:

Then check again with sesearch:

However, I still get the error warning. I think there's a problem with the tcontext having a value after it

Other cases without: c123, c256, c512, c768 can all be bypassed
[Galaxy Note GT-N7000 Q&A, Help & Troubleshooting] miwashi:
I ask this question because I have an unusual problem with mine.

I dropped my phone the other day. Now whenever I try to make outgoing calls, I cannot hear the other party at all, even at max volume. This leads me to believe that maybe the speaker got disconnected.

But when I watch youtube videos and use Line to call, I can hear just fine.

So I'm wondering if the problem is speaker-related or something else.
[Nexus 6 Q&A, Help & Troubleshooting] Mike_Larry:
I am thinking about trading my Note Edge in for a Nexus 6, played with one today at the store and I really liked it, the screen is amazing. But one thing about Lollipop turned me off big time and may be a deal breaker. The white background in the app drawer and settings, this is the ugliest thing ive ever seen, completely blocking the beautiful screen in the background. Looked in the settings on the display phone in the store and could not find anything to change it, please tell me their a way. Because if not, I will not use 5.0 til this is resolved!
[Nexus 6 Q&A, Help & Troubleshooting] El Daddy:
Use a launcher off the play store. There are dozens that allow you to customize all you want.
[Nexus 6 Q&A, Help & Troubleshooting] dparrothead1:
Nova Launcher will allow you to set transparency in your app drawer. You will have to run a custom ROM to get rid of the white settings.
[Nexus 6 Q&A, Help & Troubleshooting] Pilz:
The settings is black on LS ROM. And Nova launcher works great too for black backgrounds.
[Nexus 6 Q&A, Help & Troubleshooting] dparrothead1:
Oops.
[Nexus 6 Q&A, Help & Troubleshooting] Mike_Larry:
Thanks guys, I was worried.
[Galaxy S III Mini Q&A, Help & Troubleshooting] simon255:
Hi

I have a Galaxy S3 mini which I rooted and implemented link2SD which has worked flawlessly. I have about 300 apps in total with most of the bigger ones on the Link2SD partition.

The storage is getting a bit tight so I want to switch from a 16 gig to 32 gig SD card with the least amount of hassle maintaining the Link2SD data. Once that is done then expand the Link2SD partition say from 3 gig to 6 gig.

I'm sure many others have done similar in the past so if anyone could point me at a link with suitable instructions I would be grateful.

Thanks

Simon
[Galaxy Note 4 Accessories] Kevins89notch:
I got a 50% coupon for the official site a couple weeks ago, but everyone was out of stock. I've been checking daily. Things seem to be back in stock now. I just picked up the extra battery kit(battery plus a case/holder than charges it via a USB port). $45 retail, but after 50% off, but then shipping it was $27.90 to my door.

http://www.samsung.com/us/mobile/cell-phones-accessories/EB-KN910BWUSTA
[Galaxy S 5 Q&A, Help & Troubleshooting] kycr922:
So I'm kind of double posting from this: http://xdaforums.com/galaxy-s5/help/unlocked-mms3-att-help-t2953226

My S5 was originally AT&T, the phone has been unlocked and with a clean IMEI yet if I put a ATT Straight Talk sim inside, it gives the error MM#3. I've tried this with both active and non active SIMS. The Tmobile SIM seems to work, but don't have one with service. Using Tmobile here is not even an option, 0 service. Would flashing PDA.md5 with odin help? I'm not even sure with the PDA file does, just saw in another thread with 0 explanation afterwards. Any input here is greatly appreciated.

http://xdaforums.com/att-galaxy-s5/help/unlocked-s5att-sim-allowed-mm3-t2836424

Here's the link to the other thread.
[LG Optimus L90] trygor:
I have rooted my phone, unlock bootloader and my son is going to install OTA update. After that my phone only boot into TWRP. Please help me if someone can, i have try everything on this forum i have WINDOWS 8.1 and nothing is working for me, when flash tool try to do update nothing happend, it say that i try to reconnect the phone and again nothing.

Please help me because i'm desperate now and don't know what to do next.:crying::crying::crying::crying::crying::crying::crying::crying::crying::crying::crying:
[LG Optimus L90] trygor:
I have unbricked my phone following with this method:

On TWRP terminal command type this lines:

dd if=/dev/zero of=/dev/block/platform/msm_sdcc.1/by-name/fota

then hit enter

type

dd if=/dev/zero of=/dev/block/platform/msm_sdcc.1/by-name/misc

Then hit enter and reboot.

I hope that this will work for other guys with this kind of problems.. I'm not shure for d410 and d415 devices because i don't have them bu i thik it's worth to try..
[LG Optimus L90] aerdely:
"Edited" didn't realized some one posted a fix sorry but hope it works
[Fire TV Q&A, Help & Troubleshooting] droidkill3r:
I made a mistake somewhere and now I'm at the rbox boot screen and I can get to pick a kernal or anything,so my question, is there a alternative to get back to the main TV screen without a USB keyboard?
[Fire TV Q&A, Help & Troubleshooting] AFTVnews.com:
If, after the boot menu timer ends, you are not taken to the Fire TV home screen, then you're only option is to use a USB keyboard to select "Recovery" on the boot menu. Once in recovery, you should re-install the 51.1.4.1 pre-rooted ROM.
[Fire TV Q&A, Help & Troubleshooting] droidkill3r:
On thank you
[Fire TV Q&A, Help & Troubleshooting] Y314K:
From v34 of the Amazon FireTV Utility App BootMenu will be installed by a couple clicks of the mouse. But first you need to reflash PreRooted bueller-51.1.4.0_514006420-rooted+updated.zip to get rid of the bad BootMenu installation.

http://xdaforums.com/showpost.php?p=57598814&postcount=629

http://xdaforums.com/showpost.php?p=57604431&postcount=638
[Fire TV Q&A, Help & Troubleshooting] droidkill3r:
yes well I don't have cwm recovery , just stock.. I tried a factory reset but still get kicked into rbox boot menu
[Fire TV Q&A, Help & Troubleshooting] Y314K:
Requirement to install RBox's BootMenu:

Root with SuperSU & BusyBox.

Partially Unlock Bootloader.

Install latest Custom Recovery - v6.0.5.1.4a

Install PreRooted FW bueller-51.1.4.0_514006420-rooted+updated.zip

THEN YOU CAN START TO ATTEMP TO INSTALL RBOX's BOOTMENU. IF YOU ARE TRYING TO INSTALL IT WITHOUT THIS REQUIREMENTS. YOU ARE JUST GONNA BRICK YOUR FTV.
[Fire TV Q&A, Help & Troubleshooting] droidkill3r:
I did brick it, just try to unbrick it
[Fire TV Q&A, Help & Troubleshooting] Y314K:
To be able to help will need to know more about where you are at. Did you at least meet the first 2 requirements ? What Stock FW was your FTV @ when it begin to loop ??
[Fire TV Q&A, Help & Troubleshooting] droidkill3r:
I am rooted and installed supersu and partially unlock bootloader. use the firetv utility app. in rbox menu I click boot kernel and it just freezes. I can get to stock recovery to factory reset and can use the sideload option but vant connect pc to firetv via adb
[Fire TV Q&A, Help & Troubleshooting] Y314K:
Never encounter one that wouldn't ADB. Maybe [MENTION=3991724]rbox[/MENTION] will know the best way forward.
[Fire TV Q&A, Help & Troubleshooting] droidkill3r:
well I read once you factory reset you lose adb. so its looking like its gonna be a paper weight
[Nexus 7 (2013) Q&A] sark666:
I got a n 2013, moving from a n 2012. I never rooted the 12 but rooted the 13. Anyway, I'm using adb backup because it sounds like it's my only real option when not rooted.

I'm using adb backup -apk -shared -all -nosystem -f backup.bin

I read -system is for system apps but I haven't found a guide that is clear on what that actually means. Is it system apps only or system apps and data. Since I'm migrating to a new device I thought shouldn't use -system, but now that it's running, I'm thinking this backup won't contain chrome's bookmarks, or am I wrong?
[Nexus 7 (2013) Q&A] wantabe:
If you sign into your google account in Google Chrome (mobile app) it will sync your bookmarks to your account as long as you have the check box for Chrome checked in Settings/Accounts/Google on your device. If you then sign into the desktop version of Chrome then ALL of your bookmarks will be available on your device AND on the desktop version. Your mobile bookmarks and desktop bookmarks will be in different folders inside "Bookmarks." Chrome is not my main browser but it is still a nice feature having all of your desktop bookmarks available on your mobile devices and vice versa. ;)
[General Topics] sa thawut:
Adobe Reader Updater
[General Questions and Answers] PeLoOoN:
I request help to compile kernel with zte v791 and development roms and swap on this device i hope we can help to development with ZTE V791 you are a great developers with android.....

Thanks boys :o y hope you reply

The page is in Open Source Code ZTE
[Nexus Player General] Mercennarius:
Can someone on here that owns the Nexus player do me a favor and download the new Android TV Launcher APK and upload it so I can try this on my LG Google TV??

Just download the Chrome APK extension and then download the APK here:

https://play.google.com/store/apps/details?id=com.google.android.leanbacklauncher

Thanks!
[Nexus Player General] ndori:
Sure,

However the extension requires the android id of the device in order to work.

On phones you can grab it with the dialer app, but I have no idea how to grab it from the nexus player.
[Nexus Player General] bbb0487:
Here you go.
[Wear OS Q&A, Help & Troubleshooting] smugyou:
Alright guys, we have so many clock faces to pick from and I have a few favorite ones. The problem is is do not want to keep swapping them, and I alwasy favor one more then the other. We really need a randomizer, which will give the user an ability to set the change interval, from either 1.) every set amount of time, 2.) every time the screen turns on(for ambilent off users).

An advanced feature could be to pick which clock faces to put into the randomizer. Anyways, I am not a developer capable of such a feat, but I would pay more money then most app faces cost right now. I would help fund the development of it, ofcouse giving me the option to beta it ;)

Thanks
[Wear OS Q&A, Help & Troubleshooting] markus1965:
I have been using Wear Facelift from the Playstore, it lets you choose which faces you want to have randomised and how often. Worked very well under Kitkat, not optimized for Lollipop yet, but hopefully will be soon.

Hope that helps :)
[Wear OS Q&A, Help & Troubleshooting] lerouxh:
Thanks for the app. Works well so far!
[Wear OS Q&A, Help & Troubleshooting] Salvien:
Thanks for this app :3
[Nexus 7 Q&A, Help & Troubleshooting] Narwhal73:
Bumping because I'd like to fix my tablet at some point :$
[Nexus 7 Q&A, Help & Troubleshooting] twigster:
I'm on the same situation as you, but mine initially started after trying to install an f2fs lollipop ROM. I also think it's because of some sort of partition screwup.

My tablet won't let me install a bootloader, always saying invalid state. Luckily mine seems to still work on 4.23.

It let's me install the boot and recovery images every time,but it always fails at the system image.

What also happens when trying to flash the system image is that it will sit saying sending image for ages. Then eventually it fails with the errors of either too many links or unknown error.

Only once has it actually sent the image using jwr66v and got the tablet booting again, but it wouldn't update and kept giving errors, so I'm trying again to see if I can manually update to latest.

I was told to try using Linux instead of windows, which I'll attempt this weekend. I'll let you know if it works, but am not too optimistic.
[Nexus 7 Q&A, Help & Troubleshooting] twigster:
Got mine to work again, by just trying once again the terminal fastboot erase of all the partitions and then flash bootloader, reboot bootloader, then flash recovery, flash boot, flash system and finally flash userdata.

This is the same thing that wasn't working earlier but took on first try again after a break. So unfortunately I can't say I fixed it in a specific way, it just seems to be a case of persistence paid off.

Flashed the latest Google lollipop image.

Try to do the manual erase and flash again. Maybe it will take eventually like mine did.

Hope you come right.
[Nexus 7 Q&A, Help & Troubleshooting] ebtek220:
I had issues flashing factory images to my N7 yesterday too. At first I did the flash all script. It hung just like yours did at flashing the system image. I did it again with trying to flash everything manually and it still wouldn't work. Finally, I rebooted into fastboot and opened a new terminal window and everything worked as it should.
[Nexus 7 Q&A, Help & Troubleshooting] Narwhal73:
Persistence doesn't work as a solution for me. Trying with multiple machines, many different terminal instances, and several attempts with each has lead to no results. I'm thinking that for some reason the partition scheme might be broken, though of course it could be something else :rolleyes:. Anyone know how I can go about diagnosing the issue properly, or repartitioning this thing? I don't even care about the Google images anymore, as long as I can get a functional OS back on it.

Currently the Nexus 7 is sitting with bootloader version 4.18, and no other functional images flashed to it. I can't seem to get the official bootloader version 4.23

to flash.

(Sorry for letting the thread die, I was away on vacation)