yashsingh1/xdaforums huggingface dataset:
[General Topics] Ibuprophen:
[MENTION=5956519]Jman420[/MENTION], you do have the gist of this... But I I'll try my best to explain it a bit more... User Friendly :)

Apart from a typical kernel modification, the actual SELinux (Security-Enhanced Linux) tools/policies are all located in one file "/sepolicy". That file, simply, contains the instructions for the actual control mechanisms typically located in the "/sys/fs/selinux/" directory.

Obtaining/Gaining proper Root within the device doesn't mean that your granted Root control in one of the devices features within the, commonly referred to as, MAC (Mandatory Access Control) system.

Individuals often confuse the devices Root access with certain, higher privileged roles, that are assigned to the devices Security-Enhanced Linux. The individual with a Rooted device typically confuses the two separate device privileges and should keep in mind that an Android does have multiple device privileges.

But that does mean that restricting root access to a folder means that some additional countermeasures need to be implemented. It just means that those separate policies are typically determined by way of the devices "Kernel" that outlines the users ability to make modifications to the devices "Security-Enhanced Linux" (aka SELinux).

The following URL does explain this in a great way:

Security-Enhanced Linux in Android

Though, you should keep in mind, that the above URL is a start but, if you do a little searching on the Internet, you should be able to locate other websites that explains the SELinux (Security-Enhanced Linux) in different ways that may be in more of a "layman's terms" that is better understood for some non-technical or less-technical minds.

"Live Long and Prosper..."

~Ambassador S'chn T'gai Spock

Sent via Communicator [D2VZW] from the Bridge of the U.S.S. Enterprise
[General Topics] Krzysieq:
I know this is an old thread, but the question came to me after I installed a custom rom on my device. I was using AospExtended based on Nougat up to yesterday, now I installed a build based on Oreo. The prior versions I was using were always running in SELinux enforcing mode, which suits me because I don't really want to root my device or compromise it's security in any way (as if installing a custom ROM wasn't compromising it enough already). To my surprise, the latest ROM I flashed runs in SELinux permissive, but I installed the first off the bat application to check for root, and my device is reported as not rooted. But it still runs permissive, so I'm confused. What does that mean for me? The way I understand this discussion, having root and SELinux restrictive would still confine root access to some constraints, whereas with SELinux permissive, a malicious piece of software could theoretically do whatever it pleases. Correct?
[General Topics] Jman420:
Ah, so someone finally falls into the 'Stock & Permissive' category that I didn't cover in the OP.

First, to answer your easy question... Correct, having SELinux enforcing with root would require a malicious app to first obtain root access and then inject necessary SELinux permissions to obtain full device control (or whatever parts it wanted). With SELinux permissive and root the malicious app would probably only need to obtain root access for full device control (and possibly not even that, depending on what it wants to do).

Now... for your SELinux permissive without root situation... to be honest I'm not really sure... You are definitely at higher risk than someone with SELinux enforcing without root, but there (in theory) isn't an SELinux context to serve root access. To obtain full device control a malicious app would need to root your device, which may not be very difficult considering that SELinux is not enforcing any permissions. For partial control... a malicious app may not need to do much of anything other than be installed, again because SELinux isn't enforcing anything. I think in this context it would really depend on what the malicious app is trying to do... if it is stuff that an app can normally do, but it hasn't asked for the permissions then it may be still able to that stuff. But if its an activity that requires root access it would still fail since no root app or context exists. (Need to point out that all of this is just theory... I haven't done any real research or put hard thought into this scenario.)
[General Topics] Krzysieq:
I'm happy to be the first to fall into that hole ;) although I'm pretty sure I'm not the only person using this particular ROM as it currently is. I know the dev is working hard to clear up the policy so that he can turn SELinux back into enforcing, but he probably still has a way to go. Till that happens I'm probably not going to install any sensitive stuff on my phone just as a precaution. It would be really interesting to hear some expert opinions on the matter. Or maybe - in the spirit of true science - there's an experiment I could conduct on my phone to see how compromised it's security is?
[General Topics] Jman420:
Indeed, I agree. Although I am a security professional, I would hardly consider myself a Linux or SELinux expert. I'm sure there are experiments that can be run to determine the level of exposure that Stock Permissive would give... but none that I know of off-hand. Unfortunately I am incredibly busy at work for the next couple of months and likely won't have time to research or investigate.
[General Topics] Krzysieq:
Perhaps this is slightly off topic, but only just... Does anyone know what is the current problem behind getting custom roms based on Oreo to use SELinux in restrictive mode? I have Xiaomi Mi Max, my Mrs has a Mi 6, and for neither of these does an Oreo-based ROM exist with SELinux in restrictive mode.
[General Topics] Ibuprophen:
I understand your question but, the "restrictive" mode your referring to is called "Enforcing" Mode that is the default SELinux State for all Custom Firmwares.

There's only 2 options for a devices "SELinux State"... "Permissive Mode" and "Enforcing Mode".

By default, a device will be restricted to Enforcing Mode and can only be changed by using a Custom Kernel and, in some Custom Firmwares, this is inclusive.

I hope that I had explained this and answered your question okay via text... :)

~~~~~~~~~~~~~~~

I DO NOT provide support via PM unless asked/requested by myself. PLEASE keep it in the threads where everyone can share.
[General Topics] Jman420:
I've seen some other questions related to this. Unfortunately I don't have an Oreo compatible device right now, so I haven't done any investigation into it. If memory serves the SELinux Enforcing mode is set by a config value at compile time, but for some reason there have been reports that setting that flag in Oreo causes boot issues.

If I had to guess I would say that more likely than not the custom ROM has been modified in such a way that it is violating the SELinux Policy that is being enforced, which is causing a fatal error on boot. But that's just me speculating based on the tiny amount of information I have regarding the issue.

Not really a discussion for this thread though... and I can't provide much help since I don't have an Oreo device.
[General Topics] Ya_SG:
Conclusion after I read all these: Don't install a malicious app
[General Topics] Anubhav997:
So from what I understand. Say you are rooted + enforcing or rooted + permissive. It won't matter much cause once someone has gained root access getting around enforcing linux is just a matter of changing the required selinux policies which he/she can easily do given they have root.

So if I am rooted enforcing will just give me some extra "buffer" in terms of security. Right?
[General Topics] Jman420:
Even when rooted I would recommend having SELinux set to Enforcing. The tools needed to modify the selinux policy will be present on the device, but hopefully be appropriately protected so that only root apps can access them. If you set SELinux to Permissive while rooted then any apps can likely access the tools to modify selinux policy; not that they need to, but would be a good idea in order to ensure persisted infection.

So TL;DR - Yes, rooted + enforcing raises the sophistication needed to execute a successful attack by needing to convince the User to grant the malicious app root access. How much sophistication is needed is likely up for debate... and different for different users...
[General Topics] Oanh Nguyễn:
Các bác sĩ cho biết thêm:
[General Topics] FivEawE:
Hello. I have been wondering how permissive SELinux can be exploited. A lot of custom ROMs are shipping like that, and I would like to switch to one of them since the stock one sucks. If I don't use apps outside of Play store (even then only a couple of them like Messenger) and I only need Magisk for ad blocking, am I really at risk? I am mostly worried about keyloggers and data theft. Thanks.
[General Topics] Jman420:
It all really depends on you and your usage habits. SELinux prevents Apps from accessing portions of the system which it has not explicitly described as part of its normal function. Using Apps that come from the Play Store will help combat some of the risk of disabling SELinux, but you are still at risk of those legitimate Apps being exploited in some way (ie. a website you visit with your Browser App is able to identify that you are on a mobile device and sends malicious packets which exploit the Browser to have it take actions which you have not approved, or an SMS app is exploited in a similar way).

Although the cyber criminals are becoming more and more sophisticated in their attacks, it is still a cost vs reward game that they play. If you are a usual, run-of-the-mill, non-executive or government person then the chances of SELinux attacks being used against you is pretty slim... but your value to criminals can change overnight, so I try to keep myself prepared for any situation.
[General Topics] Jman420:
I was just thinking about this a bit more and another point which may not be obvious came to mind.

Using official apps from the Play Store while having SELinux disabled could give a false sense of security. I believe that SELinux is a requirement for official ROMs approved by Google. Since the expectation is that SELinux will be enforcing on any devices running Play Store Apps any vulnerabilities which are fixed by SELinux will probably be ignored during development and review processes. Which means that you could be exposing yourself to exploitation even if you use only official apps...

So I may have overstated when I said that using Apps from the Play Store would reduce risk of exploitation... Really the best advice I can give is to keep SELinux set to Enforcing.
[General Topics] zogoibi:
Excelent discussion, even for a layman. Thank you guys.
[Nexus 6 Q&A, Help & Troubleshooting] BRMX7:
My nexus device only turns on when is connected to the charger, it shuts off whenever not plugged in.

Some weeks ago i noticed my nexus was randomnly shutting down at 15-21% battery then it got worse now at 55-60% of battery, one week later it came at the point that at 90% of battery shut down and have to charge it again and finally now it shuts off whenever not plugged in. I read in many forums about similar problems and tried a few "solutions" like Entering in bootloader then bootloader logs pressing 10 seconds the power button after this process this should reset the battery statistics and boot the phone but it didn't work, Factory reset, calibrating the battery and others but no one of this worked. What could be the problem?

Also in the bootloader it shows a message that indicates the state of the battery is OK
[Nexus 6 Q&A, Help & Troubleshooting] Dugaldrob:
Your battery is shot
[Nexus 6 Q&A, Help & Troubleshooting] mesco38:
Battery looks dead, yup

You can find new ones on ebay for 30$~ (maybe even less) and start a brand new life :D
[Nexus 6 Q&A, Help & Troubleshooting] HueyT:
Don't buy cheap Chinese battery as 1) too much work to change battery, 2) swollen battery can break your Nexus 6, 3) cheap battery may only last 1-2 months before swelling
[Nexus 6 Q&A, Help & Troubleshooting] BRMX7:
[UPDATE] I buyed a original Nexus 6 battery and replaced it with the old one, all seems to be okay, it solved the problem, but i have to test it to give a final answer i Will come back after a few months to let all the comunity and further viewers to know what happened
[Android Q&A, Help & Troubleshooting] duminhtai90:
Hi everyone, I am very new to android development, and I am looking for a chance to join in an android project so that I can gain more experience. I made some website with asp.net, php, and some apps with c#. Could anyone tell me how to get in a project that good for newbie.

thank you.
[Android Q&A, Help & Troubleshooting] xanthrax:
Here is what you need

https://xdaforums.com/chef-central/android/guide-android-rom-development-t2814763

Good luck !
[HTC Desire 530 Questions & Answers] MR_Owl:
So I managed to successfully root my HTC 530 but I'm not exactly sure with what software....don't ask

Anyway here is some info about it hopefully someone has some answers.

PS I would love some links to some ROMS y'all dig.

Thanks in advance

~Owl
[HTC Desire 530 Questions & Answers] AndroidSamurai:
Ok,

Follow the instructions and download TWRP from HERE which is a more organized thread for the TWRP by Captain Throwback(awesome guy). Once TWRP is installed you can flash SuperSU and you'll have root.. That easy buddy.

There are no custom ROMs for the Desire 530 yet as I happen to be the only one developing one. Search/Browse around the Desire 530 forums here at XDA and you'll find all this information for yourself.

Also, if you read the OP for my SlimDesire thread you'll find a link to the SlimDesire Development Group on Google Hangouts which currently has over 15 members.

*Updated* join The SlimDesire Project on Hangouts by clicking HERE
[Fairphone 2] chrmhoffmann:
Code is here:

https://github.com/chrmhoffmann/android_device_fairphone_FP2

https://github.com/chrmhoffmann/android_kernel_fairphone_msm8974

https://github.com/chrmhoffmann/proprietary_vendor_fairphone

Will upload a flashable zip soon.

Please remember: this is a wip and not an official lineage bringup. The source code does not fullfil lineage code quality as of now:

- CVEs are missing

- SELinux is switched off

- Code is garbage.

Chris
[Fairphone 2] chrmhoffmann:
Upload

Try this:

https://www.androidfilehost.com/?fid=817550096634770220

What is not working:

- Device encryption. Don't try it.
[Fairphone 2] CheckItOut:
Good job, running this now on my FP2.
[Fairphone 2] Tech180:
The link is broken...
[Fairphone 2] CheckItOut:
Active development is done here: https://forum.fairphone.com/t/porting-lineageos-to-fp2/27530

Check there for the most recent version. And if you want OTA updates, check: https://forum.fairphone.com/t/lineageos-14-1-with-ota-updates-for-fp2/29441
[Samsung Galaxy S8 Questions and Answers] AT&Tsucks:
The pixel launcher crashing any help will be appreciated.
[Samsung Galaxy S8 Questions and Answers] svonavja:
What version do you have?

---------- Post added at 07:39 AM ---------- Previous post was at 07:37 AM ----------

You need this one with Galaxy phones.

Pixel Launcher

Version O-3743572
[Samsung Galaxy S8 Questions and Answers] AT&Tsucks:
I recently downloaded that version and it still crashes
[Asus ZenWatch 2] tedlin:
Today's WSJ said ASUS will be terminating Zenwatch Android Wear product.

Hope we can still get the official Wear 2
[Asus ZenWatch 2] dharvey4651:
Where did you get your information?
[Asus ZenWatch 2] Spanky':
Just google it.. I just read about this myself and came here to see if there was any discusion going... :( does this mean we wont see android wear 2.0? :(
[Asus ZenWatch 2] Gfhoihoi72:
I saw the news articles too. Asus here in Europe was surprised about the news and didn't know anything about it. They said it was going just fine with the Zenwatch Sales. So I don't know how true this news is, and I think the update still will come soon. And Google makes the updates, not Asus like everyone thinks apperantly.
[Asus ZenWatch 2] Lare2:
My concern is who inside that company will oversee the release of aw 2.0 for existing products.
[Asus ZenWatch 2] Electronicbrain:
I assume that someone will oversee the release of AW 2.0. My concern is that what happens when I want AW 2.1 and so on. I bought this watch last year knowing that my Gear Live would not get the 2.0 update, but I hope that my Zenwatch does not follow the same path of not getting the 2.1 or 3.0 (and so on) update when it is announced and released.
[Asus ZenWatch 2] gumbyx84:
It is not confirmed that they will discontinue the line. Article at Android Police (http://www.androidpolice.com/2017/05/15/asus-reportedly-done-android-wear-zenwatch-line/) and the original article/post by Digitimes (http://www.digitimes.com/news/a20170515PD202.html) say "reportedly" and "likely". The report comes from "sources of Taiwan's supply chain" which is not a direct source. Don't raise a panic just yet.
[Asus ZenWatch 2] Electronicbrain:
I hope not. The zenwatch line is great for people who want a cheap, good quality smartwatch.
[Asus ZenWatch 2] jshamlet:
Yeah, for a no-frills "gets it done and still looks nice" watch, the ZW2 was hard to beat. I'm tempted to get a second one as a backup even if they aren't discontinued. That said, it would be nice to get to at least AW 2.0.
[Asus ZenWatch 2] Electronicbrain:
Agreed. I do think it would benefit from a rotating crown, but other than that, it's pretty much the perfect. I don't need a heart rate sensor or 4G, and I prefer the square form factor anyways. If they do discontinue the Zenwatch line, I hope someone jumps in.
[Asus ZenWatch 2] TheLoonyRebel:
AW 2.0 is now being pushed out for the ZenWatch 3. We should have it soon. Hopefully once we get the kernel source that will make it easier to maintain and make our own ROMs.
[Asus ZenWatch 2] Spanky':
I hope we get it soon.. Had a little taste of it and it was really nice! And ya it would be nice espetiallylooking twards the future if asus does drop it.. Than hopefull the awsome devs here can keep us going for awhile :)
[Asus ZenWatch 2] Gfhoihoi72:
Google still have some "final bugs" to solve for the ZW2... We'll have to wait a bit more, yay :(

Source: https://twitter.com/ASUSUK/status/864492209919361025 (scroll down a bit)
[Asus ZenWatch 2] TheLoonyRebel:
It's okay I can wait a bit longer. It's just a freaking software update not a cure for cancer. We will all manage to live without AW 2.0 on our watches for a bit longer while they fix whatever bugs there is to be fixed.
[Asus ZenWatch 2] internetpilot:
Wait...AW 2.0 doesn't cure cancer??? But I thought...DARN IT! :D
[G 2014 Q&A, Help & Troubleshooting] BlueSn00w:
Hi i cant find a TWRP Flashable stock image for the Moto G XT1064.

i got a unlock code but my rom wont work with it :P

Thanks!
[G 2014 Q&A, Help & Troubleshooting] avrockz11:
You could try this one, but it hasn't​ been tested on XT1064..So do it @ your own risk

https://xdaforums.com/moto-g-2014/general/moto-g-indian-xt1068-marshmellow-6-0-t3313148
[G 2014 Q&A, Help & Troubleshooting] BlueSn00w:
Wont work i need the stock rom to unlock this wont work. I need someone to make a backup of there stock rom for my device or make a flashable zip. Thanks for trying tho :)
[G 2014 Q&A, Help & Troubleshooting] BlueSn00w:
Actualy flashed it and now it seems to work going to try my unlock code soon..
[Samsung Galaxy S8 Questions and Answers] TheIcE65:
I would normally buy a case because it is safer and this phone is so damn expensive (it had been a long time since I had purchased a phone and I did not know prices were that high)... But the device is so mind-blowingly gorgeous that I'm considering a skin. I rarely drop my phone but, in the eventuality (it will happen) that I drop it, will a skin protect it? From what kind of falls? And if I end up buying one, which company should I turn to (obviously I heard of dbrand but I don't know about the alternatives)? Also if you think I should get a case, which one would you recommend that still lets me appreciate the aesthetics of the phone?

Thank your for your time.
[Samsung Galaxy S8 Questions and Answers] peachpuff:
A skin will protect it against scratches but that's about it, there's plenty of thin clear cases on ebay that will give you some protection.
[Samsung Galaxy S8 Questions and Answers] meshaun:
I'm also wondering if I should buy a case or not.

Didn't Samsung advertise that the front screen and back screen are Gorilla Glass 5? This means they are scratch-proof yes?

The phone is absolutely gorgeous and using a case / cover makes the look a bit dull. I have been using the phone without cover for a few weeks now and thankfully, no scratches so far. I hope I can keep it the same way.

What is your idea guys?
[Samsung Galaxy S8 Questions and Answers] andresg97:
definitely a case, im getting the tough armor myself . I already shattered the back panel :silly:
[Samsung Galaxy S8 Questions and Answers] Nurmi_CEO:
Yes Gorilla glass 5. Scratch proof? NO!!!

I like to think I was babying my phone. I had it in my pocket tried to avoid having keys in with pocket ect while I figure out case/skin situation. I am already noticing very fine scratches on the front and back. Not too bad at all, but if you look you can see them, and I do know they are there.

I am contemplating insurance for the phone because if the glass cracks that would totally blow. But I don't want a fat case because the phone is pushing the size limit for me. I will most likely go with ultra slim case and Whitestone glass protector.

Bottom line, get SOMETHING for it asap. You would think it would be tougher when it comes to simple scratches, but not so much. I've had mine since launch.
[Samsung Galaxy S8 Questions and Answers] Tiges:
I will recommend you the case I have got. It's clear slim case from aicek https://www.amazon.co.uk/gp/aw/d/B0...=DMN9FAPAZX942JJGC4VS&dpPl=1&dpID=61itnhJDTBL

Like it a lot. Gives proper protection to the screen and edges but it's slim and s8 looks great in it.
[Samsung Galaxy S8 Questions and Answers] pakitos:
I bought a Spigen Case Thin Fit for a S7 Edge that I had for a day. When I bought the S8 I went looking for the same case and I totally love it!
[Samsung Galaxy S8 Questions and Answers] MarkerBeanXDA:
Just get the Elago Origin Case for Galaxy S8 in amazon. It's as thin as paper or phone skins (0.35mm) and you can easily remove / put it back whenever you want. It's having the protection you need but not sacrificing the design and feel of the phone which is why you've bought it in the first place.
[Samsung Galaxy S8 Questions and Answers] Deleted member 2870764:
I got a slight scratch within two days of owning it. I never put it with my keys and always in my pocket. I know many others are saying they've already received scratches so no, the screen is far from scratch resistant.
[Samsung Galaxy S8 Questions and Answers] teegunn:
It doesn't make sense to not use a case. Glass front and back, one drop could be all it takes. In fact, one drop on concrete or a hard surface will leave damage. With a slim TPU case 99% of the time there won't be any damage in the same instance.

As far as the display, I normally use tempered screen protectors, but those don't really work with the curved edges. Better off to get some kind of wrap-around wet application protector for the display. One can use an S8 tablet wet-fit protector and cut it to fit the length of the phone wrapping it around the back on both sides, or there is one being made that actually wraps over the curved edges adhering to the back of the phone that looks good too. Going naked on the display WILL end up with scratches of some kind at some point. Really depends on how you are using your phone. But even the most careful will still accumulate some damage, that's just how it works in the real world. These devices were not built to last decades.