Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const electron = require('electron')
- const app = electron.app
- const BrowserWindow = electron.BrowserWindow
- class LicenceItem {
- constructor(line) {
- var temp = line.split("|")
- this.companyName = temp[0]
- this.version = temp[1]
- this.beginDate = temp[2]
- this.endDate = temp[3]
- this.adapters = temp[4]
- this.idkWhatThisis = temp[5]
- this.licence = temp[6]
- }
- }
- class Adapter {
- constructor(line) {
- let temp = line.split("|")
- this.adapterName = temp[0],
- this.adapterID = temp[1]
- this.isInLicence = false;
- }
- checkLicence(LicenseCode) {
- this.isInLicence = (adapterID & code != 0) ? true : flase
- }
- }
- class LicenceList {
- constructor() {
- this.licences = null
- this.adapters = null
- this.currentLicence = null
- this.loadLicences.bind(this)
- this.loadAdapters.bind(this)
- }
- loadLicences(fileName) {
- let data = []
- const fs = require('fs')
- const readline = require('readline');
- const rl = readline.createInterface({
- input: fs.createReadStream(fileName),
- crlfDelay: Infinity
- });
- rl.on('line', (line) => {
- data.push(new LicenceItem(line))
- })
- rl.on('close', () => {
- this.licences = data
- console.log(this.licences)
- })
- }
- loadAdapters(fileName) {
- let data = []
- const fs = require('fs')
- const readline = require('readline');
- const rl = readline.createInterface({
- input: fs.createReadStream(fileName),
- crlfDelay: Infinity
- });
- rl.on('line', (line) => {
- data.push(new Adapter(line))
- })
- rl.on('close', _ => {
- this.adapters = data
- console.log(this.adapters)
- })
- }
- }
- async function getLicenses() {
- myLicences = new LicenceList()
- myLicences.loadLicences('./res/licenceKeyLog.txt')
- myLicences.loadAdapters('./res/adapters.txt')
- console.log(myLicences)
- }
- myTests();
- // let mainWindow
- // app.on('ready', _ => {
- // mainWindow = new BrowserWindow({
- // height: 400,
- // width: 600
- // })
- // mainWindow.on('close', _ => {
- // mainWindow = null
- // })
- // })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement