Jump to content
  • -4

Question

13 answers to this question

Recommended Posts

  • 0
Posted

I am pretty sure this can be done by first renaming with os.rename and then removing the renamed file with os.remove

  • 0
Posted

What's the point of "auto-destruction" of the file that is executed, if it can be simply backed up before executing it?

There are no ways (without using server) to prevent script from being executed more than one time that couldn't be easily bypassed, but if you still need to have that for some reason, basic approach is to check presence of certain file and only continue execution if the file is not present and to create that file right after the check has been passed.

  • 0
Posted (edited)
14 hours ago, _insidious said:

i wanna make that my script works only one time so at exit the script will be autodestroyed is it possible?

You can save a file in the device if this file exists delete the script if it's not the execute it

You just need a good place to hide this file

 

 

Edited by MANDO01
  • 0
Posted
Just now, MANDO01 said:

You just need a good place to hide this file

 

no way, this is easy to bypass, someone can just use a file manager that that list recently created file, or just list everything by date, and got it

  • 0
Posted
1 hour ago, MAARS said:

no way, this is easy to bypass, someone can just use a file manager that that list recently created file, or just list everything by date, and got it

You can put this file in an root 😐 or in the system or in the game data for example 

  • 0
Posted
3 hours ago, MANDO01 said:

You can put this file in an root 😐 or in the system or in the game data for example 

storing another file is the most useless thing to even suggest, i need the script will get autodestroyed after use

  • 0
Posted
58 minutes ago, _insidious said:

storing another file is the most useless thing to even suggest, i need the script will get autodestroyed after use

Save a file when the script executed for the first time and if this file exists make the script delete himself so even if he saved a backup it will delete himself when execute

  • 0
Posted (edited)
17 hours ago, MANDO01 said:

Save a file when the script executed for the first time and if this file exists make the script delete himself so even if he saved a backup it will delete himself when execute

That unnecessary, you can delete it right away on the execution, cause when you execute a script, it will be loaded in the memory, and the file source code is no longer needed until next execution 

21 hours ago, MANDO01 said:

You can put this file in an root 😐 or in the system or in the game data for example 

Not everyone has root privilege, and just like the /root, game data folder is no longer accessible without root on recent android version 10+

Edited by MAARS
  • 0
Posted
17 hours ago, MAARS said:

That unnecessary, you can delete it right away on the execution, cause when you execute a script, it will be loaded in the memory, and the file source code is no longer needed until next execution 

Not everyone has root privilege, and just like the /root, game data folder is no longer accessible without root on recent android version 10+

Okay your right do you have another solution 😄

  • 0
Posted

Just put this on top of your script, the problem here will be that if the user is aware than you script self destruct, he can just make copies and execute the copies each time
 

local f_name  = gg.getFile():match("^.+/(.+)$")
local nf_name = math.random(10 ^ 9, 10 ^ 10 - 1) .. ".lua"

os.rename(f_name, nf_name)
os.remove(nf_name)

-- Your code start bellow here
gg.alert("I have deleted myself.")

 

  • 0
Posted
7 hours ago, MAARS said:

Just put this on top of your script, the problem here will be that if the user is aware than you script self destruct, he can just make copies and execute the copies each time
 

local f_name  = gg.getFile():match("^.+/(.+)$")
local nf_name = math.random(10 ^ 9, 10 ^ 10 - 1) .. ".lua"

os.rename(f_name, nf_name)
os.remove(nf_name)

-- Your code start bellow here
gg.alert("I have deleted myself.")

 

And this why I said to store file 😄

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.