Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.DS_Store
node_modules
/build


# local env files
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

#Electron-builder output
/dist_electron
2 changes: 0 additions & 2 deletions README.md

This file was deleted.

63 changes: 63 additions & 0 deletions app/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* @Description:
* @Version: 1.0
* @Autor: solid
* @Date: 2022-08-19 11:46:56
* @LastEditors: solid
* @LastEditTime: 2022-11-01 15:47:52
*/
/**
* 服务器
*/
var express = require('express');
let deviceWSClientSet = require('../clients/device_clients.js');
const bodyParser = require("body-parser");
var app = express();
app.use(bodyParser.json()); //parse application/json
/**
* 加载数据库
*/
app.all("*", function (req, res, next) {
//设置允许跨域的域名,*代表允许任意域名跨域
res.header("Access-Control-Allow-Origin", "*");
//允许的header类型
res.header("Access-Control-Allow-Headers", "Origin,X-Requested-With,Accept,Content-type");
res.header("Access-Control-Allow-Credentials", true);
//跨域允许的请求方式
res.header("Access-Control-Allow-Methods", "PUT,POST,GET,DELETE,OPTIONS");
res.header("Content-Type", "application/json;charset=utf-8")
if (req.method.toLowerCase() == 'options')
res.sendStatus(200); //让options尝试请求快速结束
else
next();
});
app.get("/", function (req, res) {
res.send("开启!!!!!!!")
})
app.get('/list', (req, res) => {
let resp = {
code: 0,
data: deviceWSClientSet.getAllROOM(),
message: "success",
}
res.send(JSON.stringify(resp))
})
app.post('/updateNote', (req, res) => {
var { room, note } = req.body;
let resp = {
code: 0,
data: "",
message: "success"
}
var err = deviceWSClientSet.updateNote(room, note)
if (err) {
resp = {
code: 400,
data: "",
message: err
}
return res.send(JSON.stringify(resp))
}
res.send(JSON.stringify(resp))
})
module.exports = app
34 changes: 34 additions & 0 deletions clients/browser_clients.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* @Description:
* @Version: 1.0
* @Autor: solid
* @Date: 2022-08-18 14:45:08
* @LastEditors: solid
* @LastEditTime: 2022-11-09 13:40:59
*/
/**
* websocket客户端集合
* @constructor
*/
function browserWSClientSet() { }

// websocket客户端列表
browserWSClientSet.prototype.browser_client_map = {};
// 添加
browserWSClientSet.prototype.add = function (room, name, ws) {
if (!this.browser_client_map.hasOwnProperty(room)) {
this.browser_client_map[room] = {}
}
this.browser_client_map[room][name] = ws
};
// 获得指定客户端
browserWSClientSet.prototype.get = function (room, name) {
return this.browser_client_map[room][name];
};
// 移除
browserWSClientSet.prototype.remove = function (room, name) {
delete (this.browser_client_map[room][name])
};
let browserKeyDataClientSet = new browserWSClientSet();

module.exports = browserKeyDataClientSet;
62 changes: 62 additions & 0 deletions clients/device_clients.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* @Description:
* @Version: 1.0
* @Autor: solid
* @Date: 2022-08-18 14:45:08
* @LastEditors: solid
* @LastEditTime: 2022-11-01 15:47:04
*/
/**
* websocket客户端集合
* @constructor
*/
function deviceWSClientSet() { }

// websocket客户端列表
deviceWSClientSet.prototype.client_map = {};
// 添加
deviceWSClientSet.prototype.add = function (room, name, ws) {
if (!this.client_map.hasOwnProperty(room)) {
this.client_map[room] = {}
}
this.client_map[room][name] = ws
};
deviceWSClientSet.prototype.addInfo = function (room, note,os) {
this.client_map[room]["note"] = note
this.client_map[room]["os"] = os
};
// 获得指定客户端
deviceWSClientSet.prototype.get = function (room, name) {
return this.client_map[room][name];
};
deviceWSClientSet.prototype.getAllROOM = function () {
var connList = []
for (const key in this.client_map) {
var state = this.client_map[key].hasOwnProperty(key + "_target")
connList.push(
{
room: key,
note: this.client_map[key]['note'],
state: state,
os: this.client_map[key]['os'],
})
}
return connList
};
deviceWSClientSet.prototype.updateNote = function (room, note) {
try {
this.client_map[room]['note'] = note
return ""
} catch (error) {
return error
}

};
// 移除
deviceWSClientSet.prototype.remove = function (room, name) {
delete (this.client_map[room][name])
};
// 键盘指令websocket客户端对象
let deviceKeyDataClientSet = new deviceWSClientSet();

module.exports = deviceKeyDataClientSet;
60 changes: 60 additions & 0 deletions clients/file_clients.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* @Description:
* @Version: 1.0
* @Autor: solid
* @Date: 2022-08-18 14:45:08
* @LastEditors: solid
* @LastEditTime: 2022-11-03 18:20:14
*/
/**
* websocket客户端集合
* @constructor
*/
function deviceWSClientSet() { }

// websocket客户端列表
deviceWSClientSet.prototype.file_client_map = {};
// 添加
deviceWSClientSet.prototype.add = function (room, name, ws) {
if (!this.file_client_map.hasOwnProperty(room)) {
this.file_client_map[room] = {}
}
this.file_client_map[room][name] = ws
};
deviceWSClientSet.prototype.addNote = function (room, note) {
this.file_client_map[room]["note"] = note
};
// 获得指定客户端
deviceWSClientSet.prototype.get = function (room, name) {
return this.file_client_map[room][name];
};
deviceWSClientSet.prototype.getAllROOM = function () {
var connList = []
for (const key in this.file_client_map) {
var state = this.file_client_map[key].hasOwnProperty(key + "_target")
connList.push(
{
room: key,
note: this.file_client_map[key]['note'],
state: state
})
}
return connList
};
deviceWSClientSet.prototype.updateNote = function (room, note) {
try {
this.file_client_map[room]['note'] = note
return ""
} catch (error) {
return error
}

};
// 移除
deviceWSClientSet.prototype.remove = function (room, name) {
delete (this.file_client_map[room][name])
};
// 键盘指令websocket客户端对象
let deviceKeyDataClientSet = new deviceWSClientSet();

module.exports = deviceKeyDataClientSet;
60 changes: 60 additions & 0 deletions clients/screen_clients.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* @Description:
* @Version: 1.0
* @Autor: solid
* @Date: 2022-08-18 14:45:08
* @LastEditors: solid
* @LastEditTime: 2022-11-01 18:04:21
*/
/**
* websocket客户端集合
* @constructor
*/
function deviceWSClientSet() { }

// websocket客户端列表
deviceWSClientSet.prototype.screen_client_map = {};
// 添加
deviceWSClientSet.prototype.add = function (room, name, ws) {
if (!this.screen_client_map.hasOwnProperty(room)) {
this.screen_client_map[room] = {}
}
this.screen_client_map[room][name] = ws
};
deviceWSClientSet.prototype.addNote = function (room, note) {
this.screen_client_map[room]["note"] = note
};
// 获得指定客户端
deviceWSClientSet.prototype.get = function (room, name) {
return this.screen_client_map[room][name];
};
deviceWSClientSet.prototype.getAllROOM = function () {
var connList = []
for (const key in this.screen_client_map) {
var state = this.screen_client_map[key].hasOwnProperty(key + "_target")
connList.push(
{
room: key,
note: this.screen_client_map[key]['note'],
state: state
})
}
return connList
};
deviceWSClientSet.prototype.updateNote = function (room, note) {
try {
this.screen_client_map[room]['note'] = note
return ""
} catch (error) {
return error
}

};
// 移除
deviceWSClientSet.prototype.remove = function (room, name) {
delete (this.screen_client_map[room][name])
};
// 键盘指令websocket客户端对象
let deviceKeyDataClientSet = new deviceWSClientSet();

module.exports = deviceKeyDataClientSet;
33 changes: 33 additions & 0 deletions decryption_GO/decrypter/dataBlob.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* @Description:
* @Version: 1.0
* @Autor: solid
* @Date: 2022-10-09 15:44:17
* @LastEditors: solid
* @LastEditTime: 2022-10-09 15:44:32
*/
package decrypter

import "unsafe"

type dataBlob struct {
cbData uint32
pbData *byte
}

func NewBlob(d []byte) *dataBlob {
if len(d) == 0 {
return &dataBlob{}
}
return &dataBlob{
pbData: &d[0],
cbData: uint32(len(d)),
}
}

//转字节数组
func (b *dataBlob) ToByteArray() []byte {
d := make([]byte, b.cbData)
copy(d, (*[1 << 30]byte)(unsafe.Pointer(b.pbData))[:])
return d
}
Loading