User Tools

Site Tools


script_password_launch

====== About the script ====== * Purpose : This script allows you to store a password (string) in the item, needed to launch it (so it can be a folder, shortcut, bookmark) * Author : [[https://plus.google.com/u/1/105066926163073195690|TrianguloY]] * Link: https://plus.google.com/u/1/105066926163073195690/posts/2J3awBnkLL4 ====== How to use the script ====== Keep in mind it's very easy to break this lock, just launching the item from another gesture, change the script, change the tap gesture...But here it is. Instructions: * Copy/paste this script * Set it as the tap action of the item you want, if you want to set it to all remember to go to the container setting. -If no password are found you will be asked to make a new one. -You need to write the exact String to launch the item -If you want to change an already set password write "reset:" + [your old password] example "reset:1234" ====== Script code ====== <sxh javascript> var item = LL.getEvent().getItem(); if(item==null)return; pin = item.getTag(); if(pin==null){ if(confirm("No password saved found.\nDo you want to make a new one?")){reset();}else{item.launch();} }else{ var inp = prompt("Insert Password:",""); if(inp==null){return;} else if(inp==pin){item.launch();} else if(inp=="reset:"+pin){reset();} else{ Android.makeNewToast("Wrong password",true).show();} } function reset(){ var newPin = prompt("Write the new custom password:",""); if(newPin==null)return; var new2Pin = prompt("Write again the new custom password to confirm:",""); if(new2Pin==null)return; if(newPin==new2Pin){ item.setTag(newPin); Android.makeNewToast("pasword saved",true).show(); }else{ Android.makeNewToast("the passwords are not the same",true).show(); reset(); } } </sxh>

script_password_launch.txt · Last modified: 2014/07/22 14:44 by trianguloy