mirror of
https://github.com/HolographicHat/Yae.git
synced 2026-05-09 23:04:01 +08:00
Update
This commit is contained in:
1
native/.gitignore
vendored
1
native/.gitignore
vendored
@@ -3,3 +3,4 @@ CMakeLists.txt
|
||||
cmake-build-debug
|
||||
node_modules
|
||||
build
|
||||
src/homu.cpp
|
||||
|
||||
@@ -3,10 +3,12 @@
|
||||
{
|
||||
"target_name": "native",
|
||||
"sources": [
|
||||
"src/homu.h",
|
||||
"src/main.cc",
|
||||
"src/utils.h",
|
||||
"src/utils.cc",
|
||||
"src/define.h",
|
||||
"src/homu.cpp",
|
||||
"src/wmi/wmi.cpp",
|
||||
"src/wmi/wmi.hpp",
|
||||
"src/wmi/unistd.h",
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"scripts": {
|
||||
"build": "node-gyp rebuild && copy .\\build\\Release\\native.node ..\\genshin-export\\",
|
||||
"build-for-win7": "node-gyp rebuild --target=v14.17.0 && copy .\\build\\Release\\native.node ..\\genshin-export\\"
|
||||
"build": "node-gyp rebuild && copy .\\build\\Release\\native.node ..\\genshin-export\\generated",
|
||||
"build-for-win7": "node-gyp rebuild --target=v14.17.0 && copy .\\build\\Release\\native.node ..\\genshin-export\\generated"
|
||||
},
|
||||
"gypfile": true,
|
||||
"devDependencies": {
|
||||
|
||||
@@ -6,9 +6,10 @@
|
||||
#include <Windows.h>
|
||||
#include <TlHelp32.h>
|
||||
|
||||
using std::string, std::wstring, std::cout, std::to_string;
|
||||
using std::string, std::wstring, std::cout, std::to_string, std::unique_ptr, std::make_unique;
|
||||
using Napi::Object, Napi::Env, Napi::Function, Napi::Value, Napi::CallbackInfo, Napi::TypeError, Napi::Error;
|
||||
|
||||
typedef unsigned char byte;
|
||||
typedef unsigned int ui;
|
||||
typedef unsigned long ul;
|
||||
typedef unsigned long long ull;
|
||||
|
||||
11
native/src/homu.h
Normal file
11
native/src/homu.h
Normal file
@@ -0,0 +1,11 @@
|
||||
//
|
||||
// Created by holog on 2022/5/20.
|
||||
//
|
||||
#include "define.h"
|
||||
|
||||
Value Initialize(const CallbackInfo &info);
|
||||
|
||||
#ifndef GENSHIN_EXPORT_NATIVE_HOMU_H
|
||||
#define GENSHIN_EXPORT_NATIVE_HOMU_H
|
||||
|
||||
#endif //GENSHIN_EXPORT_NATIVE_HOMU_H
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "homu.h"
|
||||
#include "utils.h"
|
||||
#include "define.h"
|
||||
#include "wmi/wmi.hpp"
|
||||
@@ -218,7 +219,6 @@ namespace native {
|
||||
pAdapter = pAdapter->Next;
|
||||
continue;
|
||||
}
|
||||
auto addr = (char *) malloc(16);
|
||||
char *result;
|
||||
ToHex((char *)pAdapter->Address, 6, &result);
|
||||
auto ret = Napi::String::New(env, result);
|
||||
@@ -232,6 +232,7 @@ namespace native {
|
||||
Object init(Env env, Object exports) {
|
||||
exports.Set("pause", Function::New(env, Pause));
|
||||
exports.Set("openUrl", Function::New(env, OpenUrl));
|
||||
exports.Set("homuInit", Function::New(env, Initialize));
|
||||
exports.Set("getDeviceID", Function::New(env, GetDeviceID));
|
||||
exports.Set("getMACAddress", Function::New(env, GetMACAddress));
|
||||
exports.Set("getDeviceInfo", Function::New(env, GetDeviceInfo));
|
||||
|
||||
Reference in New Issue
Block a user