Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // DroidScript
- // Check if a file has the structure of a plugin
- var fil = "/storage/9016-4EF8/Download20160702/FileManager.zip";
- //fil="/storage/9016-4EF8/Download20160702/3Dumb.zip";
- function OnStart()
- {
- var msg ="Invalid Plugin";
- if(isPlugin( fil )) msg = "Looks OK"
- app.ShowPopup( msg );
- }
- function isPlugin(fil)
- {
- return isPluginZip(fil) || isPluginApk(fil);
- }
- function isPluginApk(fil)
- {
- var temp = fil.split("/").pop();
- if(temp.slice(-4)!=".apk") return false;
- var plugName = temp.slice(0,-4);
- var zip = app.CreateZipUtil( );
- zip.Open( fil );
- var lst = zip.List( "/" ).split(",");
- if(lst.indexOf("classes.dex")==-1) return false;
- lst = zip.List( "/assets/" ).split(",");
- if(lst.indexOf(plugName+".inc")==-1) return false;
- if(lst.indexOf(plugName+".html")==-1) return false;
- return true;
- }
- function isPluginZip(fil)
- {
- var temp = fil.split("/").pop();
- if(temp.slice(-4)!=".zip") return false;
- var plugName = temp.slice(0,-4);
- var zip = app.CreateZipUtil( );
- zip.Open( fil );
- var lst = zip.List( "/" ).split(",");
- if(lst.indexOf(plugName+".jar")==-1) return false;
- if(lst.indexOf(plugName+".inc")==-1) return false;
- if(lst.indexOf(plugName+".html")==-1) return false;
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement