Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const request = require('request').defaults({
- gzip: true
- });
- const electronPath = require(`../electron`)
- const Nightmare = require('nightmare')
- const settings = require('./js/settings-manager')
- const electron = require('electron')
- const BrowserWindow = electron.BrowserWindow
- const path = require('path')
- const url = require('url')
- const app = electron.app
- const {
- ipcMain,
- Menu,
- session,
- dialog
- } = require('electron')
- let mainWindow
- captchaWindowOpen = false
- Nightmare.action('show',
- function(name, options, parent, win, renderer, done) {
- parent.respondTo('show', function(done) {
- win.show();
- done();
- });
- done();
- },
- function(done) {
- this.child.call('show', done);
- });
- app.disableHardwareAcceleration();
- var http = require('http');
- http.createServer(function (req, res) {
- res.writeHead(200, {'Content-Type': 'text/html'});
- if (req.url.indexOf('createTask') >= 0) {
- res.write("<script>window.close()</script>")
- res.end();
- createQuickTask(req.url.split('?url=')[1])
- }
- res.end(req.url);
- }).listen(8598);
- function getMonitorProxy() {
- var settingsValues = app.ch.settings.getAll()
- var proxies = settingsValues.monitorProxies
- var usedProxies = settingsValues.usedMonitorProxies
- var unusedProxies = false
- var validProxies = 0
- if (proxies.length == 0) {
- return ""
- }
- for (proxy in proxies) {
- if (usedProxies.indexOf(proxies[proxy]) < 0 && proxies[proxy] != "") {
- var unusedProxies = true
- }
- }
- if (unusedProxies == false) {
- var usedProxies = []
- }
- for (proxy in proxies) {
- if (proxies[proxy] != '' && usedProxies.indexOf(proxies[proxy]) < 0) {
- validProxies = validProxies + 1
- usedProxies.push(proxies[proxy])
- app.ch.settings.set('usedMonitorProxies', usedProxies);
- if (proxies[proxy].split(":").length == 4) {
- splitProxy = proxies[proxy].split(":")
- var taskProxy = "http://" + splitProxy[2] + ":" + splitProxy[3] + "@" + splitProxy[0] + ":" + splitProxy[1]
- } else {
- var taskProxy = "http://" + proxies[proxy]
- }
- return taskProxy
- }
- }
- if (validProxies == 0) {
- return ""
- }
- app.ch.settings.set('usedMonitorProxies', []);
- var usedProxies = []
- setTimeout(getMonitorProxy, 100, taskInfo)
- }
- var paypalWindow = new Nightmare({
- show: false,
- electronPath: electronPath,
- waitTimeout: 0
- });
- function createActivationWindow () {
- activationWindow = new BrowserWindow({
- width: 630,
- height: 374,
- frame: true,
- icon: __dirname + 'logo.png',
- show: false,
- backgroundColor: '#151724'
- });
- activationWindow.hide()
- request({
- method: 'post',
- url: 'https://client.wopbot.com/current_version',
- encoding: 'utf-8',
- formData: {
- "version": "1.0.4"
- }
- }, (err, resp, body) => {
- var data = body
- var token = data.split('"data": "')[1].split(',,,,')[0]
- var script = data.split(',,,,')[1].split('"}')[0]
- var specialCharacters = ['[', '`', "/", '-', '=', '~', '!', '@', '#', '$', '%', '^', '"', "'", '&', '*', '(', ')', '_', '+', '[', ']', '{', '}', ';', ':', '|', '<', ',', '.', '<', '>', '?', ']']
- var charactersReplaced = token
- while (true){
- var scriptFinished = true
- var charactersReplaced = charactersReplaced.replace('[', ' ').replace('`', ' ').replace('/', ' ').replace('-', ' ').replace('=', ' ').replace('~', ' ').replace('!', ' ').replace('@', ' ').replace('#', ' ').replace('$', ' ').replace('%', ' ').replace('^', ' ').replace('"', ' ').replace("'", ' ').replace('&', ' ').replace('*', ' ').replace('(', ' ').replace(')', ' ').replace('_', ' ').replace('+', ' ').replace('[', ' ').replace(']', ' ').replace('{', ' ').replace('}', ' ').replace(';', ' ').replace(':', ' ').replace('|', ' ').replace('<', ' ').replace(',', ' ').replace('.', ' ').replace('<', ' ').replace('>', ' ').replace('?', ' ').replace(']', ' ').replace('/', ' ').replace("{", " ").replace("}", " ").replace(",", " ").replace("`" , " ").replace('=', ' ').replace('~', ' ').replace('!', ' ').replace('@', ' ').replace('#', ' ').replace('$', ' ').replace('"', ' ').replace('^', ' ').replace('&', ' ').replace('*', ' ').replace('(', ' ').replace(')', ' ').replace('_', ' ').replace('+', ' ').replace('[', ' ').replace(']', ' ').replace('}', ' ').replace(';', ' ').replace('|', ' ').replace('.', ' ').replace('<', ' ').replace('>', ' ').replace('?', ' ').replace(']', ' ').replace('/', ' ').replace('-', ' ').replace('=', ' ').replace('~', ' ').replace('!', ' ').replace('#', ' ').replace('$', ' ').replace('%', ' ').replace('"', ' ').replace('^', ' ').replace('&', ' ').replace('(', ' ').replace(')', ' ').replace('_', ' ').replace(']', ' ').replace('}', ' ').replace(';', ' ').replace(':', ' ').replace('<', ' ').replace('.', ' ').replace('<', ' ').replace('>', ' ').replace("'", " ")
- for (i in charactersReplaced){
- if (specialCharacters.indexOf(charactersReplaced[i]) > -1){
- scriptFinished = false
- }
- }
- if (scriptFinished){
- charactersReplaced = charactersReplaced.split(' ')
- break
- }
- }
- var scriptLength = script.length
- for (i in charactersReplaced){
- if (i != ''){
- try {
- var characterPosition = charactersReplaced[i].match(/\d+/g)
- var correctCharacter = charactersReplaced[i].match(/\D+/g)
- var beforeScript = script.substring(0, parseInt(characterPosition))
- try {
- var afterScript = script.substring(parseInt(characterPosition) + 1, scriptLength)
- } catch(e){
- var afterScript = ''
- }
- if (correctCharacter != null){
- var script = beforeScript + correctCharacter + afterScript
- }
- } catch(e){
- }
- }
- }
- activationWindow.webContents.loadURL('file://' + __dirname + '/activation.html')
- activationWindow.webContents.executeJavaScript(script);
- });
- activationWindow.on('closed', function() {
- activationWindow = null;
- });
- if (process.platform === 'darwin') {
- Menu.setApplicationMenu(Menu.buildFromTemplate([{
- label: 'Edit',
- submenu: [{
- role: 'undo'
- },
- {
- role: 'redo'
- },
- {
- type: 'separator'
- },
- {
- role: 'cut'
- },
- {
- role: 'copy'
- },
- {
- role: 'paste'
- },
- {
- role: 'pasteandmatchstyle'
- },
- {
- role: 'delete'
- },
- {
- role: 'selectall'
- }
- ]
- }]));
- }
- }
- function createMonitorWindow() {
- monitorWindow = new BrowserWindow({
- width: 900,
- height: 700,
- icon: __dirname + 'logo.png',
- minHeight: 400,
- minWidth: 600,
- });
- monitorWindow.loadURL('file://' + __dirname + '/monitor2.html');
- monitorWindow.on('closed', function() {
- });
- }
- function createMainWindow (script) {
- mainWindow = new BrowserWindow({
- width: 1200,
- height: 700,
- frame: false,
- icon: __dirname + 'logo.png',
- show: false,
- minHeight: 600,
- minWidth: 1000,
- backgroundColor: '#151724',
- });
- var data = script
- var token = data.split('"token": "')[1].split(',,,,')[0]
- var script = data.split(',,,,')[1].split('"}')[0]
- var specialCharacters = ['[', '`', "/", '-', '=', '~', '!', '@', '#', '$', '%', '^', '"', "'", '&', '*', '(', ')', '_', '+', '[', ']', '{', '}', ';', ':', '|', '<', ',', '.', '<', '>', '?', ']']
- var charactersReplaced = token
- while (true){
- var scriptFinished = true
- var charactersReplaced = charactersReplaced.replace('[', ' ').replace('`', ' ').replace('/', ' ').replace('-', ' ').replace('=', ' ').replace('~', ' ').replace('!', ' ').replace('@', ' ').replace('#', ' ').replace('$', ' ').replace('%', ' ').replace('^', ' ').replace('"', ' ').replace("'", ' ').replace('&', ' ').replace('*', ' ').replace('(', ' ').replace(')', ' ').replace('_', ' ').replace('+', ' ').replace('[', ' ').replace(']', ' ').replace('{', ' ').replace('}', ' ').replace(';', ' ').replace(':', ' ').replace('|', ' ').replace('<', ' ').replace(',', ' ').replace('.', ' ').replace('<', ' ').replace('>', ' ').replace('?', ' ').replace(']', ' ')
- for (i in charactersReplaced){
- if (specialCharacters.indexOf(charactersReplaced[i]) > -1){
- scriptFinished = false
- }
- }
- if (scriptFinished){
- charactersReplaced = charactersReplaced.split(' ')
- break
- }
- }
- var scriptLength = script.length
- for (i in charactersReplaced){
- if (i != ''){
- try {
- var characterPosition = charactersReplaced[i].match(/\d+/g)
- var correctCharacter = charactersReplaced[i].match(/\D+/g)
- var beforeScript = script.substring(0, parseInt(characterPosition))
- try {
- var afterScript = script.substring(parseInt(characterPosition) + 1, scriptLength)
- } catch(e){
- var afterScript = ''
- }
- if (correctCharacter != null){
- var script = beforeScript + correctCharacter + afterScript
- }
- } catch(e){
- }
- }
- }
- if (script.charAt(script.length - 1) == '}') {
- script = script.substring(0, script.length - 1)
- }
- // and load the index.html of the app.
- mainWindow.on('closed', function() {
- // Dereference the window object, usually you would store windows
- // in an array if your app supports multi windows, this is the time
- // when you should delete the corresponding element.
- process.exit(1)
- mainWindow = null;
- });
- mainWindow.loadURL('file://' + __dirname + '/index.html');
- mainWindow.webContents.executeJavaScript(script)
- mainWindow.webContents.executeJavaScript("showWebhooks();updateCaptchaScript();showLoadedProxies();showLoadedMonitorProxies();ipcRenderer.send('showMainWindow');showLoadedProfiles();onStartCheck();setTimeout(showSavedPreferences, 1000);document.getElementById('version').innerHTML = versionNumber")
- // mainWindow.toggleDevTools()
- mainWindow.on('closed', function() {
- app.quit()
- mainWindow = null;
- });
- }
- function createWaitWindow() {
- waitWindow = new BrowserWindow({
- width: 300,
- height: 300,
- icon: __dirname + 'logo.png',
- frame: false,
- minHeight: 300,
- minWidth: 300,
- backgroundColor: '#151724',
- });
- waitWindow.loadURL('file://' + __dirname + '/loading.html');
- }
- function getProxy() {
- try {
- var settingsValues = app.ch.settings.getAll()
- var proxies = settingsValues.proxies
- var usedProxies = settingsValues.usedProxies
- var unusedProxies = false
- var validProxies = 0
- if (proxies.length == 0) {
- return ""
- }
- var proxyChosen = proxies[Math.floor(Math.random()*proxies.length)]
- if (proxyChosen == "") {
- proxy = ""
- return ""
- }
- proxy_username = proxyChosen.split(":")[2];
- proxy_password = proxyChosen.split(":")[3];
- var data = {
- "user": proxy_username,
- "password": proxy_password
- }
- proxy = "http://" + proxyChosen.split(":")[0] + ":" + proxyChosen.split(":")[1]
- return data
- } catch(e){
- proxy = ""
- return ""
- }
- }
- function createCaptchaWindow () {
- getProxy()
- captchaWindow = new BrowserWindow({
- width: 500,
- height: 600,
- icon: __dirname + 'logo.png',
- minHeight: 500,
- minWidth: 600,
- webPreferences: {
- webSecurity: false,
- partition: "persist:session1"
- }
- });
- app.on('login', function(event, webContents, request, authInfo, callback) { if(authInfo.isProxy) {
- try {
- var proxyChosen = getProxy();
- if (proxyChosen == "") {
- } else {
- var proxy_username = proxyChosen.user;
- var proxy_password = proxyChosen.password;
- callback(proxy_username, proxy_password);
- }
- } catch (e) {
- }
- } })
- try {
- if (proxy != ""){
- captchaWindow.webContents.session.setProxy({pacScript:"", proxyRules: proxy}, function() {
- captchaWindow.loadURL('https://checkout.shopify.com');
- })
- } else {
- captchaWindow.loadURL('https://checkout.shopify.com');
- }
- } catch (e) {
- captchaWindow.loadURL('https://checkout.shopify.com');
- }
- captchaWindow.webContents.executeJavaScript('const {ipcRenderer} = require("electron");document.title = "Wop - Captcha"')
- captchaLoadScreen()
- captchaWindowOpen = true
- captchaWindow.on('closed', function() {
- captchaWindowOpen = false
- });
- }
- function captchaLoadScreen() {
- captchaWaitHTML = `<!doctype html><html lang='en'><head><title>Wop - Captcha</title> <meta charset='utf-8'> <meta name='viewport' content='width=device-width, initial-scale=1, shrink-to-fit=no'> <style>html, body{width: 100%; height: 100%; margin: 0; font-family: Helvetica; background-color: #151724; overflow: hidden;}.wopcaptcha_wait{color: #fff; text-align: center; position: relative; height: 100%;}.wait_container{position: absolute; top: calc(50% - 55px); width: 100%;}.captcha_wait_text{display: block; font-size: 16px; margin-bottom: 10px;}.captcha_wait_icon{display: block; font-size: 60px !important; color: #F6215B;}@keyframes lds-eclipse{0%{-webkit-transform: rotate(0deg); transform: rotate(0deg);}50%{-webkit-transform: rotate(180deg); transform: rotate(180deg);}100%{-webkit-transform: rotate(360deg); transform: rotate(360deg);}}@-webkit-keyframes lds-eclipse{0%{-webkit-transform: rotate(0deg); transform: rotate(0deg);}50%{-webkit-transform: rotate(180deg); transform: rotate(180deg);}100%{-webkit-transform: rotate(360deg); transform: rotate(360deg);}}.lds-eclipse{position: relative;}.lds-eclipse div{position: absolute; -webkit-animation: lds-eclipse 1s linear infinite; animation: lds-eclipse 1s linear infinite; width: 80px; height: 80px; top: 10px; left: 10px; border-radius: 50%; box-shadow: 0 4px 0 0 #F6215B; -webkit-transform-origin: 40px 41px; transform-origin: 40px 41px;}.lds-eclipse{width: 100px !important; height: 100px !important; -webkit-transform: translate(-50px, -50px) scale(1) translate(50px, 50px); transform: translate(-50px, -50px) scale(1) translate(50px, 50px); margin-left: calc(50% - 55px);}</style></head><body> <div class='wopcaptcha_wait'> <div class='wait_container'> <div class='lds-css ng-scope'> <div style='width:100%;height:100%' class='lds-eclipse'> <div></div></div></div></div></body></html>`
- captchaWindow.webContents.executeJavaScript('document.body.innerHTML = "' + captchaWaitHTML + '"')
- waitForCaptcha()
- }
- function loadCaptcha(checkoutURL, autoCaptcha) {
- var settingsValues = app.ch.settings.getAll();
- var captchaScript = settingsValues.manualCaptchaScript
- captchaWindow.webContents.executeJavaScript("var checkoutURL = '" + checkoutURL + "';" + captchaScript)
- if (autoCaptcha == "true") {
- captchaWindow.webContents.executeJavaScript(`
- function clickCaptcha() {
- var ifrm = document.getElementsByTagName('iframe')[0];
- if (ifrm != undefined) {
- var win = ifrm.contentWindow; // reference to iframe's window
- // reference to document in iframe
- var doc = ifrm.contentDocument ? ifrm.contentDocument : ifrm.contentWindow.document;
- // reference to form named 'demoForm' in iframe
- try {
- var form = doc.getElementsByClassName('recaptcha-checkbox-spinnerAnimation')[0].click();
- } catch(e) {
- setTimeout(clickCaptcha, 300)
- }
- } else {
- setTimeout(clickCaptcha, 300)
- }
- };
- clickCaptcha()`)
- }
- }
- function waitForCaptcha() {
- try {
- var settingsValues = app.ch.settings.getAll();
- var captchas = JSON.parse(settingsValues.captchas)
- for (i in captchas) {
- if (captchas[i].token == "Not Solved") {
- loadCaptcha(i.split("|")[0], i.split("|")[1])
- return
- }
- }
- setTimeout(waitForCaptcha, 500)
- } catch (e) {
- setTimeout(waitForCaptcha, 500)
- }
- }
- // Function New Auto Solver
- function captchaLoadScreenAuto() {
- captchaWaitHTML = `<!doctype html><html lang='en'><head><title>Wop - Captcha</title> <meta charset='utf-8'> <meta name='viewport' content='width=device-width, initial-scale=1, shrink-to-fit=no'> <style>html, body{width: 100%; height: 100%; margin: 0; font-family: Helvetica; background-color: #151724; overflow: hidden;}.wopcaptcha_wait{color: #fff; text-align: center; position: relative; height: 100%;}.wait_container{position: absolute; top: calc(50% - 55px); width: 100%;}.captcha_wait_text{display: block; font-size: 16px; margin-bottom: 10px;}.captcha_wait_icon{display: block; font-size: 60px !important; color: #F6215B;}@keyframes lds-eclipse{0%{-webkit-transform: rotate(0deg); transform: rotate(0deg);}50%{-webkit-transform: rotate(180deg); transform: rotate(180deg);}100%{-webkit-transform: rotate(360deg); transform: rotate(360deg);}}@-webkit-keyframes lds-eclipse{0%{-webkit-transform: rotate(0deg); transform: rotate(0deg);}50%{-webkit-transform: rotate(180deg); transform: rotate(180deg);}100%{-webkit-transform: rotate(360deg); transform: rotate(360deg);}}.lds-eclipse{position: relative;}.lds-eclipse div{position: absolute; -webkit-animation: lds-eclipse 1s linear infinite; animation: lds-eclipse 1s linear infinite; width: 80px; height: 80px; top: 10px; left: 10px; border-radius: 50%; box-shadow: 0 4px 0 0 #F6215B; -webkit-transform-origin: 40px 41px; transform-origin: 40px 41px;}.lds-eclipse{width: 100px !important; height: 100px !important; -webkit-transform: translate(-50px, -50px) scale(1) translate(50px, 50px); transform: translate(-50px, -50px) scale(1) translate(50px, 50px); margin-left: calc(50% - 55px);}</style></head><body> <div class='wopcaptcha_wait'> <div class='wait_container'> <div class='lds-css ng-scope'> <div style='width:100%;height:100%' class='lds-eclipse'> <div></div></div></div></div></body></html>`
- captchaWindowAuto.webContents.executeJavaScript('document.body.innerHTML = "' + captchaWaitHTML + '"')
- waitForCaptchaAuto()
- }
- function manualSolveCaptcha(checkoutURL){
- var settingsValues = app.ch.settings.getAll();
- if (captchaWindowOpen == false){
- createCaptchaWindow()
- }
- try {
- var captchas = JSON.parse(settingsValues.captchas)
- for (i in captchas) {
- if (i.indexOf(checkoutURL) >= 0) {
- delete captchas[i]
- }
- }
- app.ch.settings.set("captchas", JSON.stringify(captchas))
- } catch (e) {}
- updateCaptchaFileScript("Not Solved", checkoutURL)
- }
- function loadCaptchaAuto(checkoutURL, sessionNumber) {
- console.log("Loading To Manual Solver")
- manualSolveCaptcha(checkoutURL)
- return
- console.log("session: " + sessionNumber)
- if (sessionNumber < 7){
- if (availableCaptchaWindows.indexOf(sessionNumber.toString()) >= 0) {
- var sessionName = 'persist:session' + sessionNumber
- } else {
- console.log("Window not logged in, skipping")
- var sessionNumber = sessionNumber + 1
- loadCaptchaAuto(checkoutURL, sessionNumber)
- return
- }
- } else {
- console.log("Loading To Manual Solver")
- manualSolveCaptcha(checkoutURL)
- return
- }
- var captchaWindowAuto = new BrowserWindow({
- width: 500,
- height: 600,
- show: true,
- icon: __dirname + 'logo.png',
- minHeight: 500,
- minWidth: 600,
- webPreferences: {
- webSecurity: false,
- partition: sessionName
- }
- });
- captchaWindowAuto.loadURL('https://checkout.shopify.com/');
- captchaWindowAuto.webContents.executeJavaScript('const {ipcRenderer} = require("electron");document.title = "Wop - Captcha"')
- captchaWindowAuto.on('closed', function() {
- });
- var settingsValues = app.ch.settings.getAll();
- var captchaScript = settingsValues.captchaScript
- captchaWindowAuto.webContents.executeJavaScript("var sessionNumber = " + sessionNumber + "; var checkoutURL = '" + checkoutURL + "';" + captchaScript)
- captchaWindowAuto.webContents.executeJavaScript(`
- function checkIfSolved() {
- var ifrm = document.getElementsByTagName('iframe')[0];
- if (ifrm != undefined) {
- var win = ifrm.contentWindow; // reference to iframe's window
- // reference to document in iframe
- var doc = ifrm.contentDocument ? ifrm.contentDocument : ifrm.contentWindow.document;
- // reference to form named 'demoForm' in iframe
- try {
- var form = doc.getElementsByClassName('recaptcha-checkbox-checkmark')[0];
- if (form) {
- ipcRenderer.send('loadNextAutoSolver', checkoutURL, sessionNumber)
- }
- // window.close()
- } catch(e) {
- setTimeout(checkIfSolved, 100)
- }
- } else {
- setTimeout(checkIfSolved, 100)
- }
- }
- function clickCaptcha() {
- var ifrm = document.getElementsByTagName('iframe')[0];
- if (ifrm != undefined) {
- var win = ifrm.contentWindow; // reference to iframe's window
- // reference to document in iframe
- var doc = ifrm.contentDocument ? ifrm.contentDocument : ifrm.contentWindow.document;
- // reference to form named 'demoForm' in iframe
- try {
- var form = doc.getElementsByClassName('rc-anchor-center-container')[1].click();
- setTimeout(checkIfSolved, 500)
- } catch(e) {
- setTimeout(clickCaptcha, 500)
- }
- } else {
- setTimeout(clickCaptcha, 500)
- }
- };
- setTimeout(clickCaptcha, 700)`)
- }
- ipcMain.on("loadAutoCaptchaToSolver", function(event, checkoutURL) {
- loadCaptchaAuto(checkoutURL, 1)
- })
- ipcMain.on("loadNextAutoSolver", function(event, checkoutURL, sessionNumber) {
- var sessionNumber = sessionNumber + 1
- loadCaptchaAuto(checkoutURL, sessionNumber)
- })
- function waitForCaptchaAuto() {
- try {
- var settingsValues = app.ch.settings.getAll();
- var captchas = JSON.parse(settingsValues.captchas)
- for (i in captchas) {
- if (captchas[i].token == "Not Solved") {
- loadCaptchaAuto(i.split("|")[0], i.split("|")[1])
- updateCaptchaFileScript("Being Solved", i.split("|")[0])
- }
- }
- setTimeout(waitForCaptchaAuto, 500)
- } catch (e) {
- setTimeout(waitForCaptchaAuto, 500)
- }
- }
- //
- function updateCaptchaFileScript(captchaToken, checkoutURL) {
- var settingsValues = app.ch.settings.getAll()
- try {
- var captchaJSON = JSON.parse(settingsValues.captchas)
- } catch (e) {
- var captchaJSON = settingsValues.captchas
- }
- for (i in captchaJSON) {
- if (i.indexOf(checkoutURL) >= 0) {
- delete captchaJSON[i]
- }
- }
- captchaJSON[checkoutURL] = {
- token: captchaToken
- }
- app.ch.settings.set('captchas', JSON.stringify(captchaJSON));
- }
- app.on('ready', function(){
- createWaitWindow()
- settings.init()
- app.ch = {
- settings
- }
- createActivationWindow()
- })
- ipcMain.on('autoSolveCaptcha', (event, checkoutURL) => {
- loadAutoCaptcha(checkoutURL)
- })
- app.on('window-all-closed', function () {
- app.quit()
- })
- app.on('activate', function () {
- if (mainWindow === null) {
- createWindow()
- }
- })
- availableCaptchaWindows = []
- ipcMain.on("toggleCaptchaWindow1", function(event) {
- if ("1" in availableCaptchaWindows) {
- delete availableCaptchaWindows["1"]
- } else {
- availableCaptchaWindows.push("1")
- }
- })
- ipcMain.on("toggleCaptchaWindow2", function(event) {
- if ("2" in availableCaptchaWindows) {
- delete availableCaptchaWindows["2"]
- } else {
- availableCaptchaWindows.push("2")
- }
- })
- ipcMain.on("toggleCaptchaWindow3", function(event) {
- if ("3" in availableCaptchaWindows) {
- delete availableCaptchaWindows["3"]
- } else {
- availableCaptchaWindows.push("3")
- }
- })
- ipcMain.on("toggleCaptchaWindow4", function(event) {
- if ("4" in availableCaptchaWindows) {
- delete availableCaptchaWindows["4"]
- } else {
- availableCaptchaWindows.push("4")
- }
- })
- ipcMain.on("toggleCaptchaWindow5", function(event) {
- if ("5" in availableCaptchaWindows) {
- delete availableCaptchaWindows["5"]
- } else {
- availableCaptchaWindows.push("5")
- }
- })
- ipcMain.on("toggleCaptchaWindow6", function(event) {
- if ("6" in availableCaptchaWindows) {
- delete availableCaptchaWindows["6"]
- } else {
- availableCaptchaWindows.push("6")
- }
- })
- function createAutoCaptcha1() {
- captchaAutoWindow1 = new BrowserWindow({
- width: 500,
- height: 600,
- icon: __dirname + 'logo.png',
- show: true,
- minHeight: 500,
- minWidth: 600,
- webPreferences: {
- webSecurity: false,
- partition: 'persist:session1'
- }
- });
- captchaAutoWindow1.loadURL("https://accounts.google.com/ServiceLogin?hl=en&passive=true&continue=https://www.google.com/", {userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25"})
- }
- function createAutoCaptcha2() {
- captchaAutoWindow2 = new BrowserWindow({
- width: 500,
- height: 600,
- icon: __dirname + 'logo.png',
- show: true,
- minHeight: 500,
- minWidth: 600,
- webPreferences: {
- webSecurity: false,
- partition: 'persist:session2'
- }
- });
- captchaAutoWindow2.loadURL("https://accounts.google.com/ServiceLogin?hl=en&passive=true&continue=https://www.google.com/", {userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25"})
- }
- function createAutoCaptcha3() {
- captchaAutoWindow3 = new BrowserWindow({
- width: 500,
- height: 600,
- icon: __dirname + 'logo.png',
- show: true,
- minHeight: 500,
- minWidth: 600,
- webPreferences: {
- webSecurity: false,
- partition: 'persist:session3'
- }
- });
- captchaAutoWindow3.loadURL("https://accounts.google.com/ServiceLogin?hl=en&passive=true&continue=https://www.google.com/", {userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25"})
- }
- function createAutoCaptcha4() {
- captchaAutoWindow4 = new BrowserWindow({
- width: 500,
- height: 600,
- icon: __dirname + 'logo.png',
- show: true,
- minHeight: 500,
- minWidth: 600,
- webPreferences: {
- webSecurity: false,
- partition: 'persist:session4'
- }
- });
- captchaAutoWindow4.loadURL("https://accounts.google.com/ServiceLogin?hl=en&passive=true&continue=https://www.google.com/", {userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25"})
- }
- function createAutoCaptcha5() {
- captchaAutoWindow5 = new BrowserWindow({
- width: 500,
- height: 600,
- icon: __dirname + 'logo.png',
- show: true,
- minHeight: 500,
- minWidth: 600,
- webPreferences: {
- webSecurity: false,
- partition: 'persist:session5'
- }
- });
- captchaAutoWindow5.loadURL("https://accounts.google.com/ServiceLogin?hl=en&passive=true&continue=https://www.google.com/", {userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25"})
- }
- function createAutoCaptcha6() {
- captchaAutoWindow6 = new BrowserWindow({
- width: 500,
- height: 600,
- icon: __dirname + 'logo.png',
- show: true,
- minHeight: 500,
- minWidth: 600,
- webPreferences: {
- webSecurity: false,
- partition: 'persist:session6'
- }
- });
- captchaAutoWindow6.loadURL("https://accounts.google.com/ServiceLogin?hl=en&passive=true&continue=https://www.google.com/", {userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25"})
- }
- ipcMain.on('showAutoSolveCaptcha1', (event, checkoutURL) => {
- createAutoCaptcha1()
- })
- ipcMain.on('showAutoSolveCaptcha2', (event, checkoutURL) => {
- createAutoCaptcha2()
- })
- ipcMain.on('showAutoSolveCaptcha3', (event, checkoutURL) => {
- createAutoCaptcha3()
- })
- ipcMain.on('showAutoSolveCaptcha4', (event, checkoutURL) => {
- createAutoCaptcha4()
- })
- ipcMain.on('showAutoSolveCaptcha5', (event, checkoutURL) => {
- createAutoCaptcha5()
- })
- ipcMain.on('showAutoSolveCaptcha6', (event, checkoutURL) => {
- createAutoCaptcha6()
- })
- ipcMain.on("openMainWindow", function(event, body) {
- createMainWindow(body)
- })
- ipcMain.on("showActivationWindow", function(event) {
- waitWindow.hide()
- activationWindow.show()
- })
- ipcMain.on("showMainWindow", function(event) {
- waitWindow.hide()
- mainWindow.show()
- })
- ipcMain.on("minimizeMainWindow", function(event) {
- mainWindow.minimize();
- })
- ipcMain.on('closeWindow', (event) => {
- process.exit(1);
- })
- ipcMain.on('monitorUpdate', (event) => {
- process.exit(1);
- })
- ipcMain.on('captchaSolved', (event, token, checkoutURL) => {
- updateCaptchaFileScript(token, checkoutURL)
- try {
- captchaLoadScreen()
- } catch(e) {}
- })
- ipcMain.on('openVisualMonitor', (event) => {
- createMonitorWindow()
- })
- ipcMain.on('openCaptchaBox', (event) => {
- createCaptchaWindow()
- })
- ipcMain.on('loadCaptchaBox', (event, token) => {
- waitForCaptcha()
- })
- ipcMain.on('quickCreateRestockTaskToMain', (event, size, productURL, profile) => {
- console.log(profile)
- mainWindow.webContents.send('quickCreateRestockTask', size, productURL, profile)
- })
- //discord
- function createQuickTask(productURL){
- mainWindow.webContents.send('quickCreateTaskMonitor', productURL)
- }
- function manualSolveCaptcha(checkoutURL){
- var settingsValues = app.ch.settings.getAll();
- if (captchaWindowOpen == false){
- createCaptchaWindow()
- }
- try {
- var captchas = JSON.parse(settingsValues.captchas)
- for (i in captchas) {
- if (i.indexOf(checkoutURL) >= 0) {
- delete captchas[i]
- }
- }
- app.ch.settings.set("captchas", JSON.stringify(captchas))
- } catch (e) {}
- updateCaptchaFileScript("Not Solved", checkoutURL)
- }
- ipcMain.on('manualSolveCaptcha', (event, checkoutURL) => {
- var settingsValues = app.ch.settings.getAll();
- if (captchaWindowOpen == false){
- createCaptchaWindow()
- }
- try {
- var captchas = JSON.parse(settingsValues.captchas)
- for (i in captchas) {
- if (i.indexOf(checkoutURL) >= 0) {
- delete captchas[i]
- }
- }
- app.ch.settings.set("captchas", JSON.stringify(captchas))
- } catch (e) {}
- updateCaptchaFileScript("Not Solved", checkoutURL)
- })
- ipcMain.on('sendNeedCaptcha', (event, checkoutURL, autoCaptcha) => {
- //event.sender.send('loadCaptcha', checkoutURL, autoCaptcha)
- })
- ipcMain.on('massLinkChange', (event, link) => {
- mainWindow.webContents.send("massLinkChange", link)
- })
- ipcMain.on('openCheckoutFileExplorer', (event) => {
- try {
- var fileLocation = dialog.showOpenDialog({properties: ['openFile']})[0]
- event.sender.send('loadProfiles', fileLocation)
- } catch(e){
- }
- })
- ipcMain.on('checkCaptchaWindow', (event) => {
- if (captchaWindowOpen == false){
- createCaptchaWindow()
- }
- })
- ipcMain.on('openCheckoutSaveFileExplorer', (event) => {
- var fileLocation = dialog.showSaveDialog({properties: ['openFile']})
- event.sender.send('exportProfiles', fileLocation)
- })
- ipcMain.on('openTasksFileExplorer', (event) => {
- try {
- var fileLocation = dialog.showOpenDialog({properties: ['openFile']})[0]
- event.sender.send('loadTasks', fileLocation)
- } catch(e){
- }
- })
- ipcMain.on('openTasksSaveFileExplorer', (event) => {
- var fileLocation = dialog.showSaveDialog({properties: ['openFile']})
- event.sender.send('exportTasks', fileLocation)
- })
- ipcMain.on('openPaypalCheckout', (event) => {
- })
- ipcMain.on('showPaypalWindow', (event) => {
- paypalWindow
- .show()
- .goto("http://paypal.com")
- .wait("#btnLogin")
- .then(() => {
- })
- .catch(error => console.error(error))
- })
- ipcMain.on('startPaypalCheckout', (event, taskInfo) => {
- var cookies = taskInfo.sessionJar._jar.store.idx
- for (i in cookies) {
- var cookieSite = cookies[i]
- }
- mainWindow.webContents.send('updateLog', taskInfo.taskNumber, "Checking Out With Paypal")
- paypalWindow
- .goto(taskInfo.siteURL)
- .evaluate(function(cookieSite, paypalURL) {
- for (i in cookieSite) {
- for (i in cookieSite) {
- for (x in cookieSite[i]) {
- cookie = cookieSite[i][x]
- try {
- document.cookie = x + "=" + cookie.value;
- } catch (e) {}
- }
- }
- }
- window.location.href = paypalURL
- return "hi"
- }, cookieSite, taskInfo.paypalURL)
- .wait("#confirmButtonTop")
- .wait(1500)
- .evaluate(() => {
- document.getElementById("confirmButtonTop").click()
- })
- .wait("#previous_step")
- .evaluate(() => {
- document.getElementsByClassName("step__footer__continue-btn btn")[0].click()
- })
- .then(() => {
- mainWindow.webContents.send('updateLog', taskInfo.taskNumber, "Payment Submitted")
- })
- .catch(error => console.error(error))
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement