Tried modifying contents of a dev file in root condition, yet failed! - General Questions and Answers

Hello guys, iam trying to control the brightness of camera LED in my Letv Le X509 phone (Android 6 Marshmellow version), and it is rooted. I used adb shell to interact with my device in "su"(root) mode. within the sys/class/leds folder there is no led_torch folder, only the folders blue,green,red which are notifcation leds folders . I tried searching for the led_torch folder and i only got a flashlightdrv folder, so thought this must be it, but within it these are the contents,
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
no brightness file found where i can modify the brightness level, i tried modifying the dev file and this is the result i got! permission denied, when iam accessing as root
What am i missing? My ultimate aim is to write a pwm script to control the torch_led, plzz help me if you can and help me figure out what is that stuff that is blocking me out

you forgot the android framework. whatever you are trying to do on linux runtime kernel parameters - android can do, too. android is on top of linux, so it will override you sooner or later.
regarding permissions, you're learning it the hard way like me... uid 0 (root) doesn't mean you have actually root access. android kitkat introduced (NSA) SELinux which was enforced with lollipop. besides this android uses fancy stuff like separated mount namespaces and launches every app with its own uid in a sandboxed virtual machine forked from zygote.
so if you're going to mess with permissions you have to do it from own init.rc service and exec with proper seclabel (u:r:magisk:s0, u:r:supersu:s0 or whatever)
https://forum.xda-developers.com/t/dev-guide-2016-12-22-how-to-su.1962550

Oh , weird! iam just a novice in this android field , iam just using it for a project to blink my smartphone LED at a particular frequency(using android studio), problem is above 40 Hz is not achievable, so my requirement is to access the torchLED driver through Kernel and control it so that i can achieve a higher frequency and i need to root to access that.
The Weird thing is root checker indicated me that the root is properly installed on this device and i was able to control the notification LEDs like green , blue and red(under sys/class/leds) properly through my so called "root" access. Iam just taken aback why iam not able to modify that kernel file..
I will go through your posted link and find some way to get through it! Thanks !

Oh i think i get it, the SE Linux is acting as the security layer that is preventing my root to modify the contents of the driver file of torchLED, but iam suprised on why it did allow me to modify the contents of notification leds? (under sys/class/leds)

look for avc denied in dmesg/logcat
https://gist.github.com/msfjarvis/sepolicy.md

Will do ! Thanks!

you can shortcut if kernel allows permissive
Code:
setenforce 0
getenforce
there is also an app for (v11 on github.com)
[APP][Root][4.2+]SELinuxModeChanger v10.0 :: [24.07.2017]
Now opensourced under gplv3! GITHUB Get it in f-droid F-DROID page (v10 probably won't be there until release of stable gradle 4.0 and buildtools 26) Now available on the XDA Labs! XDA Labs page (UPD: somebody released a fork without changing...
forum.xda-developers.com

Related

[APP] SuperSU v2.65 Final Stable

SuperSU v2.65 Final Stable
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
SUuperSU Pro
SuperSU is the Superuser access management tool of the future!
SuperSU allows for advanced management of Superuser access rights for all the apps on your device that need root.
SuperSU has been built from the ground up to counter a number of problems with other Superuser access management tools.
!!! SuperSU requires a rooted device !!!
Features
Superuser access prompt
Superuser access logging
Superuser access notifications
Per-app notification configuration
Temporary unroot
Deep process detection (no more unknowns)Works in recovery (no more segfaulting)Works when Android isn’t properly booted
Works with non-standard shell locations
Always runs in ghost mode
Wake on prompt
Convert to /system app
Complete unroot
Backup script to survive CyanogenMod nightlies
Icon selectable from 5 options + invisibleTheme selectable from 4 optionsLaunch from dialer: *#*#1234#*#* or *#*#7873778#*#* (*#*#SUPERSU#*#*)
NOTE:*Not all phones take both codes. On some phones you need to use single *# instead of double *#*#
Pro version Features
OTA survival mode (no guarantees)
Full color-coded command content logging (input/output/error)
Per-app logging configuration
Per-app user overrideGrant/deny root to an app for a set amount of time
PIN protection
Per-app PIN protection
Adjust auto-deny countdown
What’s New
(systemless): Add deep sleep fix for Samsung 5.1+
supolicy: Adjust Samsung 6.0 init shellZIP: Patch recovery SELinux policyZIP: Improve su.img mounting
How to install*?
Download the archive from the link given below
Install both the apks provided in the archive
Open the app and update the su binary
Enjoy*
DOWNLOAD LINK (in First Comment Box)
Sent from my Honor using Tapatalk
[emoji15] DOWNLOAD LINK [emoji15]
mod edit
Sent from my Honor using Tapatalk
lets use the real thread for this app
http://forum.xda-developers.com/showthread.php?t=1538053
thread closed

[TIP] - Make *ViPER4Android* Work on *ANY* Marshmallow Device EASILY !!

Make ViPER4Android work on any marshmallow device : SELinux Permissive Fix
This is the easiest method I found so far, to make Viper4Android work on my V10 H960A running MM
Thanks to Sidharth Pk Here’s how you can install ViPER4Android on your Android phone running on Marshmallow or above. Change the SELinux policy from Enforcing to Permissive and enable ViPER4Android on your device. Also, fix the common errors while installing V4A like abnormal driver status, no processing etc.
I will copy/paste here his short instructions and for further details I will post a link to his page at the end of this post
Change SELinux to Permissive & Make ViPER4Android Work on any Marshmallow Device (By Sidharth Pk) :
ViPER4Android itself needs root access. So there’s no point of saying that your device must have root privileges.
.
Get ViPER4Android’s latest APK from here and install it on your Marshmallow device.
.
Now open it and let it install the driver for your device.
.
Once you get the install complete message, simply reboot the phone.
.
After bootup, Install Terminal Emulator App from here and install it on your phone.
.
Open it and perform the following commands one after one
Click to expand...
Click to collapse
Code:
[COLOR="Navy"][SIZE="4"][SIZE="5"]su
setenforce[/SIZE][/SIZE][/COLOR]
Close the terminal and check the driver status on ViPER4Android app, it should display like this:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
The Enable & Processing status will automatically change to Yes once you activate the master power option and start playing music on your headphone/speaker. If this method doesn’t work for you, you can flash the ViPER4Android Marshmallow ZIP file. It changes the SELinux from Enforcing to Permissive.
For more info have a look at the original thread/page:
http://www.techbii.com/install-viper4android-marshmallow/
Enjoy !
We can discuss here afterwards, why install Viper4Android in a phone with already such a great sound out of the box, such as the LG V10...
Cheers
.
.
Reserved

[TIP] - Make *ViPER4Android* Work on *ANY* Marshmallow Device EASILY !!

FIRST OF ALL :
For rooted devices, busybox properly installed , etc. etc.!
Works on MM, should work on Nougat to...
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Make ViPER4Android work on any marshmallow device : SELinux Permissive Fix
This is the easiest method I found so far, to make Viper4Android work on my V10 H960A running MM
Thanks to Sidharth Pk Here’s how you can install ViPER4Android on your Android phone running on Marshmallow or above. Change the SELinux policy from Enforcing to Permissive and enable ViPER4Android on your device. Also, fix the common errors while installing V4A like abnormal driver status, no processing etc.
I will copy/paste here his short instructions and for further details I will post a link to his page at the end of this post
Change SELinux to Permissive & Make ViPER4Android Work on any Marshmallow Device (By Sidharth Pk) :
ViPER4Android itself needs root access. So there’s no point of saying that your device must have root privileges.
.
Get ViPER4Android’s latest APK from here and install it on your Marshmallow device.
.
Now open it and let it install the driver for your device.
.
Once you get the install complete message, simply reboot the phone.
.
After bootup, Install Terminal Emulator App from here and install it on your phone.
.
Open it and perform the following commands one after one
Click to expand...
Click to collapse
Code:
[COLOR="Navy"][SIZE="4"][SIZE="5"]su
setenforce[/SIZE][/SIZE][/COLOR]
Close the terminal and check the driver status on ViPER4Android app, it should display like this:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
The Enable & Processing status will automatically change to Yes once you activate the master power option and start playing music on your headphone/speaker. If this method doesn’t work for you, you can flash the ViPER4Android Marshmallow ZIP file. It changes the SELinux from Enforcing to Permissive.
For more info have a look at the original thread/page:
http://www.techbii.com/install-viper4android-marshmallow/
Cheers
Didn't work for me.
didn't worked for me either !!

[TOOL][ADB]][Windows] A 100% Safe Non-systemless Root Tool - No Soft-bricked Adroid Guaranteed

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Grant Root Privileges to Regular Users Using Devices With Android 6 and up by Simply Upgrading Android's Multi-command Applet Toybox.
Preface:
THIS TOOL MAKES USE OF ADB COMMANDS, SO IF YOU DO NOT HAVE USB DEBUGGING TURNED ON AND ADB IS NOT INSTALLED ON YOUR WINDOWS COMPUTER, THEN IT WILL NOT BE OF ANY USE.
What does it do?
THIS TOOL MODIFIES ANDROID'S MULTI-COMMAND APPLET TOYBOX BY REPLACING IT BY ITS FULL VERSION - MEANS BY ITS VERSION THAT HAS SU COMMAND INCORPORATED.
Screenshot:
Download:
Usage:
Unpack the downloaded ZIP to any location on your Windows computer, run the script named Toybox-Updater.bat located therein.
Disclaimer:
This program is offered AS IS.
I do not warrant the functions in the program will meet your requirements or that the operation of the program will be uninterrupted or error-free.
In no event I am liable to you for any damages, including any lost data or other incidental or consequential damage.
Please don’t hesitate to report here any issues you may have with this tool! Thanks & enjoy!
In Linux, what Android is based on, the su (read: switch user) command is used to run a command as a different user, means the su command is used to run an OS function as a different user. It is the easiest way to switch or change to the administrative account in the current logged in session.
So using su to temporarily act as a root user - a root account is a master administrator account with full access and permissions in the system - allows you to bypass any default user-restrictions and perform different tasks with full permissions.
Because most Android versions by defaut use limited user accounts for normal use - making the system more secure - what restricts the user from running specific OS commands, the tool provided herewith adds su command to Android, what allows the currently logged in user to temporarily act as a root user - take note that a root account is a master administrator account with full access and permissions in the system.
su Command Syntax
To use the su command, enter it into a Windows command-line as follows:
Code:
adb shell "toybox su -c '[options] [username [arguments]]'"
Take note that if [username] is omitted su defaults to the superuser (in Linux term: root).
Hi, I came across this from another post where the user was trying to get su in his a022f. I have the same device and would like to achieve the same result. Unfortunately, I can't seem to find the zip file (there's no link to dl), or is it still being worked on, hence the absence of a link?

FX file Explorer - How to make a file write accessible?

I'm Rooted and using Androids FX file Explorer, to try to add a ring tone to the ringtones system folder.
/system/media/audio/ringtones
Would someone explain how to make the file write accessable or direct me to a link to how to do this?
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I searched but all I could find were links how to do it through a command promt, which is not what I'm looking for.
Android 13
galaxy A22 plus
Rooted with Majiks systemless-ly activated
20GT said:
I'm using Androids FX file Explorer, to try to add a ring tone to the ringtones system folder.
/system/media/audio/ringtones
Would someone explain how to make the file write accessable or direct me to a link to how to do this?
View attachment 5836745
I searched but all I could find were links how to do it through a command promt, which is not what I'm looking for.
Android 13
galaxy A22 plus
Click to expand...
Click to collapse
after android 8 (in preparation for project Treble), system partition is mounted during boot as read-only by default (as you can find out through the partition's mount flags). so there's 2 ways to achieve what you want:
you remove the shared_block feature from Super.img and mount system as R/W. There are tools to do this, but they're not tested on Samsung devices. Like this Tool.
you root your phone with Magisk and make a Magisk module to add your files systemless-ly. Here is the Developer Guide.
Of course, You would need an unlocked Bootloader. Here is the guide for Unlocking and Rooting. I also advise you to flash TWRP before experimenting with the Module you create. Good luck.
Slim K said:
after android 8 (in preparation for project Treble), system partition is mounted during boot as read-only by default (as you can find out through the partition's mount flags). so there's 2 ways to achieve what you want:
you remove the shared_block feature from Super.img and mount system as R/W. There are tools to do this, but they're not tested on Samsung devices. Like this Tool.
you root your phone with Magisk and make a Magisk module to add your files systemless-ly. Here is the Developer Guide.
Of course, You would need an unlocked Bootloader. Here is the guide for Unlocking and Rooting. I also advise you to flash TWRP before experimenting with the Module you create. Good luck.
Click to expand...
Click to collapse
Sorry I forgot to mention that I'm already Rooted with systemless-ly already activated.
Just tested Fx file explorer on my privious phone and it works correctly after mounting the folder.
I passed the root check. is there a diffent option/checkmark to allow Fx access to root or give Fx pemisions in majiks on android 13?

Categories

Resources