Jump to content
  • 1

Is there a way to detect android version in lua script?


Question

Posted

I search ed a little bit in the forum but i found nothing. So my question is: is there a way to detect running android version with gg/lua?!
Thank you!! 

Recommended Posts

  • 0
Posted

In real Racing the value to search the fame points (and others) changes if you re running android 10 or earlier. I don t want perform double search because it is slow nor write 2 scripts. So if i can detect android version i can select right value to search directly... 

[added 1 minute later]
4 hours ago, HEROGAMEOfficial said:

Is there a way to detect android version in lua script?

Can.

Could you explain Please? 

  • 0
Posted
9 minutes ago, MarioRossi93i said:

without interaction

This method is not official. But maybe the future GG will be integrated with gg.androidVersion or gg.sdkVersion.

@Enyby Maybe my idea can confirm 2 syntax for next release GG.

  • 0
Posted

The solution was in documentation... 

There's no need to add new syntax , just 

print('GET 1: ', gg.makeRequest('http://httpbin.org/headers').content) -- simple GET request

 

  • 0
Posted (edited)
22 minutes ago, ItsSC said:

The solution was in documentation... 

There's no need to add new syntax , just 


print('GET 1: ', gg.makeRequest('http://httpbin.org/headers').content) -- simple GET request

 

Nice but not all user agree for acces to internet.

Edited by HEROGAMEOfficial
  • 0
Posted (edited)
1 minute ago, HEROGAMEOfficial said:

Nice but not all user agree for acces internet (in my head).

Short answer : Don't use the script if they don't trust it. Just code, they don't want use then let them be.

 

There is no point to think so much for them. If some script writer really want to do something malicious, disagree access internet wouldn't stop them. 

Edited by ItsSC
  • 0
  • Administrators
Posted
1 hour ago, MarioRossi93i said:

if you re running android 10 or earlier

All android now is 10 or earlier.

You need detect behavior, not some flags.

So find simple way to detect difference in memory layout and use it.

  • 0
Posted (edited)

@Enyby thanks for the answer i m going to do an example:


to find fame points in android 10 i have to search, eg: -1500000100, then knowing the offsets i change my values

to find the same pointer ( with same offsets) in earliers android versions i have to search, eg: -1700000500

searching both values slows down the script, so i would like avoid double searches...

to find a memory layout like your suggestion i have to do additional searches and i slow down the script anyway, or i m wrong?

I saw that there are few ways to bypass the problem, but a built in function would be a good thing😁

Regards

Edited by MarioRossi93i
  • 0
Posted
1 minute ago, MarioRossi93i said:

@Enyby thanks for the answer i m going to do an example:


to find fame points in android 10 i have to search, eg: -1500000100, then knowing the offsets i change my values

to find the same pointer ( with same offsets) in earliers android versions i have to search, eg: -1700000500

searching both values slows down the script, so i would like avoid double searches...

to find a memory layout like your suggestion i have to do additional searches and i slow down the script anyway, or i m wrong?

I saw that there are few ways to bypass the problem, but a built in function would be a good thing😁

Regards

I guess what Enyby means is 

You can search "-1500000100" then do the offset, if you didn't get any result from "-1500000100". That's mean this phone is not android 10. Then do -170000500

 

So in this case, I prefer using my way can help in reducing time on guessing the android version of user.

  • 0
Posted

Yes but i have to search 2 values instead one that, if you are doing group search, can slow down scripts significantly

Your seems only way without user interaction and double searches. Thanks a lot! 

  • 0
  • Administrators
Posted

Find another difference by which you can determine which case it is. For example, a list of loaded libraries.
Tomorrow, developers can apply the approach with 10 android, for older versions. And this will break your script if it relies on the version of android.

You can make a lazy double search mechanism.
The script looks for the presence of the saved search type in the config.
If it isn’t empty, use this type. If the search is unsuccessful, it switches to another type.
If it is empty there, it first conducts one search, and if it is unsuccessful, then the second.
In any case, the type is saved in the config.
This allows you to completely solve the problem.

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