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

setError position on left side of Edittext in Android
How to set Filter to ListView with CursorAdapter?
Android : Unable to update state in widget because updateWidget not called
Android Studio and gradle 's slow build time, what to do in the mean time?
OnItemClickListener use for TableRow
Getting exception : java.lang.NoClassDefFoundError: android.support.v7.app.AppCompatDelegateImplV14
Card flip animation for one item in a gridview
What are the costs associated with maintaining an Android app if you are the developer?
Remove SearchOrbView Android TV
Circle menu for mapview Marker in Android google maps API V2
Could not show text shadow of TextView
Cannot resolve symbol USAGE_NOTIFICATION_RINGTONE
AdMob no fill - Could not instantiate mediation adapter: com.google.DummyAdapter
WakefullIntentService register two alarms and possibly cancel one
RecyclerView & View Pager .No adapter attached?
AdLoader class package not found

Categories

HOME
windows
localization
jpa
gpu
datastore
swt
hessian
socket.io
knitr
owl-carousel
ms-access-2016
spring-session
android-json
azure-container-service
special-characters
github-enterprise
mxgraph
cmdb
naivebayes
shared-libraries
azure-iot-hub
soci
gmm
poedit
question2answer
event-store
tosca
dynamically-generated
maze
surveymonkey
paperjs
comparable
livelink
laravel-eloquent
papaparse
login-script
dynamic-jasper
hunspell
sharding
modalviewcontroller
arduino-ide
browser-extension
openerp-7
playframework-2.1
imagenet
nohup
diacritics
news
datacachefactory
print-css
congestion-control
angular-http
strftime
optimizely
sonarlint-eclipse
hammer.js
identification
magic-draw
spring-data-couchbase
rackspace-cloud
ampps
autosar
ziparchive
latin
macaulay2
dimension
turbo-prolog
lazybones
morton-number
zen-cart
extjs-grid
sql-server-data-tools
mass-assignment
rapidsvn
cocos3d
insight.database
lambda-architecture
parallel-testing
winginx
ray
file-not-found
websphere-esb
git-repo
getopt
xmltodict
inputmismatchexception
joomla3.1
android-loadermanager
tree-balancing
web-farm
dajaxice
garbage
thttpd
failing-tests
fitbounds
photolibrary
timertask
vs-android
pos-for-.net
mathematical-notation
linfu-dynamicproxy

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App