[Sample App] WIFI Password Viewer

116 views
Skip to first unread message

The Brazilian Developer

unread,
Jun 18, 2016, 11:58:51 PM6/18/16
to DroidScript
Root Required <=

I'm using sys.Out in example

Thanks Steve :)

//--
function OnStart()
{
 lay
= app.CreateLayout("linear","vcenter,fillxy");


 
//--
 app
.ShowProgress("Loading...");
 
var sys = app.CreateSysProc("su");
 sys
.Out("cat /data/misc/wifi/wpa_supplicant.conf > /sdcard/WiFi.conf");
 check
= setInterval("CheckFile()",200);
 
 lstWifi
= app.CreateList("",1,1);
 lay
.AddChild(lstWifi);
 
 app
.AddLayout( lay );
}


function CheckFile()
{
 
if(app.FileExists("/sdcard/WiFi.conf")) {
 app
.HideProgress();
 clearInterval
(check);
 
var text = app.ReadFile("/sdcard/WiFi.conf");
 text
= text.replace(/\"/gi,"");
 text
= text.replace(/ssid=/gi,"");
 text
= text.replace(/psk=/gi,"");
 text
= text.replace(/key_mgmt=/gi,"");
 
var spt = text.split("network={");
 
var list = "";
 
for( var i = 0; i<spt.length; i++ ) {
 
var a = spt[i];
 a
= a.replace(/\t/gi,"");
 
if(a.length<350) {
 
var net = a.split("\n");
 
var name = net[1]; pass = net[2]; type = net[3];
  list
+= name+":Password^c^ "+pass+"\nType^c^ "+type+":null,";
 
}
 
}
 lstWifi
.SetList(list);
 setTimeout
('app.DeleteFile("/sdcard/WiFi.conf")',200);
 
}
}

-The Brazilian Developer

Reply all
Reply to author
Forward
0 new messages