Patcher (by Roaming Gamer) Released

Have you ever wondered, "Is there a drop-dead easy way to download and execute scripts in my released app/game?"

If so, the answer is, “Yes!”.

With patcher you can download scripts to effectively supersede scripts bundled with your app. You can also download new code and execute it.
 

 
With Patcher (docs) fixing a bug or tweaking a feature can be this simple:

-- Top of main.lua -- local patcher = require "plugin.patcher" patcher.export() -- Then, elsewhere in your patching management code (write it as you wish) ... -- local function onSuccess( event ) patcher.purge("scripts.myModule") require("scripts.myModule") end patcher.mkFolder( "scripts" ) local myPatch = "https://raw.githubusercontent.com/roaminggamer/RG\_FreeStuff/master/myPluginSamples/patcher/myModule.lua" patcher.get( myPatch, "scripts.myModule", onSuccess )

https://www.youtube.com/watch?v=iHoAr2ZmvWo&feature=youtu.be
 
Marketplace:  https://marketplace.coronalabs.com/plugin/patcher 
Complete Example: patcher-example.zip
Docs:  https://roaminggamer.github.io/RGDocs/pages/Plugins/patcher/#patcher
 
 
Disclaimer: You must still follow the guidelines outlined by individual app stores with regards to downloaded  ** scripts.**

You must read these guidelines on your own and decide on your own.  I am not an expert on the current guidelines for every store and I don’t constantly read them to stay up-to-date.

can you do that on iOS - I mean is it ok with App Store policies?

This is a grey area.

Please read the Apple guidelines and make that decision for yourself.  I can’t give you legal advise or anything approximating it.

I will say, the guidelines are significantly loosened from the original situation where this was not allowed at all.  Also, we see this done in many apps today.  So, you need to make the call based on the guidelines, your own research, and the your best understanding of the current Apple landscape.

Tip: When reading the guidelines, I don’t mean the summarized ones on their web docs.  Read the full guidelines document which is a little harder to find.

Thanks. I’ve tried your demo and it looks awesome.

Maybe one possible bug - I changed your url for a little error trial from this: 

"https://raw.githubusercontent.com/roaminggamer/RG\_FreeStuff/master/myPluginSamples/patcher/myModule.lua"

to this:

"https://raw.githubusercontent.com/roaminggamer/RG\_FreeStuff/myModule.lua"

and I get a success note with no script downloaded. 

Looks like the download helper is detecting a failed download as a success?

I’ll check on that. 

Thanks!

Very clever, I wish this was around a year ago!

The only issue I can see is that on devices where the user has free access to the documents folder, they can see all the code. And potentially mess around with it?

I had considered adding an encryption feature which is completely possible, but held off. 

If demand were high enough I could do this.

can you do that on iOS - I mean is it ok with App Store policies?

This is a grey area.

Please read the Apple guidelines and make that decision for yourself.  I can’t give you legal advise or anything approximating it.

I will say, the guidelines are significantly loosened from the original situation where this was not allowed at all.  Also, we see this done in many apps today.  So, you need to make the call based on the guidelines, your own research, and the your best understanding of the current Apple landscape.

Tip: When reading the guidelines, I don’t mean the summarized ones on their web docs.  Read the full guidelines document which is a little harder to find.

Thanks. I’ve tried your demo and it looks awesome.

Maybe one possible bug - I changed your url for a little error trial from this: 

"https://raw.githubusercontent.com/roaminggamer/RG\_FreeStuff/master/myPluginSamples/patcher/myModule.lua"

to this:

"https://raw.githubusercontent.com/roaminggamer/RG\_FreeStuff/myModule.lua"

and I get a success note with no script downloaded. 

Looks like the download helper is detecting a failed download as a success?

I’ll check on that. 

Thanks!

Very clever, I wish this was around a year ago!

The only issue I can see is that on devices where the user has free access to the documents folder, they can see all the code. And potentially mess around with it?

I had considered adding an encryption feature which is completely possible, but held off. 

If demand were high enough I could do this.