android


How to edit /sys/ in Android?


Is there any way to edit /sys/ folder in Android. I've tried these:
Granted root permission to ES File Explorer and edited a file in /sys/. R/W permission is enabled in ES file explorer.
With a terminal emulator, tried this:
su
chmod 777 /sys/filename
After that I edited the file, but the two methods do not seem to be working.
Is there any method where I can go in the kernel and edit those files in /sys/?
Android Debug Bridge (adb) is a versatile command-line tool which you can use to communicate with a device (an emulator or a connected Android device).
adb over network
adb connect <IP Address>:5555
adb devices //To Confirm host computer is connected to the target device)
adb devices -l //Query for devices
adb remount //Remount the partitions /system, /vendor in read-write mode
adb shell //To debug the kernel through adb
adb over serial:
adb devices
adb devices -l
adb remount
adb shell
In case adb connection lost then you can try by resetting the adb host through adb kill-server and then run the above commands.
EDIT:
Permission of sysfs is defined in kernel space so you can not directly create the files or directory in /sys folder from the user space. If you want to create/modify the directory/file then I think you can achieve it through kernel module. There are loads of helper function that can be used to create the file attributes and directory inside /sys.
I belive already your driver will be using those helper function (something like sysfs_create_group or kobject_create_and_add). For changing the file permission and data read/write check your driver __ATTR and show/store function.
It should be something like
static ssize_t fo_show(struct kobject *kobj, struct kobj_attribute
*attr,char *buf){
}
static ssize_t fo_store(struct kobject *kobj, struct kobj_attribute
*attr, const char *buf, size_t count){
}
static struct kobj_attribute baz_attribute =
__ATTR(foo, 0666, fo_show, fo_store);
on ADB have you asked to remount the device? Do the following:
adb remount (./adb on apple)
adb shell (./adb apple)
cd sys
chmod 777 filename
you should be able to also create or delete directories too

Related Links

Android- ImageView not showing
Ant seems to ignore jar generated by Proguard while packaging apk
Populating a ListView from an Intent
How to check that maven goal called during phase
Android real-time game - implement time unit
move my progressbar with an image android
Not Reading text from a .txt file which is present on server [duplicate]
Android Actionbar Tabs, Fragments, and WebViews
adding colors to simple cursor adapter list view
Android: How do I make a video splash screen repeat until webview finishes loading the url?
Zoom in and zoom out in android image view having another image drawn with canvas over it
Actual position of view not changing after setfillafter(true) in android animation
Strange behavior of ProgressDialog's key listener in Android
How to Turn the Image when i click imagebutton?
AndroidManifest file missing
who invokes Android lifecycle handlers?

Categories

HOME
search
assembly
spark-streaming
c++11
angular-formly
hessian
jsf-2.2
graphics
access
arangodb
project
google-schemas
mel
naivebayes
favicon
atlassian
selectize.js
firefox-addon
intershop
selinux
sar
articulate-storyline
exit
roundup
perlbrew
moses
gpio
jasmine-node
firebase-analytics
carrierwave
ntp
calculation
livelink
recurring-events
angularjs-material
hibernate-validator
linkedhashmap
login-script
keras-layer
openwhisk
html-encode
least-squares
navigator
sharepoint-workflow
magento-1.9.2.4
google-knowledge-graph
password-protection
verifiable-c
urlsession
news
datacachefactory
preloader
subclipse
oracle-service-bus
knime
double-click
jboss-4.2.x
arq
context-switch
stdmap
azure-cli
java-6
colorbar
vibrate
rocks
atlas
microstation
uicolor
signalr.client
dimension
kiosk
sklearn-pandas
libav
jbase
inf
sciruby
microsoft-reporting
mod-proxy
lasso
skspritenode
gamekit
android-cookiemanager
primitive-types
android-vibration
iso-prolog
functional-java
menubar
qscrollarea
gwt-openlayers
android-usb
windows-phone-8-sdk
mongohq
css-reset
cardreader
swfobject
asplinkbutton
android-sdk-2.3
josql
luabind
jqote
cuteeditor
collectionviewsource
cac
luajava
objective-j
object-database
zen
blender-2.49
qtabbar
pagemethods
wordprocessingml
escrow
flvplayback
java1.4
business-model

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App