QR kodu nasıl çözümleniyor?

Furkan_09

Centipat
Katılım
11 Aralık 2020
Mesajlar
22
Daha fazla  
Cinsiyet
Kadın
Bir inceleyin:
[CODE title="Kod"] function onQRCodeScanned(scannedText) {
if (scannedText == null) {
return;
}

var keylink = null;
var queries = {};
location.search.substr(1).split("&").forEach(function (item) {
queries[item.split("=")[0]] = item.split("=")[1];
});
keylink = queries['kl'];

var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
window.location.assign("https://mehcan.net/e-kilit/anahtar.php?sr=" + this.responseText);
}
}

if(keylink==null){
var pass = localStorage.getItem("key_pass");
var tname = localStorage.getItem("key_tname");
var ucode = localStorage.getItem("key_ucode");
if (pass == null || ucode == null || pass.length==0||ucode.length==0) {
window.location.assign("https://mehcan.net/e-kilit/anahtar.php?sr=HATA_AYARLAR_YAPILMAMIS");
return;
}
xmlhttp.open("POST", "https://mehcan.net/e-kilit/qd.php", true);
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlhttp.send("s=gen&qr=" + scannedText + "&pass=" + pass + "&ucode=" + ucode);
}
else{
xmlhttp.open("POST", "https://mehcan.net/e-kilit/qd.php", true);
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlhttp.send("s=keylink&qr="+scannedText+"&keylink=" + keylink );
}
}

function provideVideo()
{
var n = navigator;

if (n.mediaDevices && n.mediaDevices.getUserMedia)
{
return n.mediaDevices.getUserMedia({
video: {
facingMode: "environment"
},
audio: false
});
}

return Promise.reject('Your browser does not support getUserMedia');
}

function provideVideoQQ()
{
return navigator.mediaDevices.enumerateDevices()
.then(function(devices) {
var exCameras = [];
devices.forEach(function(device) {
if (device.kind === 'videoinput') {
exCameras.push(device.deviceId)
}
});

return Promise.resolve(exCameras);
}).then(function(ids){
if(ids.length === 0)
{
return Promise.reject('Could not find a webcam');
}

return navigator.mediaDevices.getUserMedia({
video: {
'optional': [{
'sourceId': ids.length === 1 ? ids[0] : ids[1]//this way QQ browser opens the rear camera
}]
}
});
});
}

//this function will be called when JsQRScanner is ready to use
function JsQRScannerReady()
{
//create a new scanner passing to it a callback function that will be invoked when
//the scanner succesfully scan a QR code
var jbScanner = new JsQRScanner(onQRCodeScanned);
//var jbScanner = new JsQRScanner(onQRCodeScanned, provideVideo);
//reduce the size of analyzed image to increase performance on mobile devices
jbScanner.setSnapImageMaxSize(2400);
jbScanner.setScanInterval(500);
var scannerParentElement = document.getElementById("scanner");
if(scannerParentElement)
{
//append the jbScanner to an existing DOM element
jbScanner.appendTo(scannerParentElement);
}
}[/CODE]
 
Son düzenleyen: Moderatör:

Geri
Yukarı