Jump to content
  • 0

Info device in lua


Rofiq
 Share

Question

Recommended Posts

  • 0
3 hours ago, Enyby said:

Obviously, all those functions that are usually used after io.open - file:*

file:close
file:flush
file:lines
file:read
file:seek
file:setvbuf
file:write

https://www.lua.org/manual/5.3/contents.html#index

 

Its just programer, not all people now it.

17 hours ago, Rofiq said:

Hello master..

How to display device info in lua script.?

Thank

For simple local a = io.open("/system/build.prop", "r"):read("*a")

print(a)

Its not fix because i think no root can't read build.prop or not all firmware can allow to this, show check before read, like local b = io.open("/system/build.prop", "r") if not b then return end then you can next steep for read build.prop.

Link to comment
Share on other sites

  • 0
20 hours ago, Help_Quit said:

Its just programer, not all people now it.

For simple local a = io.open("/system/build.prop", "r"):read("*a")

print(a)

Its not fix because i think no root can't read build.prop or not all firmware can allow to this, show check before read, like local b = io.open("/system/build.prop", "r") if not b then return end then you can next steep for read build.prop.

root not work.

maybe script error maybe im noob

Link to comment
Share on other sites

  • 0
On 10/6/2019 at 4:33 PM, Enyby said:

Obviously, all those functions that are usually used after io.open - file:*

file:close
file:flush
file:lines
file:read
file:seek
file:setvbuf
file:write

https://www.lua.org/manual/5.3/contents.html#index

 

I can only display IMEI

and i can't display DEVICE ..

 

 maybe you can make it for me master...

I am still new to understanding the script

 

please please please........

Link to comment
Share on other sites

  • 0
38 minutes ago, Help_Quit said:

This specific;

a = io.open("/system/build.prop", "r")

if not a then

gg.alert("Can't read build.prop")

os.exit()

else

a = a:read("*a")

end

Use match for get what you want in build.prop

read this and understand:

http://lua-users.org/wiki/PatternsTutorial

Thank you 

Link to comment
Share on other sites

  • 0
Just now, Help_Quit said:

This specific;

a = io.open("/system/build.prop", "r")

if not a then

gg.alert("Can't read build.prop")

os.exit()

else

a = a:read("*a")

end

Use match for get what you want in build.prop

read this and understand:

http://lua-users.org/wiki/PatternsTutorial

This not work

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • 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.