Jump to content
  • 0

Cant use :read


_insidious

Question

Posted

hi im having troubles to use this:

file = io.open('/sys/(path)','r')

view = file:read('*a')

then i  print view,  this code worked in my emulator (nox) but not in my phone (android 13), i dont know if is still possible but i need a fix.

3 answers to this question

Recommended Posts

Posted
22 hours ago, _insidious said:

hi im having troubles to use this:

file = io.open('/sys/(path)','r')

view = file:read('*a')

then i  print view,  this code worked in my emulator (nox) but not in my phone (android 13), i dont know if is still possible but i need a fix.

it should work fine , maybe you need to specify the extention of the file you want to open

Posted

Hi @_insidious, are the (path) is a variable? Just merged it instead of using f-string:

io.open(f'/sys/{paths}', 'rb'):read('*a') --Fstring: x
io.open('/sys/' .. paths, 'rb'):read('*a')
  • - Can you include some Logs file?
  • - Also check for Game Guardian permissions, both on Application and Root level
  • - Maybe there's some interference for Game Guardian accessing /sys. Could be Samsung Knox or something.
  • - On Newer Android (12-13) there's some Internal changes regarding permissions level and Processes. More likely is this.

Try to modify some Configuration:

su
setenforce 0 --Permissive SELinux
mount -o ro,remount /sys --/sys as Read-Only

Or if you're using Magisk, try to modify the Context:

mount -o rw,remount /system --/system as Read Write
u:object_r:magisk_file:s0 --Duplicate any Magisk Path and add this Context along with it (in the end) on /system/sepolicy/file_contexts
Posted
21 hours ago, MC189 said:

Hi @_insidious, are the (path) is a variable? Just merged it instead of using f-string:

io.open(f'/sys/{paths}', 'rb'):read('*a') --Fstring: x
io.open('/sys/' .. paths, 'rb'):read('*a')
  • - Can you include some Logs file?
  • - Also check for Game Guardian permissions, both on Application and Root level
  • - Maybe there's some interference for Game Guardian accessing /sys. Could be Samsung Knox or something.
  • - On Newer Android (12-13) there's some Internal changes regarding permissions level and Processes. More likely is this.

Try to modify some Configuration:

su
setenforce 0 --Permissive SELinux
mount -o ro,remount /sys --/sys as Read-Only

Or if you're using Magisk, try to modify the Context:

mount -o rw,remount /system --/system as Read Write
u:object_r:magisk_file:s0 --Duplicate any Magisk Path and add this Context along with it (in the end) on /system/sepolicy/file_contexts

the code works in my nox but not in my phone, i just need to do this without any external lib, just by running gameguardian

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.