Compare commits
127 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d46a2bdc44 | ||
|
|
bb383c5c0a | ||
|
|
4b42d0f8b8 | ||
|
|
3d0f8a3ff6 | ||
|
|
56b0c78661 | ||
|
|
ffc37cc203 | ||
|
|
8faaba2849 | ||
|
|
9d86d9c9ff | ||
|
|
8ff1a47fff | ||
|
|
12da09596d | ||
|
|
bd54a78e4b | ||
|
|
bb74553bee | ||
|
|
d373f46615 | ||
|
|
a1b0fec871 | ||
|
|
bae193050f | ||
|
|
fc5ffae1e2 | ||
|
|
ab0e05ffe1 | ||
|
|
88a1740b91 | ||
|
|
f24f3af377 | ||
|
|
9bdb18d4d6 | ||
|
|
7cbb600a7f | ||
|
|
33c733ce97 | ||
|
|
abafc94379 | ||
|
|
411e11dd8d | ||
|
|
b2453e7c4d | ||
|
|
30476a86ad | ||
|
|
375e15e947 | ||
|
|
fd87adc1f6 | ||
|
|
b903c27a22 | ||
|
|
5bf7019482 | ||
|
|
be633eeea5 | ||
|
|
58e683c669 | ||
|
|
cd5c2985e5 | ||
|
|
e41a89b26c | ||
|
|
4d05063b61 | ||
|
|
53e2b0cbed | ||
|
|
51d00add22 | ||
|
|
4fc90ee333 | ||
|
|
0ec8782f48 | ||
|
|
33c67eef06 | ||
|
|
a703843eed | ||
|
|
ba2a8b7fec | ||
|
|
b3585927ca | ||
|
|
d4e284663e | ||
|
|
4c9dad49c4 | ||
|
|
960fcae647 | ||
|
|
4172ee9106 | ||
|
|
8566e7f35e | ||
|
|
065043bbe9 | ||
|
|
2c3a23e841 | ||
|
|
0b2296f918 | ||
|
|
6f997a38d3 | ||
|
|
cd128741b4 | ||
|
|
174a7b5163 | ||
|
|
e75474fde7 | ||
|
|
c3119ce7a7 | ||
|
|
6c4b546de2 | ||
|
|
30388eb6a9 | ||
|
|
f35b596eb2 | ||
|
|
3008f50e1f | ||
|
|
99293ad7cf | ||
|
|
99687f0550 | ||
|
|
6124d6949c | ||
|
|
afdbc5ad80 | ||
|
|
dd56af8fcb | ||
|
|
487b36a37e | ||
|
|
850b282b70 | ||
|
|
e0272aa38a | ||
|
|
27d7c32a73 | ||
|
|
936c533ff8 | ||
|
|
1c0edd2bcd | ||
|
|
8ac4d063a4 | ||
|
|
bb9a044e05 | ||
|
|
4f63e55a28 | ||
|
|
a3e1898d82 | ||
|
|
5bca75629c | ||
|
|
0c1fb3e25e | ||
|
|
9558fb0eaf | ||
|
|
f0d08f5e67 | ||
|
|
2af33ccc33 | ||
|
|
8f6ae91a8a | ||
|
|
49e77366d1 | ||
|
|
a826c8e835 | ||
|
|
bdc7c28ba7 | ||
|
|
1fb8a49a20 | ||
|
|
c57a4ac56d | ||
|
|
b72dfb8802 | ||
|
|
b00325ca68 | ||
|
|
8eaab56787 | ||
|
|
9ea92a23ee | ||
|
|
5d2f803f3c | ||
|
|
29716c43b6 | ||
|
|
2590082041 | ||
|
|
0ec9ef92ee | ||
|
|
98f530eb0c | ||
|
|
d9416b4fb6 | ||
|
|
73a7d08b8e | ||
|
|
3931fa25d6 | ||
|
|
84c3645ae2 | ||
|
|
54b20a93ef | ||
|
|
20130061ab | ||
|
|
e2393d7900 | ||
|
|
a42718f6c5 | ||
|
|
de81f9bcac | ||
|
|
3aeacad28c | ||
|
|
27cbd4705b | ||
|
|
24c578b411 | ||
|
|
a6a33a9886 | ||
|
|
17ea745e23 | ||
|
|
98a948d377 | ||
|
|
eaa3a4299b | ||
|
|
bbf4c7033a | ||
|
|
cbd05d2c42 | ||
|
|
f6b80e1fac | ||
|
|
241b2b07bd | ||
|
|
ec2f0f3ff8 | ||
|
|
578d17764c | ||
|
|
63f2a3a573 | ||
|
|
b034c73c72 | ||
|
|
3b99b9137a | ||
|
|
39376aed8c | ||
|
|
4e1053761f | ||
|
|
8f648c16da | ||
|
|
68fb7dd36a | ||
|
|
1327c077a7 | ||
|
|
12305c0dc9 | ||
|
|
15d53273d0 |
@@ -13,6 +13,8 @@ trim_trailing_whitespace = false
|
||||
[*.rs]
|
||||
max_line_length = 100
|
||||
indent_size = 2
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[{*.ats,*.cts,*.mts,*.ts}]
|
||||
indent_size = 2
|
||||
|
||||
@@ -33,6 +33,27 @@
|
||||
"semi": [
|
||||
"error",
|
||||
"never"
|
||||
],
|
||||
"@typescript-eslint/ban-types": [
|
||||
"warn",
|
||||
{
|
||||
"extendDefaults": true,
|
||||
"types": {
|
||||
"{}": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"warn",
|
||||
{
|
||||
"argsIgnorePattern": "^_",
|
||||
"varsIgnorePattern": "^_"
|
||||
}
|
||||
]
|
||||
},
|
||||
"settings": {
|
||||
"react": {
|
||||
"version": "detect"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
62
.github/workflows/backend-checks.yml
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
name: Check backend
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- ".github/workflows/backend-checks.yml"
|
||||
- "src-tauri/**"
|
||||
pull_request:
|
||||
paths:
|
||||
- ".github/workflows/backend-checks.yml"
|
||||
- "src-tauri/**"
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.ref }}-${{ github.workflow }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
rustfmt:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: fmt
|
||||
args: --manifest-path ./src-tauri/Cargo.toml --all -- --check
|
||||
|
||||
clippy:
|
||||
runs-on: ${{ matrix.platform }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: [windows-latest, ubuntu-latest, macos-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install Linux dependencies
|
||||
if: matrix.platform == 'ubuntu-latest'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libwebkit2gtk-4.0-dev \
|
||||
build-essential \
|
||||
curl \
|
||||
wget \
|
||||
libssl-dev \
|
||||
libgtk-3-dev \
|
||||
libayatana-appindicator3-dev \
|
||||
librsvg2-dev
|
||||
|
||||
- uses: Swatinem/rust-cache@v1
|
||||
with:
|
||||
working-directory: src-tauri
|
||||
|
||||
- uses: actions-rs/clippy-check@v1
|
||||
with:
|
||||
name: clippy (${{ runner.os }})
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
args: --manifest-path ./src-tauri/Cargo.toml --no-default-features -- -D warnings
|
||||
|
||||
37
.github/workflows/frontend-checks.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
name: Check frontend
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- ".github/workflows/frontend-checks.yml"
|
||||
- "src/**"
|
||||
- ".eslintrc.json"
|
||||
- "package.json"
|
||||
- "tsconfig.json"
|
||||
- "yarn.lock"
|
||||
pull_request:
|
||||
paths:
|
||||
- ".github/workflows/frontend-checks.yml"
|
||||
- "src/**"
|
||||
- ".eslintrc.json"
|
||||
- "package.json"
|
||||
- "tsconfig.json"
|
||||
- "yarn.lock"
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.ref }}-${{ github.workflow }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
tsc-eslint-checks:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install modules
|
||||
run: yarn
|
||||
- name: Run tsc
|
||||
run: yarn tsc --noEmit
|
||||
- name: Run ESLint
|
||||
run: yarn eslint src
|
||||
|
||||
3
.gitignore
vendored
@@ -23,4 +23,5 @@ yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# moved lang files
|
||||
/lang
|
||||
/lang
|
||||
package-lock.json
|
||||
|
||||
32
.idea/inspectionProfiles/Project_Default.xml
generated
@@ -3,6 +3,38 @@
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="HtmlUnknownBooleanAttribute" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="HttpUrlsUsage" enabled="true" level="WEAK WARNING" enabled_by_default="true">
|
||||
<option name="ignoredUrls">
|
||||
<list>
|
||||
<option value="http://localhost" />
|
||||
<option value="http://127.0.0.1" />
|
||||
<option value="http://0.0.0.0" />
|
||||
<option value="http://www.w3.org/" />
|
||||
<option value="http://json-schema.org/draft" />
|
||||
<option value="http://java.sun.com/" />
|
||||
<option value="http://xmlns.jcp.org/" />
|
||||
<option value="http://javafx.com/javafx/" />
|
||||
<option value="http://javafx.com/fxml" />
|
||||
<option value="http://maven.apache.org/xsd/" />
|
||||
<option value="http://maven.apache.org/POM/" />
|
||||
<option value="http://www.springframework.org/schema/" />
|
||||
<option value="http://www.springframework.org/tags" />
|
||||
<option value="http://www.springframework.org/security/tags" />
|
||||
<option value="http://www.thymeleaf.org" />
|
||||
<option value="http://www.jboss.org/j2ee/schema/" />
|
||||
<option value="http://www.jboss.com/xml/ns/" />
|
||||
<option value="http://www.ibm.com/webservices/xsd" />
|
||||
<option value="http://activemq.apache.org/schema/" />
|
||||
<option value="http://schema.cloudfoundry.org/spring/" />
|
||||
<option value="http://schemas.xmlsoap.org/" />
|
||||
<option value="http://cxf.apache.org/schemas/" />
|
||||
<option value="http://primefaces.org/ui" />
|
||||
<option value="http://tiles.apache.org/" />
|
||||
<option value="http://api.grasscutter.io" />
|
||||
<option value="http://api.grasscutters.xyz" />
|
||||
</list>
|
||||
</option>
|
||||
</inspection_tool>
|
||||
<inspection_tool class="JSIgnoredPromiseFromCall" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
</profile>
|
||||
</component>
|
||||
35
README.md
@@ -1,26 +1,19 @@
|
||||
# NOTICE
|
||||
Yes! The Cultivation repository is **open**. This does **not** mean it has released.\
|
||||
Cultivation will be releasing at some point after opening this repo.
|
||||
|
||||
**This also means you will not be provided explicit support for Cultivation.**\
|
||||
Consider Cultivation to be the bleeding-edge version of GrassClipper.
|
||||
|
||||
During this open-beta testing period, **helpful issues are appreciated**, while unhelpful ones will be closed.
|
||||
|
||||
## Fair Warning
|
||||
Cultivation is **VERY MUCH IN BETA** and a majority of features do not work.\
|
||||
There are **no official releases of Cultivation**. You are **required** to build the application from **scratch**.\
|
||||
Please do **NOT install, download, or use pre-compiled versions of Cultivation**. Only use releases from this GitHub repository.
|
||||
# Cient Patching Notice
|
||||
For game versions 2.8 and above, Cultivation automatically makes a small patch to your game client when launching using Grasscutter, and restores it upon closing the game. In theory, you should still be totally safe, however it would be dishonest to not explicitly state that **modifying the game client could, theoretically, lead to a ban if you connect to official servers with it**. It is extremely unlikely AND there are no instances known of it happening, but the possibility exists.
|
||||
|
||||
# Cultivation
|
||||
A game launcher designed to easily proxy traffic from anime game to private servers.
|
||||
|
||||
While the Cultivation repository is **open**. This does **not** mean it has released.
|
||||
Please do **NOT install, download, or use pre-compiled versions of Cultivation found elsewhere**. Only use releases from this GitHub repository.
|
||||
|
||||
# Table Of Contents
|
||||
* [Download](#download)
|
||||
* [Developer Quick-start](#developer-quickstart)
|
||||
* [Setup](#setup)
|
||||
* [Building](#building)
|
||||
* [Troubleshooting](#troubleshooting)
|
||||
* [Theming](#theming)
|
||||
|
||||
# Download
|
||||
[Find release builds here!](https://github.com/Grasscutters/Cultivation/releases)
|
||||
@@ -30,15 +23,21 @@ Once downloaded, extract somewhere and open as administrator.
|
||||
# Developer Quickstart
|
||||
|
||||
### Setup
|
||||
* Install [NodeJS >12](https://nodejs.org/en/)
|
||||
* Install [yarn](https://classic.yarnpkg.com/lang/en/docs/install/#debian-stable) (cry about it `npm` lovers)
|
||||
* Install [Cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html) & [Rust compiler](https://www.rust-lang.org/tools/install)
|
||||
* `npm install` or `yarn install`
|
||||
* `npm run start:dev` or `yarn start:dev`
|
||||
* `yarn install`
|
||||
* `yarn start:dev`
|
||||
|
||||
### Building
|
||||
`npm run build` or `yarn build`
|
||||
|
||||
Add `--release` or `--debug` depending on what release you are creating. This defaults to `--release`
|
||||
|
||||
### Code Formatting and Linting
|
||||
|
||||
Format the code with `npm format` or `yarn format`. Run the lints with `npm lint` or `yarn lint`.
|
||||
|
||||
### Updating
|
||||
* Add the `TAURI_PRIVATE_KEY` as an environment variable with a path to your private key.
|
||||
* Add the `TAURI_KEY_PASSWORD` as an environment variable with the password for your private key.
|
||||
@@ -48,6 +47,10 @@ Add `--release` or `--debug` depending on what release you are creating. This de
|
||||
# Troubleshooting
|
||||
TODO. Collect common issues before updating.
|
||||
|
||||
# Theming
|
||||
|
||||
A full theming reference can be found [here!](/THEMES.md)
|
||||
|
||||
# Screenshots
|
||||

|
||||

|
||||
@@ -58,4 +61,4 @@ TODO. Collect common issues before updating.
|
||||
## Credits
|
||||
* [SpikeHD](https://github.com/SpikeHD): For originally creating **GrassClipper** and creating the amazing UI of Cultivation.
|
||||
* [KingRainbow44](https://github.com/KingRainbow44): For building a proxy daemon from scratch and integrating it with Cultivation.
|
||||
* [Tauri](https://tauri.app): For providing an amazing, efficient, and simple desktop application framework/library.
|
||||
* [Tauri](https://tauri.app): For providing an amazing, efficient, and simple desktop application framework/library.
|
||||
|
||||
106
THEMES.md
Normal file
@@ -0,0 +1,106 @@
|
||||
# Downloading/Installing Themes
|
||||
|
||||
1. Download your favorite theme! (You can find some in the `#themes` channel on Discord)
|
||||
2. Place the unzipped theme folder inside of `%appdata%/cultivation/themes` (The path should look something like this: `cultivation/themes/theme_name/index.json`)
|
||||
4. Enable within Cultivation!
|
||||
|
||||
# Creating your own theme
|
||||
|
||||
Themes support entirely custom JS and CSS, enabling you to potentially change every single thing about Cultivation with relative ease.
|
||||
|
||||
You can refer to the example theme [found here.](https://cdn.discordapp.com/attachments/992943872479084614/992993575652565002/Example.zip)
|
||||
|
||||
You will need CSS and JS experience if you want to do anything cool.
|
||||
|
||||
## Creating index.json
|
||||
|
||||
`index.json` is where you tell Cultivation which files and images to include. It supports the following properties:
|
||||
|
||||
| Property | Description |
|
||||
| :--- | :--- |
|
||||
| `name` | The name of the theme. |
|
||||
| `version` | Not shown anywhere, the version of the theme. |
|
||||
| `description` | Not shown anywhere, the description of the theme. |
|
||||
| `includes` | The files and folders to include. |
|
||||
| `includes.css` | Array of CSS files to include. Example: `css: ["index.css"]` |
|
||||
| `includes.js` | Array of JS files to includes. Example `js: ["index.js"]` |
|
||||
| `customBackgroundURL` | A custom image URL to set as the background. Backgrounds that users set in their config supercede this. Example: `"https://website.com/image.png"` |
|
||||
| `customBackgroundFile` | Path to a custom background image file. Backgrounds that users set in their config supercede this. Example: `"/image.png"` |
|
||||
|
||||
A full, complete `index.json` will look something like this:
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "Example",
|
||||
"version": "1.0.0",
|
||||
"description": "This is an example theme. Made by SpikeHD.",
|
||||
"includes": {
|
||||
"css": ["/index.css"],
|
||||
"js": ["/index.js"]
|
||||
},
|
||||
"customBackgroundURL": "https://website.com/image.png",
|
||||
"customBackgroundFile": "/image.png"
|
||||
}
|
||||
```
|
||||
|
||||
**Important Note:**
|
||||
All paths are relative to the theme folder. This means you only need to do `"/index.css"` to include `index.css` from the same folder `index.json` is located.
|
||||
|
||||
## Writing your CSS
|
||||
|
||||
You are welcome to use the DevTools to debug your theme, or view what properties an element has already, etc.
|
||||
|
||||
Below are some small examples of what you can do:
|
||||
|
||||
```css
|
||||
/* Change the font */
|
||||
body {
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
|
||||
}
|
||||
```
|
||||
```css
|
||||
/* Remove the news section */
|
||||
.NewsSection {
|
||||
display: none;
|
||||
}
|
||||
```
|
||||
```css
|
||||
/* Change the right bar width */
|
||||
.RightBar {
|
||||
width: 300px;
|
||||
}
|
||||
```
|
||||
|
||||
## How can I change XYZ element?
|
||||
Every element is documented and describe [here](/docs/elementIds.md). Every\* single DOM element is assigned an ID to allow for easy and hyper-specific editing.
|
||||
|
||||
## Writing your JS
|
||||
|
||||
There are no limitations to what you can do with JS. It is safe, as it is sandboxed within the webpage, so there is no possibility of it being able to do anything more than what any regular webpage can do.
|
||||
|
||||
Below are some examples of what you can do:
|
||||
|
||||
```js
|
||||
/* Change the version number every 500ms */
|
||||
setInterval(() => {
|
||||
document.getElementById("version").innerHTML = "v" + Math.floor(Math.random() * 100);
|
||||
}, 500);
|
||||
```
|
||||
```js
|
||||
/* Load a custom font */
|
||||
const head = document.head
|
||||
const link = document.createElement("link")
|
||||
|
||||
link.href = "https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap"
|
||||
link.rel = "stylesheet"
|
||||
link.type = "text/css"
|
||||
|
||||
head.appendChild(link)
|
||||
```
|
||||
```js
|
||||
/* Create a new button that does nothing */
|
||||
const newButton = document.createElement("button");
|
||||
newButton.innerHTML = "New Button";
|
||||
|
||||
document.body.appendChild(newButton);
|
||||
```
|
||||
133
docs/elementIds.md
Normal file
@@ -0,0 +1,133 @@
|
||||
# Documentation of Element ID's and Classes for custom theming
|
||||
|
||||
## IDs
|
||||
This does not include commonly used components (buttons, divider lines, commit author and message, etc...) for accessing and modifying those elements, please check `Classes` section bellow.
|
||||
|
||||
| #ID | Description |
|
||||
|----------------------------------------|-----------------------------------------------------------------|
|
||||
| `#miniDialogContainer` | Main container of MiniDialog |
|
||||
| `#miniDialogContainerTop` | Affects only top section of MiniDialog |
|
||||
| `#miniDialogButtonClose` | Close button (SVG) of MiniDialog |
|
||||
| `#miniDialogContent` | MiniDialog content |
|
||||
| `#rightBarContainer` | Main container of RightBar |
|
||||
| `#rightBarContent` | RightBar content |
|
||||
| `#rightBarButtonDiscord` | Discord button on the RightBar |
|
||||
| `#rightBarButtonGithub` | Github button on the RightBar |
|
||||
| `#playButton` | Main container for whole launch buttons section |
|
||||
| `#serverControls` | Container of "play on grasscutter" checkbox |
|
||||
| `#enableGC` | "play on grasscutter" checkbox |
|
||||
| `#ip` | Server ip input if play on grasscutter is enabled |
|
||||
| `#port` | Server port input if play on grasscutter is enabled |
|
||||
| `#httpsEnable` | "Enable https" checkbox if play on grasscutter is enabled |
|
||||
| `#officialPlay` | Launch button |
|
||||
| `#serverLaunch` | Launch server button |
|
||||
| `#serverlaunchIcon` | Icon (SVG) of server launch button |
|
||||
| `#serverConfigContainer` | Main container of server configuration section |
|
||||
| `#serverLaunchContainer` | Main container of launch buttons (includes launch server) |
|
||||
| `#topBarContainer` | Main container of launcher TopBar (minimize, exit, settings...) |
|
||||
| `#title` | Title of the TopBar |
|
||||
| `#version` | Version of the launcher in TopBar |
|
||||
| `#topBarButtonContainer` | Container of launcher TopBar buttons only |
|
||||
| `#closeBtn` | Exit launcher button |
|
||||
| `#minBtn` | Minimize launcher button |
|
||||
| `#settingsBtn` | Settings button |
|
||||
| `#downloadsBtn` | Downloads button (grasscutter resources, grasscutter...) |
|
||||
| `#newsContainer` | Main container of the news section |
|
||||
| `#newsTabsContainer` | Container for news tabs |
|
||||
| `#commits` | News tabs container commits button |
|
||||
| `#latest_version` | News tabs for latest version button |
|
||||
| `#newsContent` | Content section of news container |
|
||||
| `#newsCommitsTable` | Commits table of news section |
|
||||
| `#downloadMenuContainerGCStable` | Grasscutter stable update container |
|
||||
| `#downloadMenuLabelGCStable` | Label for stable update button |
|
||||
| `#downloadMenuButtonGCStable` | Button container for stable update button |
|
||||
| `#grasscutterStableBtn` | "Update grasscutter stable" button |
|
||||
| `#downloadMenuContainerGCDev` | Grasscutter development update container |
|
||||
| `#downloadMenuLabelGCDev` | Label for latest update button |
|
||||
| `#downloadMenuButtonGCDev` | Button container for latest update button |
|
||||
| `grasscutterLatestBtn` | "Update grasscutter latest" button |
|
||||
| `#downloadMenuContainerGCStableData` | Grasscutter stable data update container |
|
||||
| `#downloadMenuLabelGCStableData` | Label for stable data update |
|
||||
| `#downloadMenuButtonGCStableData` | Button container for stable data update button |
|
||||
| `#grasscutterStableRepo` | "Update grasscutter stable data" button |
|
||||
| `#downloadMenuContainerGCDevData` | Grasscutter latest data update container |
|
||||
| `#downloadMenuLabelGCDevData` | Label for latest data update |
|
||||
| `#downloadMenuButtonGCDevData` | Button container for latest data update button |
|
||||
| `#grasscutterDevRepo` | "Update grasscutter latest data" button |
|
||||
| `#downloadMenuContainerResources` | Container for grasscutter resources download |
|
||||
| `#downloadMenuLabelResources` | label for resources download |
|
||||
| `#downloadMenuButtonResources` | Button container for resources download button |
|
||||
| `#resourcesBtn` | "Download grasscutter resources" button |
|
||||
| `#menuContainer` | Generic Popup modal like menu container |
|
||||
| `#menuContainerTop` | Top section of menu container |
|
||||
| `#menuHeading` | Menu title |
|
||||
| `#menuButtonCloseContainer` | Container for menu close button |
|
||||
| `#menuButtonCloseIcon` | Menu close icon (SVG) |
|
||||
| `#menuContent` | Content section of the menu |
|
||||
| `#menuOptionsContainerGameExec` | Container for game executable option section |
|
||||
| `#menuOptionsLabelGameExec` | Label for game executable option |
|
||||
| `#menuOptionsDirGameExec` | Set game executable file browser |
|
||||
| `#menuOptionsContainerGCJar` | Container for grasscutter jar option |
|
||||
| `#menuOptionsLabelGCJar` | Label for grasscutter jar option |
|
||||
| `#menuOptionsDirGCJar` | Set grasscutter jar file browser |
|
||||
| `#menuOptionsContainerToggleEnc` | Container for toggle encryption option |
|
||||
| `#menuOptionsLabelToggleEnc` | Label for toggle encryption option |
|
||||
| `#menuOptionsButtonToggleEnc` | Toggle encryption button container |
|
||||
| `#toggleEnc` | Toggle encryption button |
|
||||
| `#menuOptionsContainerGCWGame` | Container for "grasscutter with game" option |
|
||||
| `#menuOptionsLabelGCWDame` | Label for "grasscutter with game" option |
|
||||
| `#menuOptionsCheckboxGCWGame` | Container for "grasscutter with game" option checkbox |
|
||||
| `#gcWithGame` | Grasscutter with game checkbox |
|
||||
| `#menuOptionsContainerThemes` | Container for themes section |
|
||||
| `#menuOptionsLabelThemes` | Label for set themes option |
|
||||
| `#menuOptionsSelectThemes` | Container for themes select menu |
|
||||
| `#menuOptionsSelectMenuThemes` | Set theme select menu |
|
||||
| `#menuOptionsContainerJavaPath` | Container for Java Path option |
|
||||
| `#menuOptionsLabelJavaPath` | Label for Java path option |
|
||||
| `#menuOptionsDirJavaPath` | Container for java path file browser |
|
||||
| `#menuOptionsContainerBG` | Container for Background option |
|
||||
| `#menuOptionsLabelBG` | Label for background option |
|
||||
| `#menuOptionsDirBG` | Container for background url/local path option |
|
||||
| `#menuOptionsContainerLang` | Container for language change option |
|
||||
| `#menuOptionsLabelLang` | Label for language change option |
|
||||
| `#menuOptionsSelectLang` | Container for language change select menu |
|
||||
| `#menuOptionsSelectMenuLang` | Language select menu |
|
||||
| `#DownloadProgress` | Download progress container |
|
||||
| `#bottomSectionContainer` | Bottom section container |
|
||||
| `#miniDownloadContainer` | Container for mini download |
|
||||
|
||||
## Classes
|
||||
This is not full list of all classes, rather its list of classes for commonly used components that can not be accessed using element id system.
|
||||
|
||||
| .Class | Description |
|
||||
|-----------------------------|---------------------------------------------------------|
|
||||
| `.BigButton` | Class for all buttons |
|
||||
| `.BigButtonText` | Text inside a button | |
|
||||
| `.Checkbox` | Checkbox container |
|
||||
| `.CheckboxDisplay` | Content of checkbox |
|
||||
| `.DirInput` | Container for DirInput |
|
||||
| `.FileSelectIcon` | Icon of DirInput |
|
||||
| `.DownloadList` | List of all downloads |
|
||||
| `.DownloadSection` | Container for each download |
|
||||
| `.DownloadTitle` | Contains file download path and current status |
|
||||
| `.DownloadPath` | Path of a download |
|
||||
| `.DownloadStatus` | Status of a download |
|
||||
| `.DownloadSectionInner` | Contains progressbar of the download section |
|
||||
| `.HelpSection` | Container for help "?" circle button |
|
||||
| `.HelpButton` | HelpButton itself |
|
||||
| `.HelpContents` | Content of help button once expanded |
|
||||
| `.MainProgressBarWrapper` | Container for MainProgressBar |
|
||||
| `.ProgressBar` | ProgressBar (creativity left the brain) |
|
||||
| `.InnerProgress` | ProgressBar percentage |
|
||||
| `.MainProgressText` | Text for MainProgressBar |
|
||||
| `.ProgressBarWrapper` | Container for ProgressBar |
|
||||
| `.DownloadControls` | DownloadControls of ProgressBar |
|
||||
| `.downloadStop` | Container for download stop icon (SVG) |
|
||||
| `.ProgressText` | Text of the ProgressBar display current download status |
|
||||
| `.TextInputWrapper` | Container for TextInput |
|
||||
| `.TextClear` | Container for clear input content button |
|
||||
| `.TextInputClear` | TextInput clear button icon (SVG) |
|
||||
| `.Divider` | Container for line dividers |
|
||||
| `.DividerLine` | Divider line itself |
|
||||
| `.CommitAuthor` | Author of a commit |
|
||||
| `.CommitMessage` | Message of a commit |
|
||||
@@ -1,9 +1,14 @@
|
||||
# Troubleshooting
|
||||
A guide dedicated for trying to troubleshoot Cultivation.
|
||||
|
||||
## The launcher doesn't appear to open.
|
||||
Try running the launcher with **administrative privileges**.\
|
||||
If this fixes your issue, you can force enable it in the **Compatability**\
|
||||
tab for the launcher's executable.
|
||||
|
||||
## Unable to play on `localhost`.
|
||||
Make sure your server is running with **encryption disabled**.\
|
||||
Additionally, make sure Cultivation **is not using HTTPS**.
|
||||
Make sure your server is running with **encryption disabled** and `useInRouting` to **false**.\
|
||||
Additionally, make sure Cultivation **is set to not use HTTPS**.
|
||||
|
||||
## "I can't do anything requiring the internet after closing Cultivation!"
|
||||
You probably didn't close Cultivation properly.\
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cultivation",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.2",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "^1.0.0-rc.5",
|
||||
@@ -27,7 +27,9 @@
|
||||
"test": "react-scripts test",
|
||||
"eject": "react-scripts eject",
|
||||
"tauri": "tauri",
|
||||
"start:dev": "tauri dev"
|
||||
"start:dev": "tauri dev",
|
||||
"format": "cargo fmt --manifest-path ./src-tauri/Cargo.toml --all",
|
||||
"lint": "cargo clippy --manifest-path ./src-tauri/Cargo.toml --no-default-features && yarn tsc --noEmit && yarn eslint src"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
|
||||
1339
src-tauri/Cargo.lock
generated
@@ -13,34 +13,35 @@ rust-version = "1.57"
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { version = "1.0.0-rc.8", features = [] }
|
||||
cc = "1.0"
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
is_elevated = "0.1.2"
|
||||
registry = "1.2.1"
|
||||
|
||||
[target.'cfg(unix)'.dependencies]
|
||||
sudo = "0.6.0"
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
tauri = { version = "1.0.0-rc.9", features = ["api-all", "updater"] }
|
||||
tauri = { version = "1.0.0-rc.9", features = ["api-all"] }
|
||||
|
||||
# Access system process info.
|
||||
sysinfo = "0.23.12"
|
||||
sysinfo = "0.24.6"
|
||||
|
||||
# ZIP-archive library.
|
||||
zip-extract = "0.1.1"
|
||||
zip = "0.6.2"
|
||||
|
||||
# For creating a "global" downloads list.
|
||||
lazy_static = "1.4.0"
|
||||
|
||||
# Access to the Windows Registry.
|
||||
registry = "1.2.1"
|
||||
once_cell = "1.13.0"
|
||||
|
||||
# Program opener.
|
||||
open = "2.1.2"
|
||||
duct = "0.13.5"
|
||||
|
||||
# Serialization.
|
||||
serde_json = "1"
|
||||
base64 = "0.13.0"
|
||||
|
||||
# System process elevation.
|
||||
is_elevated = "0.1.2"
|
||||
runas = "0.2.1"
|
||||
|
||||
# Dependencies for the HTTP(S) proxy.
|
||||
http = "0.2"
|
||||
@@ -54,6 +55,13 @@ reqwest = { version = "0.11.3", features = ["stream"] }
|
||||
futures-util = "0.3.14"
|
||||
rcgen = { version = "0.9", features = ["x509-parser"] }
|
||||
|
||||
# metadata stuff
|
||||
libloading = "0.7"
|
||||
regex = "1"
|
||||
|
||||
# other
|
||||
file_diff = "1.0.0"
|
||||
|
||||
[features]
|
||||
# by default Tauri runs in production mode
|
||||
# when `tauri dev` runs it is executed with `cargo run --no-default-features` if `devPath` is an URL
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
fn main() {
|
||||
cc::Build::new()
|
||||
.include("mhycrypto")
|
||||
.cpp(true)
|
||||
|
||||
.file("mhycrypto/memecrypto.cpp")
|
||||
.file("mhycrypto/metadata.cpp")
|
||||
.file("mhycrypto/metadatastringdec.cpp")
|
||||
|
||||
.compile("mhycrypto");
|
||||
|
||||
cc::Build::new()
|
||||
.include("mhycrypto")
|
||||
.file("mhycrypto/aes.c")
|
||||
|
||||
.compile("mhycrypto-aes");
|
||||
|
||||
tauri_build::build()
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 974 B After Width: | Height: | Size: 954 B |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 903 B After Width: | Height: | Size: 902 B |
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 279 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 35 KiB |
1
src-tauri/keys/dispatchKey.txt
Normal file
@@ -0,0 +1 @@
|
||||
<RSAKeyValue><Modulus>AMW28dptX3h8q0O4z/vJrQxf6cmC6yVilgHRL98GazrYzmc3ixj87JpHIJ3IKEYV+HU/tYrUjEfY/ZtPzsLB9lKBelN9i8QjkFkA9QDICGYwJCXibxU67Z/HzENe9NQpG2i01SI0TJU8PJDV7zQPwPVGraIg5ouExRupq8UymaSHEyJ7zxKZCtgO0LKdROLJBSvI5srMu7kYTGmB7T07Ab8T9M595YSgd1vh06qZ3nsF1h4wg3y+zW28vdY28+RCj2V1i7oVyL0dQruLYq7qK8FycZl2j9R0GaJ8rRAjVP1Dsz+hjS3atHhQxOG9OFo6d/euedRvfWIhT9p6h1SeTjE=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>
|
||||
7
src-tauri/keys/passwordKey.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
<RSAKeyValue>
|
||||
<Exponent>AQAB</Exponent>
|
||||
<Modulus>yytg/H9lz7Lm0XcA8LMqIyXPVNApYTcSepT4VDLB4qqqFC3s
|
||||
/Huv8vN7zA/P4uoREIu8KMenADFk7uwrZSxoMWwJgn6A7sbAt1cqAaUXB
|
||||
9J4NzhL0x3AFTiHEQbw86hRvm2VGkbA5sWnr0NZw8SGBBY+EODwNIt51G
|
||||
dBA7eoUQU=</Modulus>
|
||||
</RSAKeyValue>
|
||||
58
src-tauri/lang/chs.json
Normal file
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"lang_name": "简体中文",
|
||||
"main": {
|
||||
"title": "Cultivation",
|
||||
"launch_button": "启动",
|
||||
"gc_enable": "以 Grasscutter 模式连接",
|
||||
"https_enable": "使用 HTTPS",
|
||||
"ip_placeholder": "IP 地址...",
|
||||
"port_placeholder": "端口...",
|
||||
"files_downloading": "文件下载中:",
|
||||
"files_extracting": "文件解压中:"
|
||||
},
|
||||
"options": {
|
||||
"game_executable": "选择游戏可执行文件",
|
||||
"grasscutter_jar": "选择 Grasscutter JAR 文件",
|
||||
"java_path": "设置自定义 Java 路径",
|
||||
"grasscutter_with_game": "随游戏自动启动 Grasscutter",
|
||||
"language": "语言",
|
||||
"background": "设置自定义背景(链接或文件)",
|
||||
"theme": "设置主题"
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_stable_data": "下载 Grasscutter 稳定版数据",
|
||||
"grasscutter_latest_data": "下载 Grasscutter 开发版数据",
|
||||
"grasscutter_stable_data_update": "更新 Grasscutter 稳定版数据",
|
||||
"grasscutter_latest_data_update": "更新 Grasscutter 开发版数据",
|
||||
"grasscutter_stable": "下载 Grasscutter 稳定版",
|
||||
"grasscutter_latest": "下载 Grasscutter 开发版",
|
||||
"grasscutter_stable_update": "更新 Grasscutter 稳定版",
|
||||
"grasscutter_latest_update": "更新 Grasscutter 开发版",
|
||||
"resources": "下载 Grasscutter 资源"
|
||||
},
|
||||
"download_status": {
|
||||
"downloading": "下载中",
|
||||
"extracting": "解压中",
|
||||
"error": "错误",
|
||||
"finished": "已完成",
|
||||
"stopped": "已暂停"
|
||||
},
|
||||
"components": {
|
||||
"select_file": "选择文件或文件夹...",
|
||||
"select_folder": "选择文件夹...",
|
||||
"download": "下载"
|
||||
},
|
||||
"news": {
|
||||
"latest_commits": "最近的PR",
|
||||
"latest_version": "最新版本"
|
||||
},
|
||||
"help": {
|
||||
"port_help_text": "确保这是 Dispatch 服务器端口,而不是游戏服务器端口。大部分服务器的端口都是 443。",
|
||||
"game_help_text": "你不需要另外的游戏备份来使用 Grasscutter。这是给想要降级到 2.6 或没有安装游戏的人使用的。",
|
||||
"gc_stable_jar": "下载当前的 Grasscutter 稳定版,包括 JAR 文件和数据。",
|
||||
"gc_dev_jar": "下载最新的 Grasscutter 开发版,包括 JAR 文件和数据。",
|
||||
"gc_stable_data": "下载当前的 Grasscutter 稳定版数据,不包括 JAR 文件。此选项在更新时有帮助。",
|
||||
"gc_dev_data": "下载最新的 Grasscutter 开发版数据,不包括 JAR 文件。此选项在更新时有帮助。",
|
||||
"resources": "资源文件在运行 Grasscutter 服务器时是必要的。此选项在已经存在资源文件时不可选。"
|
||||
}
|
||||
}
|
||||
61
src-tauri/lang/cht.json
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"lang_name": "繁體中文",
|
||||
"main": {
|
||||
"title": "Cultivation",
|
||||
"launch_button": "啟動",
|
||||
"gc_enable": "以Grasscutter模式連接",
|
||||
"https_enable": "使用 HTTPS",
|
||||
"ip_placeholder": "IP地址...",
|
||||
"port_placeholder": "通訊埠...",
|
||||
"files_downloading": "檔案下載中:",
|
||||
"files_extracting": "檔案解壓縮中:"
|
||||
},
|
||||
"options": {
|
||||
"enabled": "已啟用",
|
||||
"disabled": "未啟用",
|
||||
"game_executable": "選擇遊戲執行檔",
|
||||
"grasscutter_jar": "選擇伺服器JAR檔案",
|
||||
"toggle_encryption": "設定加密",
|
||||
"java_path": "設定自定義Java路徑",
|
||||
"grasscutter_with_game": "伴隨遊戲一起啟動Grasscutter",
|
||||
"language": "語言",
|
||||
"background": "設定自定義背景(網址或檔案)",
|
||||
"theme": "設定主題"
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_stable_data": "下載Grasscutter穩定版數據(Data)",
|
||||
"grasscutter_latest_data": "下載Grasscutter開發板數據(Data)",
|
||||
"grasscutter_stable_data_update": "更新Grasscutter穩定版數據(Data)",
|
||||
"grasscutter_latest_data_update": "更新Grasscutter開發板數據(Data)",
|
||||
"grasscutter_stable": "下載Grasscutter穩定版",
|
||||
"grasscutter_latest": "下載Grasscutter開發板",
|
||||
"grasscutter_stable_update": "更新Grasscutter穩定版",
|
||||
"grasscutter_latest_update": "更新Grasscutter開發板",
|
||||
"resources": "下載Grasscutter資源(Resources)"
|
||||
},
|
||||
"download_status": {
|
||||
"downloading": "下載中",
|
||||
"extracting": "解壓縮中",
|
||||
"error": "錯誤",
|
||||
"finished": "已完成",
|
||||
"stopped": "暫停"
|
||||
},
|
||||
"components": {
|
||||
"select_file": "選擇檔案或資料夾...",
|
||||
"select_folder": "選擇資料夾...",
|
||||
"download": "下載"
|
||||
},
|
||||
"news": {
|
||||
"latest_commits": "最近的PR",
|
||||
"latest_version": "最新版本"
|
||||
},
|
||||
"help": {
|
||||
"port_help_text": "確保這是Dispatch伺服器端口,不是遊戲伺服器端口。 大部分伺服器的端口都是443。",
|
||||
"game_help_text": "你不需要另外一個遊戲備份來使用Grasscutter。這是給想要降級到2.6或者還沒安裝遊戲的人使用的。",
|
||||
"gc_stable_jar": "下載當前的Grasscutter穩定版本,包括JAR答案還有資料文件。",
|
||||
"gc_dev_jar": "下載當前的Grasscutter穩定版本資料文件,其中不會附帶JAR文件。這個選項在更新時很有用。",
|
||||
"gc_stable_data": "下載當前最新的Grasscutter開發版本資料文件,其中不會附帶JAR文件。這個選項在更新時很有用。",
|
||||
"gc_dev_data": "下載當前最新的Grasscutter開發版本的資料文件,其中不會附帶JAR文件。這個選項在更新時很有用。",
|
||||
"resources": "資源文件在架設一個Grasscutter伺服器時是必要的。 這個選項會在你已經有裡面有檔案的資源資料夾時不可選。"
|
||||
}
|
||||
}
|
||||
61
src-tauri/lang/de.json
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"lang_name": "Deutsch",
|
||||
"main": {
|
||||
"title": "Cultivation",
|
||||
"launch_button": "Starten",
|
||||
"gc_enable": "Über Grasscutter verbinden",
|
||||
"https_enable": "HTTPS nutzen",
|
||||
"ip_placeholder": "Server Adresse...",
|
||||
"port_placeholder": "Port...",
|
||||
"files_downloading": "Herunterladen von Dateien: ",
|
||||
"files_extracting": "Extrahieren von Dateien: "
|
||||
},
|
||||
"options": {
|
||||
"enabled": "Aktiviert",
|
||||
"disabled": "Deaktiviert",
|
||||
"game_executable": "Spiel Datei auswählen",
|
||||
"grasscutter_jar": "Grasscuter JAR auswählen",
|
||||
"toggle_encryption": "Verschlüsselung umschalten",
|
||||
"java_path": "Benutzerdefinierten Java Pfad setzen",
|
||||
"grasscutter_with_game": "Grasscutter automatisch mit dem Spiel starten",
|
||||
"language": "Sprache auswählen",
|
||||
"background": "Benutzerdefinierten Hintergrund festlegen (link oder bild)",
|
||||
"theme": "Theme auswählen"
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_stable_data": "Stabile Grasscutter Daten herunterladen",
|
||||
"grasscutter_latest_data": "Aktuellste Grasscutter Daten herunterladen",
|
||||
"grasscutter_stable_data_update": "Stabile Grasscutter Daten aktualisieren",
|
||||
"grasscutter_latest_data_update": "Aktuellste Grasscutter Daten aktualisieren",
|
||||
"grasscutter_stable": "Stabile Grasscutter Version herunterladen",
|
||||
"grasscutter_latest": "Aktuellste Grasscutter Version herunterladen",
|
||||
"grasscutter_stable_update": "Stabile Grasscutter Version aktualisieren",
|
||||
"grasscutter_latest_update": "Aktuellste Grasscutter Version aktualisieren",
|
||||
"resources": "Grasscutter Ressourcen herunterladen"
|
||||
},
|
||||
"download_status": {
|
||||
"downloading": "Lädt herunter",
|
||||
"extracting": "Extrahiert",
|
||||
"error": "Fehler",
|
||||
"finished": "Fertig",
|
||||
"stopped": "Gestoppt"
|
||||
},
|
||||
"components": {
|
||||
"select_file": "Datei oder Ordner auswählen...",
|
||||
"select_folder": "Ordner auswählen...",
|
||||
"download": "Herunterladen"
|
||||
},
|
||||
"news": {
|
||||
"latest_commits": "Letzte Commits",
|
||||
"latest_version": "Letzte Version"
|
||||
},
|
||||
"help": {
|
||||
"port_help_text": "Vergewissern Sie sich, dass es sich um den Port des Dispatch-Servers handelt, nicht um den Port des Spiel-Servers. Dieser ist fast immer '443'.",
|
||||
"game_help_text": "Sie müssen keine separate Kopie verwenden, um mit Grasscutter zu spielen. Dies ist entweder für ein Downgrade auf die Version 2.6 oder wenn Sie das Spiel nicht installiert haben.",
|
||||
"gc_stable_jar": "Laden Sie den aktuellen stabilen Grasscutter-Build herunter, der eine Jar-Datei und Datendateien enthält.",
|
||||
"gc_dev_jar": "Laden Sie die neueste Grasscutter-Entwicklungsversion herunter, welche eine Jar-Datei und Datendateien enthält.",
|
||||
"gc_stable_data": "Laden Sie die stabilen Grasscutter Daten herunter, welche keine Jar-Datei enthalten. Dies ist nützlich zum Aktualisieren.",
|
||||
"gc_dev_data": "Laden Sie die neuesten Grasscutter-Entwicklungsdateien herunter, welche keine Jar-Datei enthält. Dies ist nützlich zum Aktualisieren.",
|
||||
"resources": "Diese werden auch benötigt, um einen Grasscutter-Server auszuführen. Diese Schaltfläche ist grau, wenn Sie einen bestehenden Ressourcenordner mit Inhalten haben"
|
||||
}
|
||||
}
|
||||
@@ -11,8 +11,14 @@
|
||||
"files_extracting": "Files Extracting: "
|
||||
},
|
||||
"options": {
|
||||
"game_exec": "Set Game Executable",
|
||||
"enabled": "Enabled",
|
||||
"disabled": "Disabled",
|
||||
"game_path": "Set Game Install Path",
|
||||
"game_executable": "Set Game Executable",
|
||||
"recover_metadata": "Emergency Metadata Recovery",
|
||||
"grasscutter_jar": "Set Grasscutter JAR",
|
||||
"toggle_encryption": "Toggle Encryption",
|
||||
"install_certificate": "Install Proxy Certificate",
|
||||
"java_path": "Set Custom Java Path",
|
||||
"grasscutter_with_game": "Automatically launch Grasscutter with game",
|
||||
"language": "Select Language",
|
||||
@@ -28,7 +34,8 @@
|
||||
"grasscutter_latest": "Download Grasscutter Latest",
|
||||
"grasscutter_stable_update": "Update Grasscutter Stable",
|
||||
"grasscutter_latest_update": "Update Grasscutter Latest",
|
||||
"resources": "Download Grasscutter Resources"
|
||||
"resources": "Download Grasscutter Resources",
|
||||
"game": "Download Game"
|
||||
},
|
||||
"download_status": {
|
||||
"downloading": "Downloading",
|
||||
@@ -40,7 +47,8 @@
|
||||
"components": {
|
||||
"select_file": "Select file or folder...",
|
||||
"select_folder": "Select folder...",
|
||||
"download": "Download"
|
||||
"download": "Download",
|
||||
"install": "Install"
|
||||
},
|
||||
"news": {
|
||||
"latest_commits": "Recent Commits",
|
||||
@@ -54,5 +62,8 @@
|
||||
"gc_stable_data": "Download the current stable Grasscutter data files, which does not come with a jar file. This is useful for updating.",
|
||||
"gc_dev_data": "Download the latest development Grasscutter data files, which does not come with a jar file. This is useful for updating.",
|
||||
"resources": "These are also required to run a Grasscutter server. This button will be grey if you have an existing resources folder with contents inside"
|
||||
},
|
||||
"swag": {
|
||||
"akebi": "Set Akebi Executable"
|
||||
}
|
||||
}
|
||||
61
src-tauri/lang/fr.json
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"lang_name": "Francais",
|
||||
"main": {
|
||||
"title": "Cultivation",
|
||||
"launch_button": "Lancer",
|
||||
"gc_enable": "Se connecter avec Grasscutter",
|
||||
"https_enable": "Utiliser HTTPS",
|
||||
"ip_placeholder": "Adresse du serveur...",
|
||||
"port_placeholder": "Port...",
|
||||
"files_downloading": "Fichiers en cours de telechargement: ",
|
||||
"files_extracting": "Fichiers en cours d'extraction: "
|
||||
},
|
||||
"options": {
|
||||
"enabled": "active",
|
||||
"disabled": "desactiver",
|
||||
"game_executable": "definir l'executable du jeu",
|
||||
"grasscutter_jar": "definir le Jar Grasscutter",
|
||||
"toggle_encryption": "activer l'encryption",
|
||||
"java_path": "definir un chemin java personnalise",
|
||||
"grasscutter_with_game": "Lancer Grasscutter automatiquement avec le jeu",
|
||||
"language": "Choisir la langue",
|
||||
"background": "definir un arriere plan personnalise (lien ou fichier image)",
|
||||
"theme": "definir un theme"
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_stable_data": "Telecharger les donnees de Grasscutter (version stable)",
|
||||
"grasscutter_latest_data": "Telecharger les donnees de Grasscutter (derniere version)",
|
||||
"grasscutter_stable_data_update": "Mettre a jour les donnees de Grasscutter (version stable)",
|
||||
"grasscutter_latest_data_update": "Mettre a jour les donnees de Grasscutter (derniere version)",
|
||||
"grasscutter_stable": "Telecharger Grasscutter (version stable)",
|
||||
"grasscutter_latest": "Telecharger Grasscutter (derniere version)",
|
||||
"grasscutter_stable_update": "Mettre a jour Grasscutter (version stable)",
|
||||
"grasscutter_latest_update": "Mettre a jour Grasscutter (derniere version)",
|
||||
"resources": "Telecharger les ressources logicielles de Grasscutter"
|
||||
},
|
||||
"download_status": {
|
||||
"downloading": "Telechargement",
|
||||
"extracting": "Extraction",
|
||||
"error": "Erreur",
|
||||
"finished": "Termine",
|
||||
"stopped": "Arrete"
|
||||
},
|
||||
"components": {
|
||||
"select_file": "choisir fichier ou dossier...",
|
||||
"select_folder": "choisir dossier...",
|
||||
"download": "Telecharger"
|
||||
},
|
||||
"news": {
|
||||
"latest_commits": "Recents Commits",
|
||||
"latest_version": "Derniere version"
|
||||
},
|
||||
"help": {
|
||||
"port_help_text": "Assurez-vous que c'est le port serveur Dispatch, et non le port du serveur de jeu. C'est presque toujours '433'.",
|
||||
"game_help_text": "Vous n'avez pas besoin d'une copie differente du jeu pour jouer avec Grasscutter. Cela est ou pour retrograder en 2.6 ou si vous n'avez pas le jeu d'installe",
|
||||
"gc_stable_jar": "Telecharger le dernier build stable de Grasscutter, ce qui inclut le fichier jar et les fichiers de donnees",
|
||||
"gc_dev_jar": "Telecharger le dernier build en development de Grasscutter, ce qui inclut le fichier jar et les fichiers de donnees",
|
||||
"gc_stable_data": "Telecharger le dernier build stable de Grasscutter, ce qui n'inclut pasle fichier jar. Cela est utile pour mettre a jour",
|
||||
"gc_dev_data": "Telecharger le dernier build en development de Grasscutter, ce qui n'inclut pasle fichier jar. Cela est utile pour mettre a jour",
|
||||
"resources": "Les ressources sont aussi necessaires pour lancer un serveur Grasscutter. Ce bouton deviendra gris si vous avez deja un fichier ressources avec les donnees dedans."
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@
|
||||
"files_extracting": "MengExtract File: "
|
||||
},
|
||||
"options": {
|
||||
"game_exec": "Set Game Executable",
|
||||
"game_executable": "Set Game Executable",
|
||||
"grasscutter_jar": "Path ke Grasscutter JAR",
|
||||
"java_path": "Atur kustom Java path",
|
||||
"grasscutter_with_game": "Otomatis Menjalankan Grasscutter Dengan Game",
|
||||
|
||||
61
src-tauri/lang/lv.json
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"lang_name": "Latviešu",
|
||||
"main": {
|
||||
"title": "Cultivation",
|
||||
"launch_button": "Palaist",
|
||||
"gc_enable": "Savienot ar Grasscutter",
|
||||
"https_enable": "Izm. HTTPS",
|
||||
"ip_placeholder": "Servera Adrese...",
|
||||
"port_placeholder": "Ports...",
|
||||
"files_downloading": "Failu Lejupielāde: ",
|
||||
"files_extracting": "Failu Izvilkšana: "
|
||||
},
|
||||
"options": {
|
||||
"enabled": "Iespējots",
|
||||
"disabled": "Atspējots",
|
||||
"game_executable": "Iestatīt spēles izpildāmu",
|
||||
"grasscutter_jar": "Iestatiet Grasscutter JAR",
|
||||
"toggle_encryption": "Pārslēgt Šifrēšanu",
|
||||
"java_path": "Iestatiet pielāgotu Java ceļu",
|
||||
"grasscutter_with_game": "Automātiski palaidiet Grasscutter ar spēli",
|
||||
"language": "Izvēlēties valodu",
|
||||
"background": "Iestatīt pielāgotu fonu (saite vai attēla fails)",
|
||||
"theme": "Iestatīt tēmu"
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_stable_data": "Lejupielādējiet Grasscutter stabilos datus",
|
||||
"grasscutter_latest_data": "Lejupielādējiet Grasscutter jaunākos datus",
|
||||
"grasscutter_stable_data_update": "Atjauniniet Grasscutter stabilos datus",
|
||||
"grasscutter_latest_data_update": "Atjauniniet Grasscutter jaunākos datus",
|
||||
"grasscutter_stable": "Lejupielādēt Grasscutter stabilo",
|
||||
"grasscutter_latest": "Lejupielādēt Grasscutter jaunāko",
|
||||
"grasscutter_stable_update": "Atjauniet Grasscutter stabilo",
|
||||
"grasscutter_latest_update": "Atjauniet Grasscutter jaunāko",
|
||||
"resources": "Lejupielādējiet Grasscutter resursi"
|
||||
},
|
||||
"download_status": {
|
||||
"downloading": "Notiek lejupielāde",
|
||||
"extracting": "Notiek izvilkšana",
|
||||
"error": "Kļūda",
|
||||
"finished": "Pabeigts",
|
||||
"stopped": "Partraukta"
|
||||
},
|
||||
"components": {
|
||||
"select_file": "Izvēlēties failu vai mapu...",
|
||||
"select_folder": "Izvēlēties mapu...",
|
||||
"download": "Lejupielādēt"
|
||||
},
|
||||
"news": {
|
||||
"latest_commits": "Nesen kommitus",
|
||||
"latest_version": "Jaunākā versija"
|
||||
},
|
||||
"help": {
|
||||
"port_help_text": "Pārliecinieties, vai tas ir Dispatch-servera ports, nevis spēļu servera ports. Tas gandrīz vienmēr ir '443'.",
|
||||
"game_help_text": "Lai spēlētu ar Grasscutter, jums nav jāizmanto atsevišķa kopija. Tas ir izveidots, lai pazeminātu versiju uz 2.6 vai ja jums nav instalēta spēle.",
|
||||
"gc_stable_jar": "Lejupielādējiet pašreizējo stabilo Grasscutter versiju, kuram ir jar failu un datu failus.",
|
||||
"gc_dev_jar": "Lejupielādējiet jaunāko izstrāde Grasscutter versiju, kuram ir jar failu un datu failus.",
|
||||
"gc_stable_data": "Lejupielādējiet pašreizējos stabilos Grasscutter datu failus, kuriem nav jar fails. Tas ir noderīgi atjaunināšanai.",
|
||||
"gc_dev_data": "Lejupielādējiet jaunāko izstrāde Grasscutter datu failus, kuriem nav pievienots jar fails. Tas ir noderīgi atjaunināšanai.",
|
||||
"resources": "Tie ir nepieciešami arī Grasscutter servera darbināšanai. Šī poga būs pelēka, ja jums ir resursu mape ar saturu."
|
||||
}
|
||||
}
|
||||
61
src-tauri/lang/ru.json
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"lang_name": "Русский",
|
||||
"main": {
|
||||
"title": "Cultivation",
|
||||
"launch_button": "Запустить",
|
||||
"gc_enable": "Подключиться с Grasscutter",
|
||||
"https_enable": "Исп. HTTPS",
|
||||
"ip_placeholder": "Айпи адрес...",
|
||||
"port_placeholder": "Порт...",
|
||||
"files_downloading": "Файлов скачано: ",
|
||||
"files_extracting": "Извлечено файлов: "
|
||||
},
|
||||
"options": {
|
||||
"enabled": "Включено",
|
||||
"disabled": "Выключено",
|
||||
"game_executable": "Установить исполняемый файл игры",
|
||||
"grasscutter_jar": "Установить Grasscutter JAR",
|
||||
"toggle_encryption": "Переключить шифрование",
|
||||
"java_path": "Установить пользовательский путь Java",
|
||||
"grasscutter_with_game": "Автоматически запускать Grasscutter вместе с игрой",
|
||||
"language": "Установить язык",
|
||||
"background": "Установить свой фон (ссылка или файл)",
|
||||
"theme": "Установить тему"
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_stable_data": "Скачать стабильные данные Grasscutter",
|
||||
"grasscutter_latest_data": "Скачать последние данные Grasscutter",
|
||||
"grasscutter_stable_data_update": "Обновить стабильные данные Grasscutter",
|
||||
"grasscutter_latest_data_update": "Обновить последние данные Grasscutter",
|
||||
"grasscutter_stable": "Скачать стабильную версию Grasscutter",
|
||||
"grasscutter_latest": "Скачать последнюю версию Grasscutter",
|
||||
"grasscutter_stable_update": "Обновить стабильную версию Grasscutter",
|
||||
"grasscutter_latest_update": "Обновить последнюю версию Grasscutter",
|
||||
"resources": "Скачать ресурсы Grasscutter"
|
||||
},
|
||||
"download_status": {
|
||||
"downloading": "Скачивание",
|
||||
"extracting": "Извлечение",
|
||||
"error": "Ошибка",
|
||||
"finished": "Закончено",
|
||||
"stopped": "Остановлено"
|
||||
},
|
||||
"components": {
|
||||
"select_file": "Выберите файл или папку...",
|
||||
"select_folder": "Выберите папку...",
|
||||
"download": "Скачать"
|
||||
},
|
||||
"news": {
|
||||
"latest_commits": "Последние коммиты",
|
||||
"latest_version": "Последняя версия"
|
||||
},
|
||||
"help": {
|
||||
"port_help_text": "Убедитесь, что это порт Dispatch-сервера, не порт игрового сервера. Обычно это '443'.",
|
||||
"game_help_text": "Вам не нужно устанавливать еще одну копию, что бы играть с Grascutter. Это нужно или для версии 2.6, или если у Вас не установлена игра.",
|
||||
"gc_stable_jar": "Скачать последнюю стабильную версию Grasscutter, которая содержит jar файл и данные.",
|
||||
"gc_dev_jar": "Скачать последнюю версию для разработки Grasscutter, которая содержит jar файл и данные.",
|
||||
"gc_stable_data": "Скачать стабильные данные Grasscutter, в которой нету jar файла. Это полезно для обновления.",
|
||||
"gc_dev_data": "Скачать последнюю версию для разработки Grasscutter, в которой нету jar файла. Это полезно для обновления.",
|
||||
"resources": "Это необходимо для запуска сервера Grasscutter. Эта кнопка будет серой, если у Вас уже есть не пустая папка с ресурсами."
|
||||
}
|
||||
}
|
||||
61
src-tauri/lang/vi.json
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"lang_name": "Tiếng Việt",
|
||||
"main": {
|
||||
"title": "Cultivation",
|
||||
"launch_button": "Khởi Chạy",
|
||||
"gc_enable": "Kết nối đến Grasscutter",
|
||||
"https_enable": "Sử dụng HTTPS",
|
||||
"ip_placeholder": "Địa chỉ máy chủ...",
|
||||
"port_placeholder": "Cổng...",
|
||||
"files_downloading": "Đang tải file: ",
|
||||
"files_extracting": "Đang giải nén tệp tin: "
|
||||
},
|
||||
"options": {
|
||||
"enabled": "Bật",
|
||||
"disabled": "Tắt",
|
||||
"game_exec": "Đường dẫn đến GenshinImpact.exe",
|
||||
"grasscutter_jar": "Đường dẫn đến Grasscutter.jar",
|
||||
"toggle_encryption": "Bật/Tắt mã hoá",
|
||||
"java_path": "Đường dẫn Java tuỳ chỉnh",
|
||||
"grasscutter_with_game": "Tự động khởi chạy Grasscutter cùng game",
|
||||
"language": "Chọn ngôn ngữ",
|
||||
"background": "Ảnh nền tuỳ chỉnh (đường dẫn hoặc tệp tin ảnh)",
|
||||
"theme": "Chọn giao diện"
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_stable_data": "Tải xuống dữ liệu Grasscutter bản ổn định",
|
||||
"grasscutter_latest_data": "Tải xuống dữ liệu Grasscutter bản mới nhất",
|
||||
"grasscutter_stable_data_update": "Cập nhật dữ liệu Grasscutter bản ổn định",
|
||||
"grasscutter_latest_data_update": "Cập nhật dữ liệu Grasscutter bản mới nhất",
|
||||
"grasscutter_stable": "Tải xuống Grasscutter phiên bản ổn định",
|
||||
"grasscutter_latest": "Tải xuống Grasscutter phiển bản mới nhất",
|
||||
"grasscutter_stable_update": "Cập nhật Grasscutter ổn định",
|
||||
"grasscutter_latest_update": "Cập nhật Grasscutter mới nhất",
|
||||
"resources": "Tải xuống tài nguyên cho Grasscutter"
|
||||
},
|
||||
"download_status": {
|
||||
"downloading": "Đang tải",
|
||||
"extracting": "Đang giải nén",
|
||||
"error": "Lỗi",
|
||||
"finished": "Đã xong",
|
||||
"stopped": "Đã dừng"
|
||||
},
|
||||
"components": {
|
||||
"select_file": "Chọn tệp tin hoặc thư mục...",
|
||||
"select_folder": "Chọn thư mục...",
|
||||
"download": "Tải xuống"
|
||||
},
|
||||
"news": {
|
||||
"latest_commits": "Cập nhật gần đây",
|
||||
"latest_version": "Phiên bản mới nhất"
|
||||
},
|
||||
"help": {
|
||||
"port_help_text": "Đảm bảo đây là cổng của server Dispatch, không phải cổng của server Game. Thường là '443'.",
|
||||
"game_help_text": "Bạn không cần phải sử dụng một bản sao riêng để chơi với Grasscutter. Việc này chỉ xảy ra nếu bạn hạ phiên bản xuống 2.6 hoặc chưa cài đặt trò chơi.",
|
||||
"gc_stable_jar": "Tải xuống phiên bản ổn định của Grasscutter, bảo gồm file jar và các file dữ liệu.",
|
||||
"gc_dev_jar": "Tải xuống phiên bản phát triển mới nhất của Grasscutter, bảo gồm file jar và các file dữ liệu.",
|
||||
"gc_stable_data": "Tải xuống bản ổn định các tệp dữ liệu của Grasscutter, không bao gồm file jar. Phù hợp khi cập nhật.",
|
||||
"gc_dev_data": "Tải xuống bản phát triển mới nhất các tệp dữ liệu của Grasscutter, không bao gồm file jar. Phù hợp khi cập nhật.",
|
||||
"resources": "Chúng được yêu cầu để chạy máy chủ Grasscutter. Nút này sẽ có màu xám nếu bạn có một thư mục tài nguyên có nội dung bên trong"
|
||||
}
|
||||
}
|
||||
BIN
src-tauri/mhycrypto.dll
Normal file
387
src-tauri/mhycrypto/aes.c
Normal file
@@ -0,0 +1,387 @@
|
||||
// Simple, thoroughly commented implementation of 128-bit AES / Rijndael using C
|
||||
// Chris Hulbert - chris.hulbert@gmail.com - http://splinter.com.au/blog
|
||||
// References:
|
||||
// http://en.wikipedia.org/wiki/Advanced_Encryption_Standard
|
||||
// http://en.wikipedia.org/wiki/Rijndael_key_schedule
|
||||
// http://en.wikipedia.org/wiki/Rijndael_mix_columns
|
||||
// http://en.wikipedia.org/wiki/Rijndael_S-box
|
||||
|
||||
// This code is public domain, or any OSI-approved license, your choice. No warranty.
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "aes.h"
|
||||
|
||||
typedef unsigned char byte;
|
||||
|
||||
// Here are all the lookup tables for the row shifts, rcon, s-boxes, and galois field multiplications
|
||||
static const byte shift_rows_table[] = {0, 5, 10, 15, 4, 9, 14, 3, 8, 13, 2, 7, 12, 1, 6, 11};
|
||||
static const byte shift_rows_table_inv[] = {0, 13, 10, 7, 4, 1, 14, 11, 8, 5, 2, 15, 12, 9, 6, 3};
|
||||
static const byte lookup_rcon[] = {
|
||||
0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a};
|
||||
static const byte lookup_sbox[] = {
|
||||
0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
|
||||
0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0,
|
||||
0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15,
|
||||
0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75,
|
||||
0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84,
|
||||
0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf,
|
||||
0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8,
|
||||
0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2,
|
||||
0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73,
|
||||
0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb,
|
||||
0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79,
|
||||
0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08,
|
||||
0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a,
|
||||
0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e,
|
||||
0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf,
|
||||
0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16};
|
||||
static const byte lookup_sbox_inv[] = {
|
||||
0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb,
|
||||
0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb,
|
||||
0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e,
|
||||
0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25,
|
||||
0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92,
|
||||
0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84,
|
||||
0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06,
|
||||
0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b,
|
||||
0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73,
|
||||
0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e,
|
||||
0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b,
|
||||
0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4,
|
||||
0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f,
|
||||
0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef,
|
||||
0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61,
|
||||
0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d};
|
||||
static const byte lookup_g2[] = {
|
||||
0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e, 0x10, 0x12, 0x14, 0x16, 0x18, 0x1a, 0x1c, 0x1e,
|
||||
0x20, 0x22, 0x24, 0x26, 0x28, 0x2a, 0x2c, 0x2e, 0x30, 0x32, 0x34, 0x36, 0x38, 0x3a, 0x3c, 0x3e,
|
||||
0x40, 0x42, 0x44, 0x46, 0x48, 0x4a, 0x4c, 0x4e, 0x50, 0x52, 0x54, 0x56, 0x58, 0x5a, 0x5c, 0x5e,
|
||||
0x60, 0x62, 0x64, 0x66, 0x68, 0x6a, 0x6c, 0x6e, 0x70, 0x72, 0x74, 0x76, 0x78, 0x7a, 0x7c, 0x7e,
|
||||
0x80, 0x82, 0x84, 0x86, 0x88, 0x8a, 0x8c, 0x8e, 0x90, 0x92, 0x94, 0x96, 0x98, 0x9a, 0x9c, 0x9e,
|
||||
0xa0, 0xa2, 0xa4, 0xa6, 0xa8, 0xaa, 0xac, 0xae, 0xb0, 0xb2, 0xb4, 0xb6, 0xb8, 0xba, 0xbc, 0xbe,
|
||||
0xc0, 0xc2, 0xc4, 0xc6, 0xc8, 0xca, 0xcc, 0xce, 0xd0, 0xd2, 0xd4, 0xd6, 0xd8, 0xda, 0xdc, 0xde,
|
||||
0xe0, 0xe2, 0xe4, 0xe6, 0xe8, 0xea, 0xec, 0xee, 0xf0, 0xf2, 0xf4, 0xf6, 0xf8, 0xfa, 0xfc, 0xfe,
|
||||
0x1b, 0x19, 0x1f, 0x1d, 0x13, 0x11, 0x17, 0x15, 0x0b, 0x09, 0x0f, 0x0d, 0x03, 0x01, 0x07, 0x05,
|
||||
0x3b, 0x39, 0x3f, 0x3d, 0x33, 0x31, 0x37, 0x35, 0x2b, 0x29, 0x2f, 0x2d, 0x23, 0x21, 0x27, 0x25,
|
||||
0x5b, 0x59, 0x5f, 0x5d, 0x53, 0x51, 0x57, 0x55, 0x4b, 0x49, 0x4f, 0x4d, 0x43, 0x41, 0x47, 0x45,
|
||||
0x7b, 0x79, 0x7f, 0x7d, 0x73, 0x71, 0x77, 0x75, 0x6b, 0x69, 0x6f, 0x6d, 0x63, 0x61, 0x67, 0x65,
|
||||
0x9b, 0x99, 0x9f, 0x9d, 0x93, 0x91, 0x97, 0x95, 0x8b, 0x89, 0x8f, 0x8d, 0x83, 0x81, 0x87, 0x85,
|
||||
0xbb, 0xb9, 0xbf, 0xbd, 0xb3, 0xb1, 0xb7, 0xb5, 0xab, 0xa9, 0xaf, 0xad, 0xa3, 0xa1, 0xa7, 0xa5,
|
||||
0xdb, 0xd9, 0xdf, 0xdd, 0xd3, 0xd1, 0xd7, 0xd5, 0xcb, 0xc9, 0xcf, 0xcd, 0xc3, 0xc1, 0xc7, 0xc5,
|
||||
0xfb, 0xf9, 0xff, 0xfd, 0xf3, 0xf1, 0xf7, 0xf5, 0xeb, 0xe9, 0xef, 0xed, 0xe3, 0xe1, 0xe7, 0xe5};
|
||||
static const byte lookup_g3[] = {
|
||||
0x00, 0x03, 0x06, 0x05, 0x0c, 0x0f, 0x0a, 0x09, 0x18, 0x1b, 0x1e, 0x1d, 0x14, 0x17, 0x12, 0x11,
|
||||
0x30, 0x33, 0x36, 0x35, 0x3c, 0x3f, 0x3a, 0x39, 0x28, 0x2b, 0x2e, 0x2d, 0x24, 0x27, 0x22, 0x21,
|
||||
0x60, 0x63, 0x66, 0x65, 0x6c, 0x6f, 0x6a, 0x69, 0x78, 0x7b, 0x7e, 0x7d, 0x74, 0x77, 0x72, 0x71,
|
||||
0x50, 0x53, 0x56, 0x55, 0x5c, 0x5f, 0x5a, 0x59, 0x48, 0x4b, 0x4e, 0x4d, 0x44, 0x47, 0x42, 0x41,
|
||||
0xc0, 0xc3, 0xc6, 0xc5, 0xcc, 0xcf, 0xca, 0xc9, 0xd8, 0xdb, 0xde, 0xdd, 0xd4, 0xd7, 0xd2, 0xd1,
|
||||
0xf0, 0xf3, 0xf6, 0xf5, 0xfc, 0xff, 0xfa, 0xf9, 0xe8, 0xeb, 0xee, 0xed, 0xe4, 0xe7, 0xe2, 0xe1,
|
||||
0xa0, 0xa3, 0xa6, 0xa5, 0xac, 0xaf, 0xaa, 0xa9, 0xb8, 0xbb, 0xbe, 0xbd, 0xb4, 0xb7, 0xb2, 0xb1,
|
||||
0x90, 0x93, 0x96, 0x95, 0x9c, 0x9f, 0x9a, 0x99, 0x88, 0x8b, 0x8e, 0x8d, 0x84, 0x87, 0x82, 0x81,
|
||||
0x9b, 0x98, 0x9d, 0x9e, 0x97, 0x94, 0x91, 0x92, 0x83, 0x80, 0x85, 0x86, 0x8f, 0x8c, 0x89, 0x8a,
|
||||
0xab, 0xa8, 0xad, 0xae, 0xa7, 0xa4, 0xa1, 0xa2, 0xb3, 0xb0, 0xb5, 0xb6, 0xbf, 0xbc, 0xb9, 0xba,
|
||||
0xfb, 0xf8, 0xfd, 0xfe, 0xf7, 0xf4, 0xf1, 0xf2, 0xe3, 0xe0, 0xe5, 0xe6, 0xef, 0xec, 0xe9, 0xea,
|
||||
0xcb, 0xc8, 0xcd, 0xce, 0xc7, 0xc4, 0xc1, 0xc2, 0xd3, 0xd0, 0xd5, 0xd6, 0xdf, 0xdc, 0xd9, 0xda,
|
||||
0x5b, 0x58, 0x5d, 0x5e, 0x57, 0x54, 0x51, 0x52, 0x43, 0x40, 0x45, 0x46, 0x4f, 0x4c, 0x49, 0x4a,
|
||||
0x6b, 0x68, 0x6d, 0x6e, 0x67, 0x64, 0x61, 0x62, 0x73, 0x70, 0x75, 0x76, 0x7f, 0x7c, 0x79, 0x7a,
|
||||
0x3b, 0x38, 0x3d, 0x3e, 0x37, 0x34, 0x31, 0x32, 0x23, 0x20, 0x25, 0x26, 0x2f, 0x2c, 0x29, 0x2a,
|
||||
0x0b, 0x08, 0x0d, 0x0e, 0x07, 0x04, 0x01, 0x02, 0x13, 0x10, 0x15, 0x16, 0x1f, 0x1c, 0x19, 0x1a};
|
||||
static const byte lookup_g9[] = {
|
||||
0x00, 0x09, 0x12, 0x1b, 0x24, 0x2d, 0x36, 0x3f, 0x48, 0x41, 0x5a, 0x53, 0x6c, 0x65, 0x7e, 0x77,
|
||||
0x90, 0x99, 0x82, 0x8b, 0xb4, 0xbd, 0xa6, 0xaf, 0xd8, 0xd1, 0xca, 0xc3, 0xfc, 0xf5, 0xee, 0xe7,
|
||||
0x3b, 0x32, 0x29, 0x20, 0x1f, 0x16, 0x0d, 0x04, 0x73, 0x7a, 0x61, 0x68, 0x57, 0x5e, 0x45, 0x4c,
|
||||
0xab, 0xa2, 0xb9, 0xb0, 0x8f, 0x86, 0x9d, 0x94, 0xe3, 0xea, 0xf1, 0xf8, 0xc7, 0xce, 0xd5, 0xdc,
|
||||
0x76, 0x7f, 0x64, 0x6d, 0x52, 0x5b, 0x40, 0x49, 0x3e, 0x37, 0x2c, 0x25, 0x1a, 0x13, 0x08, 0x01,
|
||||
0xe6, 0xef, 0xf4, 0xfd, 0xc2, 0xcb, 0xd0, 0xd9, 0xae, 0xa7, 0xbc, 0xb5, 0x8a, 0x83, 0x98, 0x91,
|
||||
0x4d, 0x44, 0x5f, 0x56, 0x69, 0x60, 0x7b, 0x72, 0x05, 0x0c, 0x17, 0x1e, 0x21, 0x28, 0x33, 0x3a,
|
||||
0xdd, 0xd4, 0xcf, 0xc6, 0xf9, 0xf0, 0xeb, 0xe2, 0x95, 0x9c, 0x87, 0x8e, 0xb1, 0xb8, 0xa3, 0xaa,
|
||||
0xec, 0xe5, 0xfe, 0xf7, 0xc8, 0xc1, 0xda, 0xd3, 0xa4, 0xad, 0xb6, 0xbf, 0x80, 0x89, 0x92, 0x9b,
|
||||
0x7c, 0x75, 0x6e, 0x67, 0x58, 0x51, 0x4a, 0x43, 0x34, 0x3d, 0x26, 0x2f, 0x10, 0x19, 0x02, 0x0b,
|
||||
0xd7, 0xde, 0xc5, 0xcc, 0xf3, 0xfa, 0xe1, 0xe8, 0x9f, 0x96, 0x8d, 0x84, 0xbb, 0xb2, 0xa9, 0xa0,
|
||||
0x47, 0x4e, 0x55, 0x5c, 0x63, 0x6a, 0x71, 0x78, 0x0f, 0x06, 0x1d, 0x14, 0x2b, 0x22, 0x39, 0x30,
|
||||
0x9a, 0x93, 0x88, 0x81, 0xbe, 0xb7, 0xac, 0xa5, 0xd2, 0xdb, 0xc0, 0xc9, 0xf6, 0xff, 0xe4, 0xed,
|
||||
0x0a, 0x03, 0x18, 0x11, 0x2e, 0x27, 0x3c, 0x35, 0x42, 0x4b, 0x50, 0x59, 0x66, 0x6f, 0x74, 0x7d,
|
||||
0xa1, 0xa8, 0xb3, 0xba, 0x85, 0x8c, 0x97, 0x9e, 0xe9, 0xe0, 0xfb, 0xf2, 0xcd, 0xc4, 0xdf, 0xd6,
|
||||
0x31, 0x38, 0x23, 0x2a, 0x15, 0x1c, 0x07, 0x0e, 0x79, 0x70, 0x6b, 0x62, 0x5d, 0x54, 0x4f, 0x46};
|
||||
static const byte lookup_g11[] = {
|
||||
0x00, 0x0b, 0x16, 0x1d, 0x2c, 0x27, 0x3a, 0x31, 0x58, 0x53, 0x4e, 0x45, 0x74, 0x7f, 0x62, 0x69,
|
||||
0xb0, 0xbb, 0xa6, 0xad, 0x9c, 0x97, 0x8a, 0x81, 0xe8, 0xe3, 0xfe, 0xf5, 0xc4, 0xcf, 0xd2, 0xd9,
|
||||
0x7b, 0x70, 0x6d, 0x66, 0x57, 0x5c, 0x41, 0x4a, 0x23, 0x28, 0x35, 0x3e, 0x0f, 0x04, 0x19, 0x12,
|
||||
0xcb, 0xc0, 0xdd, 0xd6, 0xe7, 0xec, 0xf1, 0xfa, 0x93, 0x98, 0x85, 0x8e, 0xbf, 0xb4, 0xa9, 0xa2,
|
||||
0xf6, 0xfd, 0xe0, 0xeb, 0xda, 0xd1, 0xcc, 0xc7, 0xae, 0xa5, 0xb8, 0xb3, 0x82, 0x89, 0x94, 0x9f,
|
||||
0x46, 0x4d, 0x50, 0x5b, 0x6a, 0x61, 0x7c, 0x77, 0x1e, 0x15, 0x08, 0x03, 0x32, 0x39, 0x24, 0x2f,
|
||||
0x8d, 0x86, 0x9b, 0x90, 0xa1, 0xaa, 0xb7, 0xbc, 0xd5, 0xde, 0xc3, 0xc8, 0xf9, 0xf2, 0xef, 0xe4,
|
||||
0x3d, 0x36, 0x2b, 0x20, 0x11, 0x1a, 0x07, 0x0c, 0x65, 0x6e, 0x73, 0x78, 0x49, 0x42, 0x5f, 0x54,
|
||||
0xf7, 0xfc, 0xe1, 0xea, 0xdb, 0xd0, 0xcd, 0xc6, 0xaf, 0xa4, 0xb9, 0xb2, 0x83, 0x88, 0x95, 0x9e,
|
||||
0x47, 0x4c, 0x51, 0x5a, 0x6b, 0x60, 0x7d, 0x76, 0x1f, 0x14, 0x09, 0x02, 0x33, 0x38, 0x25, 0x2e,
|
||||
0x8c, 0x87, 0x9a, 0x91, 0xa0, 0xab, 0xb6, 0xbd, 0xd4, 0xdf, 0xc2, 0xc9, 0xf8, 0xf3, 0xee, 0xe5,
|
||||
0x3c, 0x37, 0x2a, 0x21, 0x10, 0x1b, 0x06, 0x0d, 0x64, 0x6f, 0x72, 0x79, 0x48, 0x43, 0x5e, 0x55,
|
||||
0x01, 0x0a, 0x17, 0x1c, 0x2d, 0x26, 0x3b, 0x30, 0x59, 0x52, 0x4f, 0x44, 0x75, 0x7e, 0x63, 0x68,
|
||||
0xb1, 0xba, 0xa7, 0xac, 0x9d, 0x96, 0x8b, 0x80, 0xe9, 0xe2, 0xff, 0xf4, 0xc5, 0xce, 0xd3, 0xd8,
|
||||
0x7a, 0x71, 0x6c, 0x67, 0x56, 0x5d, 0x40, 0x4b, 0x22, 0x29, 0x34, 0x3f, 0x0e, 0x05, 0x18, 0x13,
|
||||
0xca, 0xc1, 0xdc, 0xd7, 0xe6, 0xed, 0xf0, 0xfb, 0x92, 0x99, 0x84, 0x8f, 0xbe, 0xb5, 0xa8, 0xa3};
|
||||
static const byte lookup_g13[] = {
|
||||
0x00, 0x0d, 0x1a, 0x17, 0x34, 0x39, 0x2e, 0x23, 0x68, 0x65, 0x72, 0x7f, 0x5c, 0x51, 0x46, 0x4b,
|
||||
0xd0, 0xdd, 0xca, 0xc7, 0xe4, 0xe9, 0xfe, 0xf3, 0xb8, 0xb5, 0xa2, 0xaf, 0x8c, 0x81, 0x96, 0x9b,
|
||||
0xbb, 0xb6, 0xa1, 0xac, 0x8f, 0x82, 0x95, 0x98, 0xd3, 0xde, 0xc9, 0xc4, 0xe7, 0xea, 0xfd, 0xf0,
|
||||
0x6b, 0x66, 0x71, 0x7c, 0x5f, 0x52, 0x45, 0x48, 0x03, 0x0e, 0x19, 0x14, 0x37, 0x3a, 0x2d, 0x20,
|
||||
0x6d, 0x60, 0x77, 0x7a, 0x59, 0x54, 0x43, 0x4e, 0x05, 0x08, 0x1f, 0x12, 0x31, 0x3c, 0x2b, 0x26,
|
||||
0xbd, 0xb0, 0xa7, 0xaa, 0x89, 0x84, 0x93, 0x9e, 0xd5, 0xd8, 0xcf, 0xc2, 0xe1, 0xec, 0xfb, 0xf6,
|
||||
0xd6, 0xdb, 0xcc, 0xc1, 0xe2, 0xef, 0xf8, 0xf5, 0xbe, 0xb3, 0xa4, 0xa9, 0x8a, 0x87, 0x90, 0x9d,
|
||||
0x06, 0x0b, 0x1c, 0x11, 0x32, 0x3f, 0x28, 0x25, 0x6e, 0x63, 0x74, 0x79, 0x5a, 0x57, 0x40, 0x4d,
|
||||
0xda, 0xd7, 0xc0, 0xcd, 0xee, 0xe3, 0xf4, 0xf9, 0xb2, 0xbf, 0xa8, 0xa5, 0x86, 0x8b, 0x9c, 0x91,
|
||||
0x0a, 0x07, 0x10, 0x1d, 0x3e, 0x33, 0x24, 0x29, 0x62, 0x6f, 0x78, 0x75, 0x56, 0x5b, 0x4c, 0x41,
|
||||
0x61, 0x6c, 0x7b, 0x76, 0x55, 0x58, 0x4f, 0x42, 0x09, 0x04, 0x13, 0x1e, 0x3d, 0x30, 0x27, 0x2a,
|
||||
0xb1, 0xbc, 0xab, 0xa6, 0x85, 0x88, 0x9f, 0x92, 0xd9, 0xd4, 0xc3, 0xce, 0xed, 0xe0, 0xf7, 0xfa,
|
||||
0xb7, 0xba, 0xad, 0xa0, 0x83, 0x8e, 0x99, 0x94, 0xdf, 0xd2, 0xc5, 0xc8, 0xeb, 0xe6, 0xf1, 0xfc,
|
||||
0x67, 0x6a, 0x7d, 0x70, 0x53, 0x5e, 0x49, 0x44, 0x0f, 0x02, 0x15, 0x18, 0x3b, 0x36, 0x21, 0x2c,
|
||||
0x0c, 0x01, 0x16, 0x1b, 0x38, 0x35, 0x22, 0x2f, 0x64, 0x69, 0x7e, 0x73, 0x50, 0x5d, 0x4a, 0x47,
|
||||
0xdc, 0xd1, 0xc6, 0xcb, 0xe8, 0xe5, 0xf2, 0xff, 0xb4, 0xb9, 0xae, 0xa3, 0x80, 0x8d, 0x9a, 0x97};
|
||||
static const byte lookup_g14[] = {
|
||||
0x00, 0x0e, 0x1c, 0x12, 0x38, 0x36, 0x24, 0x2a, 0x70, 0x7e, 0x6c, 0x62, 0x48, 0x46, 0x54, 0x5a,
|
||||
0xe0, 0xee, 0xfc, 0xf2, 0xd8, 0xd6, 0xc4, 0xca, 0x90, 0x9e, 0x8c, 0x82, 0xa8, 0xa6, 0xb4, 0xba,
|
||||
0xdb, 0xd5, 0xc7, 0xc9, 0xe3, 0xed, 0xff, 0xf1, 0xab, 0xa5, 0xb7, 0xb9, 0x93, 0x9d, 0x8f, 0x81,
|
||||
0x3b, 0x35, 0x27, 0x29, 0x03, 0x0d, 0x1f, 0x11, 0x4b, 0x45, 0x57, 0x59, 0x73, 0x7d, 0x6f, 0x61,
|
||||
0xad, 0xa3, 0xb1, 0xbf, 0x95, 0x9b, 0x89, 0x87, 0xdd, 0xd3, 0xc1, 0xcf, 0xe5, 0xeb, 0xf9, 0xf7,
|
||||
0x4d, 0x43, 0x51, 0x5f, 0x75, 0x7b, 0x69, 0x67, 0x3d, 0x33, 0x21, 0x2f, 0x05, 0x0b, 0x19, 0x17,
|
||||
0x76, 0x78, 0x6a, 0x64, 0x4e, 0x40, 0x52, 0x5c, 0x06, 0x08, 0x1a, 0x14, 0x3e, 0x30, 0x22, 0x2c,
|
||||
0x96, 0x98, 0x8a, 0x84, 0xae, 0xa0, 0xb2, 0xbc, 0xe6, 0xe8, 0xfa, 0xf4, 0xde, 0xd0, 0xc2, 0xcc,
|
||||
0x41, 0x4f, 0x5d, 0x53, 0x79, 0x77, 0x65, 0x6b, 0x31, 0x3f, 0x2d, 0x23, 0x09, 0x07, 0x15, 0x1b,
|
||||
0xa1, 0xaf, 0xbd, 0xb3, 0x99, 0x97, 0x85, 0x8b, 0xd1, 0xdf, 0xcd, 0xc3, 0xe9, 0xe7, 0xf5, 0xfb,
|
||||
0x9a, 0x94, 0x86, 0x88, 0xa2, 0xac, 0xbe, 0xb0, 0xea, 0xe4, 0xf6, 0xf8, 0xd2, 0xdc, 0xce, 0xc0,
|
||||
0x7a, 0x74, 0x66, 0x68, 0x42, 0x4c, 0x5e, 0x50, 0x0a, 0x04, 0x16, 0x18, 0x32, 0x3c, 0x2e, 0x20,
|
||||
0xec, 0xe2, 0xf0, 0xfe, 0xd4, 0xda, 0xc8, 0xc6, 0x9c, 0x92, 0x80, 0x8e, 0xa4, 0xaa, 0xb8, 0xb6,
|
||||
0x0c, 0x02, 0x10, 0x1e, 0x34, 0x3a, 0x28, 0x26, 0x7c, 0x72, 0x60, 0x6e, 0x44, 0x4a, 0x58, 0x56,
|
||||
0x37, 0x39, 0x2b, 0x25, 0x0f, 0x01, 0x13, 0x1d, 0x47, 0x49, 0x5b, 0x55, 0x7f, 0x71, 0x63, 0x6d,
|
||||
0xd7, 0xd9, 0xcb, 0xc5, 0xef, 0xe1, 0xf3, 0xfd, 0xa7, 0xa9, 0xbb, 0xb5, 0x9f, 0x91, 0x83, 0x8d};
|
||||
|
||||
// Xor's all elements in a n byte array a by b
|
||||
static void xor_s(byte * a, const byte *b, int n) {
|
||||
int i;
|
||||
for (i = 0; i < n; i++) {
|
||||
a[i] ^= b[i];
|
||||
}
|
||||
}
|
||||
|
||||
// Xor the current cipher state by a specific round key
|
||||
static void xor_round_key(byte *state, const byte *keys, int round) {
|
||||
xor_s(state, keys + round * 16, 16);
|
||||
}
|
||||
|
||||
// Apply the rijndael s-box to all elements in an array
|
||||
// http://en.wikipedia.org/wiki/Rijndael_S-box
|
||||
static void sub_bytes(byte *a, int n) {
|
||||
int i;
|
||||
for (i = 0; i < n; i++) {
|
||||
a[i] = lookup_sbox[a[i]];
|
||||
}
|
||||
}
|
||||
static void sub_bytes_inv(byte *a, int n) {
|
||||
int i;
|
||||
for (i = 0; i < n; i++) {
|
||||
a[i] = lookup_sbox_inv[a[i]];
|
||||
}
|
||||
}
|
||||
|
||||
// Perform the core key schedule transform on 4 bytes, as part of the key expansion process
|
||||
// http://en.wikipedia.org/wiki/Rijndael_key_schedule#Key_schedule_core
|
||||
static void key_schedule_core(byte *a, int i) {
|
||||
byte temp = a[0]; // Rotate the output eight bits to the left
|
||||
a[0] = a[1];
|
||||
a[1] = a[2];
|
||||
a[2] = a[3];
|
||||
a[3] = temp;
|
||||
sub_bytes(a, 4); // Apply Rijndael's S-box on all four individual bytes in the output word
|
||||
a[0] ^= lookup_rcon[i]; // On just the first (leftmost) byte of the output word, perform the rcon operation with i
|
||||
// as the input, and exclusive or the rcon output with the first byte of the output word
|
||||
}
|
||||
|
||||
// Expand the 16-byte key to 11 round keys (176 bytes)
|
||||
// http://en.wikipedia.org/wiki/Rijndael_key_schedule#The_key_schedule
|
||||
void oqs_aes128_load_schedule_c(const uint8_t *key, void **_schedule) {
|
||||
*_schedule = malloc(16 * 11);
|
||||
assert(*_schedule != NULL);
|
||||
uint8_t *schedule = (uint8_t *) *_schedule;
|
||||
int bytes = 16; // The count of how many bytes we've created so far
|
||||
int i = 1; // The rcon iteration value i is set to 1
|
||||
int j; // For repeating the second stage 3 times
|
||||
byte t[4]; // Temporary working area known as 't' in the Wiki article
|
||||
memcpy(schedule, key, 16); // The first 16 bytes of the expanded key are simply the encryption key
|
||||
|
||||
while (bytes < 176) { // Until we have 176 bytes of expanded key, we do the following:
|
||||
memcpy(t, schedule + bytes - 4, 4); // We assign the value of the previous four bytes in the expanded key to t
|
||||
key_schedule_core(t, i); // We perform the key schedule core on t, with i as the rcon iteration value
|
||||
i++; // We increment i by 1
|
||||
xor_s(t, schedule + bytes - 16, 4); // We exclusive-or t with the four-byte block 16 bytes before the new expanded key.
|
||||
memcpy(schedule + bytes, t, 4); // This becomes the next 4 bytes in the expanded key
|
||||
bytes += 4; // Keep track of how many expanded key bytes we've added
|
||||
|
||||
// We then do the following three times to create the next twelve bytes
|
||||
for (j = 0; j < 3; j++) {
|
||||
memcpy(t, schedule + bytes - 4, 4); // We assign the value of the previous 4 bytes in the expanded key to t
|
||||
xor_s(t, schedule + bytes - 16, 4); // We exclusive-or t with the four-byte block n bytes before
|
||||
memcpy(schedule + bytes, t, 4); // This becomes the next 4 bytes in the expanded key
|
||||
bytes += 4; // Keep track of how many expanded key bytes we've added
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void oqs_aes128_free_schedule_c(void *schedule) {
|
||||
if (schedule != NULL) {
|
||||
free(schedule);
|
||||
}
|
||||
}
|
||||
|
||||
// Apply the shift rows step on the 16 byte cipher state
|
||||
// http://en.wikipedia.org/wiki/Advanced_Encryption_Standard#The_ShiftRows_step
|
||||
static void shift_rows(byte *state) {
|
||||
int i;
|
||||
byte temp[16];
|
||||
memcpy(temp, state, 16);
|
||||
for (i = 0; i < 16; i++) {
|
||||
state[i] = temp[shift_rows_table[i]];
|
||||
}
|
||||
}
|
||||
static void shift_rows_inv(byte *state) {
|
||||
int i;
|
||||
byte temp[16];
|
||||
memcpy(temp, state, 16);
|
||||
for (i = 0; i < 16; i++) {
|
||||
state[i] = temp[shift_rows_table_inv[i]];
|
||||
}
|
||||
}
|
||||
|
||||
// Perform the mix columns matrix on one column of 4 bytes
|
||||
// http://en.wikipedia.org/wiki/Rijndael_mix_columns
|
||||
static void mix_col(byte *state) {
|
||||
byte a0 = state[0];
|
||||
byte a1 = state[1];
|
||||
byte a2 = state[2];
|
||||
byte a3 = state[3];
|
||||
state[0] = lookup_g2[a0] ^ lookup_g3[a1] ^ a2 ^ a3;
|
||||
state[1] = lookup_g2[a1] ^ lookup_g3[a2] ^ a3 ^ a0;
|
||||
state[2] = lookup_g2[a2] ^ lookup_g3[a3] ^ a0 ^ a1;
|
||||
state[3] = lookup_g2[a3] ^ lookup_g3[a0] ^ a1 ^ a2;
|
||||
}
|
||||
|
||||
// Perform the mix columns matrix on each column of the 16 bytes
|
||||
static void mix_cols(byte *state) {
|
||||
mix_col(state);
|
||||
mix_col(state + 4);
|
||||
mix_col(state + 8);
|
||||
mix_col(state + 12);
|
||||
}
|
||||
|
||||
// Perform the inverse mix columns matrix on one column of 4 bytes
|
||||
// http://en.wikipedia.org/wiki/Rijndael_mix_columns
|
||||
static void mix_col_inv(byte *state) {
|
||||
byte a0 = state[0];
|
||||
byte a1 = state[1];
|
||||
byte a2 = state[2];
|
||||
byte a3 = state[3];
|
||||
state[0] = lookup_g14[a0] ^ lookup_g9[a3] ^ lookup_g13[a2] ^ lookup_g11[a1];
|
||||
state[1] = lookup_g14[a1] ^ lookup_g9[a0] ^ lookup_g13[a3] ^ lookup_g11[a2];
|
||||
state[2] = lookup_g14[a2] ^ lookup_g9[a1] ^ lookup_g13[a0] ^ lookup_g11[a3];
|
||||
state[3] = lookup_g14[a3] ^ lookup_g9[a2] ^ lookup_g13[a1] ^ lookup_g11[a0];
|
||||
}
|
||||
|
||||
// Perform the inverse mix columns matrix on each column of the 16 bytes
|
||||
static void mix_cols_inv(byte *state) {
|
||||
mix_col_inv(state);
|
||||
mix_col_inv(state + 4);
|
||||
mix_col_inv(state + 8);
|
||||
mix_col_inv(state + 12);
|
||||
}
|
||||
|
||||
void oqs_aes128_enc_c(const uint8_t *plaintext, const void *_schedule, uint8_t *ciphertext) {
|
||||
const uint8_t *schedule = (const uint8_t *) _schedule;
|
||||
int i; // To count the rounds
|
||||
|
||||
// First Round
|
||||
memcpy(ciphertext, plaintext, 16);
|
||||
xor_round_key(ciphertext, schedule, 0);
|
||||
|
||||
// Middle rounds
|
||||
for (i = 0; i < 9; i++) {
|
||||
sub_bytes(ciphertext, 16);
|
||||
shift_rows(ciphertext);
|
||||
mix_cols(ciphertext);
|
||||
xor_round_key(ciphertext, schedule, i + 1);
|
||||
}
|
||||
|
||||
// Final Round
|
||||
sub_bytes(ciphertext, 16);
|
||||
shift_rows(ciphertext);
|
||||
xor_round_key(ciphertext, schedule, 10);
|
||||
}
|
||||
|
||||
|
||||
void oqs_aes128_dec_c(const uint8_t *ciphertext, const void *_schedule, uint8_t *plaintext) {
|
||||
const uint8_t *schedule = (const uint8_t *) _schedule;
|
||||
int i; // To count the rounds
|
||||
|
||||
// Reverse the final Round
|
||||
memcpy(plaintext, ciphertext, 16);
|
||||
xor_round_key(plaintext, schedule, 10);
|
||||
shift_rows_inv(plaintext);
|
||||
sub_bytes_inv(plaintext, 16);
|
||||
|
||||
// Reverse the middle rounds
|
||||
for (i = 0; i < 9; i++) {
|
||||
xor_round_key(plaintext, schedule, 9 - i);
|
||||
mix_cols_inv(plaintext);
|
||||
shift_rows_inv(plaintext);
|
||||
sub_bytes_inv(plaintext, 16);
|
||||
}
|
||||
|
||||
// Reverse the first Round
|
||||
xor_round_key(plaintext, schedule, 0);
|
||||
}
|
||||
|
||||
// It's not enc nor dec, it's something in between
|
||||
void oqs_mhy128_enc_c(const uint8_t *plaintext, const void *_schedule, uint8_t *ciphertext) {
|
||||
const uint8_t *schedule = (const uint8_t *) _schedule;
|
||||
int i; // To count the rounds
|
||||
|
||||
// First Round
|
||||
memcpy(ciphertext, plaintext, 16);
|
||||
xor_round_key(ciphertext, schedule, 0);
|
||||
|
||||
// Middle rounds
|
||||
for (i = 0; i < 9; i++) {
|
||||
sub_bytes_inv(ciphertext, 16);
|
||||
shift_rows_inv(ciphertext);
|
||||
mix_cols_inv(ciphertext);
|
||||
xor_round_key(ciphertext, schedule, i + 1);
|
||||
}
|
||||
|
||||
// Final Round
|
||||
sub_bytes_inv(ciphertext, 16);
|
||||
shift_rows_inv(ciphertext);
|
||||
xor_round_key(ciphertext, schedule, 10);
|
||||
}
|
||||
|
||||
void oqs_mhy128_dec_c(const uint8_t *ciphertext, const void *_schedule, uint8_t *plaintext) {
|
||||
const uint8_t *schedule = (const uint8_t *) _schedule;
|
||||
int i; // To count the rounds
|
||||
|
||||
// Reverse the final Round
|
||||
memcpy(plaintext, ciphertext, 16);
|
||||
xor_round_key(plaintext, schedule, 10);
|
||||
shift_rows(plaintext);
|
||||
sub_bytes(plaintext, 16);
|
||||
|
||||
// Reverse the middle rounds
|
||||
for (i = 0; i < 9; i++) {
|
||||
xor_round_key(plaintext, schedule, 9 - i);
|
||||
mix_cols(plaintext);
|
||||
shift_rows(plaintext);
|
||||
sub_bytes(plaintext, 16);
|
||||
}
|
||||
|
||||
// Reverse the first Round
|
||||
xor_round_key(plaintext, schedule, 0);
|
||||
}
|
||||
66
src-tauri/mhycrypto/aes.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/**
|
||||
* \file aes.h
|
||||
* \brief Header defining the API for OQS AES
|
||||
*/
|
||||
|
||||
#ifndef __OQS_AES_H
|
||||
#define __OQS_AES_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/**
|
||||
* Function to fill a key schedule given an initial key.
|
||||
*
|
||||
* @param key Initial Key.
|
||||
* @param schedule Abstract data structure for a key schedule.
|
||||
* @param forEncryption 1 if key schedule is for encryption, 0 if for decryption.
|
||||
*/
|
||||
void OQS_AES128_load_schedule(const uint8_t *key, void **schedule, int for_encryption);
|
||||
|
||||
/**
|
||||
* Function to free a key schedule.
|
||||
*
|
||||
* @param schedule Schedule generated with OQS_AES128_load_schedule().
|
||||
*/
|
||||
void OQS_AES128_free_schedule(void *schedule);
|
||||
|
||||
/**
|
||||
* Function to encrypt blocks of plaintext using ECB mode.
|
||||
* A schedule based on the key is generated and used internally.
|
||||
*
|
||||
* @param plaintext Plaintext to be encrypted.
|
||||
* @param plaintext_len Length on the plaintext in bytes. Must be a multiple of 16.
|
||||
* @param key Key to be used for encryption.
|
||||
* @param ciphertext Pointer to a block of memory which >= in size to the plaintext block. The result will be written here.
|
||||
*/
|
||||
void OQS_AES128_ECB_enc(const uint8_t *plaintext, const size_t plaintext_len, const uint8_t *key, uint8_t *ciphertext);
|
||||
|
||||
/**
|
||||
* Function to decrypt blocks of plaintext using ECB mode.
|
||||
* A schedule based on the key is generated and used internally.
|
||||
*
|
||||
* @param ciphertext Ciphertext to be decrypted.
|
||||
* @param ciphertext_len Length on the ciphertext in bytes. Must be a multiple of 16.
|
||||
* @param key Key to be used for encryption.
|
||||
* @param ciphertext Pointer to a block of memory which >= in size to the ciphertext block. The result will be written here.
|
||||
*/
|
||||
void OQS_AES128_ECB_dec(const uint8_t *ciphertext, const size_t ciphertext_len, const uint8_t *key, uint8_t *plaintext);
|
||||
|
||||
/**
|
||||
* Same as OQS_AES128_ECB_enc() except a schedule generated by
|
||||
* OQS_AES128_load_schedule() is passed rather then a key. This is faster
|
||||
* if the same schedule is used for multiple encryptions since it does
|
||||
* not have to be regenerated from the key.
|
||||
*/
|
||||
void OQS_AES128_ECB_enc_sch(const uint8_t *plaintext, const size_t plaintext_len, const void *schedule, uint8_t *ciphertext);
|
||||
|
||||
/**
|
||||
* Same as OQS_AES128_ECB_dec() except a schedule generated by
|
||||
* OQS_AES128_load_schedule() is passed rather then a key. This is faster
|
||||
* if the same schedule is used for multiple encryptions since it does
|
||||
* not have to be regenerated from the key.
|
||||
*/
|
||||
void OQS_AES128_ECB_dec_sch(const uint8_t *ciphertext, const size_t ciphertext_len, const void *schedule, uint8_t *plaintext);
|
||||
|
||||
#endif
|
||||
31
src-tauri/mhycrypto/memecrypto.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include "memecrypto.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <stdio.h>
|
||||
|
||||
extern "C" void oqs_mhy128_enc_c(const uint8_t *plaintext, const void *_schedule, uint8_t *ciphertext);
|
||||
extern "C" void oqs_mhy128_dec_c(const uint8_t *ciphertext, const void *_schedule, uint8_t *plaintext);
|
||||
|
||||
static uint8_t dexor16(const uint8_t *c) {
|
||||
uint8_t ret = 0;
|
||||
for (int i = 0; i < 16; i++)
|
||||
ret ^= c[i];
|
||||
return ret;
|
||||
}
|
||||
|
||||
void memecrypto_prepare_key(const uint8_t *in, uint8_t *out) {
|
||||
for (int i = 0; i < 0xB0; i++)
|
||||
out[i] = dexor16(&in[0x10 * i]);
|
||||
}
|
||||
|
||||
void memecrypto_decrypt(const uint8_t *key, uint8_t *data) {
|
||||
uint8_t plaintext[16];
|
||||
oqs_mhy128_enc_c(data, key, plaintext);
|
||||
memcpy(data, plaintext, 16);
|
||||
}
|
||||
|
||||
void memecrypto_encrypt(const uint8_t *key, uint8_t *data) {
|
||||
uint8_t ciphertext[16];
|
||||
oqs_mhy128_dec_c(data, key, ciphertext);
|
||||
memcpy(data, ciphertext, 16);
|
||||
}
|
||||
12
src-tauri/mhycrypto/memecrypto.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef MEMECRYPTO_H
|
||||
#define MEMECRYPTO_H
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
void memecrypto_prepare_key(const uint8_t *in, uint8_t *out);
|
||||
|
||||
void memecrypto_decrypt(const uint8_t *key, uint8_t *data);
|
||||
|
||||
void memecrypto_encrypt(const uint8_t *key, uint8_t *data);
|
||||
|
||||
#endif //MEMECRYPTO_H
|
||||
128
src-tauri/mhycrypto/metadata.cpp
Normal file
@@ -0,0 +1,128 @@
|
||||
#include "metadata.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <random>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "memecrypto.h"
|
||||
#include "metadatastringdec.h"
|
||||
|
||||
unsigned char initial_prev_xor[] = { 0xad, 0x2f, 0x42, 0x30, 0x67, 0x04, 0xb0, 0x9c, 0x9d, 0x2a, 0xc0, 0xba, 0x0e, 0xbf, 0xa5, 0x68 };
|
||||
|
||||
bool get_global_metadata_keys(uint8_t *src, size_t srcn, uint8_t *longkey, uint8_t *shortkey) {
|
||||
if (srcn != 0x4000)
|
||||
return false;
|
||||
|
||||
if (*(uint16_t *) (src + 0xc8) != 0xfc2e || *(uint16_t *) (src + 0xca) != 0x2cfe)
|
||||
return true;
|
||||
|
||||
auto offB00 = *(uint16_t *) (src + 0xd2);
|
||||
|
||||
for (size_t i = 0; i < 16; i++)
|
||||
shortkey[i] = src[offB00 + i] ^ src[0x3000 + i];
|
||||
|
||||
for (size_t i = 0; i < 0xb00; i++)
|
||||
longkey[i] = src[offB00 + 0x10 + i] ^ src[0x3000 + 0x10 + i] ^ shortkey[i % 16];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool gen_global_metadata_key(uint8_t* src, size_t srcn) {
|
||||
if (srcn != 0x4000)
|
||||
return false;
|
||||
|
||||
#if 0
|
||||
std::vector<uint8_t> read_file(const char* n);
|
||||
auto data = read_file("xorpad.bin");
|
||||
memcpy(src, data.data(), 0x4000);
|
||||
|
||||
return false;
|
||||
#endif
|
||||
|
||||
std::mt19937_64 rand (0xDEADBEEF);
|
||||
|
||||
uint64_t* key = (uint64_t*)src;
|
||||
|
||||
for (int i = 0; i < srcn / sizeof(uint64_t); i++)
|
||||
key[i] = rand();
|
||||
|
||||
*(uint16_t *) (src + 0xc8) = 0xfc2e; // Magic
|
||||
*(uint16_t *) (src + 0xca) = 0x2cfe; // Magic
|
||||
*(uint16_t *) (src + 0xd2) = rand() & 0x1FFFu; // Just some random value
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
extern "C" void decrypt_global_metadata(uint8_t *data, size_t size) {
|
||||
uint8_t longkey[0xB00];
|
||||
uint8_t longkeyp[0xB0];
|
||||
uint8_t shortkey[16];
|
||||
get_global_metadata_keys(data + size - 0x4000, 0x4000, longkey, shortkey);
|
||||
for (int i = 0; i < 16; i++)
|
||||
shortkey[i] ^= initial_prev_xor[i];
|
||||
memecrypto_prepare_key(longkey, longkeyp);
|
||||
|
||||
auto perentry = (uint32_t) (size / 0x100 / 0x40);
|
||||
for (int i = 0; i < 0x100; i++) {
|
||||
auto off = (0x40u * perentry) * i;
|
||||
|
||||
uint8_t prev[16];
|
||||
memcpy(prev, shortkey, 16);
|
||||
for (int j = 0; j < 4; j++) {
|
||||
uint8_t curr[16];
|
||||
memcpy(curr, &data[off + j * 0x10], 16);
|
||||
|
||||
memecrypto_decrypt(longkeyp, curr);
|
||||
|
||||
for (int k = 0; k < 16; k++)
|
||||
curr[k] ^= prev[k];
|
||||
|
||||
memcpy(prev, &data[off + j * 0x10], 16);
|
||||
memcpy(&data[off + j * 0x10], curr, 16);
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t literal_dec_key[0x5000];
|
||||
recrypt_global_metadata_header_string_fields(data, size, literal_dec_key);
|
||||
recrypt_global_metadata_header_string_literals(data, size, literal_dec_key);
|
||||
}
|
||||
|
||||
extern "C" void encrypt_global_metadata(uint8_t* data, size_t size) {
|
||||
uint8_t literal_dec_key[0x5000];
|
||||
|
||||
gen_global_metadata_key(data + size - 0x4000, 0x4000);
|
||||
|
||||
generate_key_for_global_metadata_header_string(data, size, literal_dec_key);
|
||||
|
||||
recrypt_global_metadata_header_string_literals(data, size, literal_dec_key);
|
||||
recrypt_global_metadata_header_string_fields(data, size, literal_dec_key);
|
||||
|
||||
uint8_t longkey[0xB00];
|
||||
uint8_t longkeyp[0xB0];
|
||||
uint8_t shortkey[16];
|
||||
|
||||
get_global_metadata_keys(data + size - 0x4000, 0x4000, longkey, shortkey);
|
||||
for (int i = 0; i < 16; i++)
|
||||
shortkey[i] ^= initial_prev_xor[i];
|
||||
memecrypto_prepare_key(longkey, longkeyp);
|
||||
|
||||
auto perentry = (uint32_t) (size / 0x100 / 0x40);
|
||||
for (int i = 0; i < 0x100; i++) {
|
||||
auto off = (0x40u * perentry) * i;
|
||||
|
||||
uint8_t prev[16];
|
||||
memcpy(prev, shortkey, 16);
|
||||
for (int j = 0; j < 4; j++) {
|
||||
uint8_t curr[16];
|
||||
memcpy(curr, &data[off + j * 0x10], 16);
|
||||
|
||||
for (int k = 0; k < 16; k++)
|
||||
curr[k] ^= prev[k];
|
||||
|
||||
memecrypto_encrypt(longkeyp, curr);
|
||||
|
||||
memcpy(prev, curr, 16);
|
||||
memcpy(&data[off + j * 0x10], curr, 16);
|
||||
}
|
||||
}
|
||||
}
|
||||
10
src-tauri/mhycrypto/metadata.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef METADATA_H
|
||||
#define METADATA_H
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
|
||||
extern "C" void decrypt_global_metadata(uint8_t *data, size_t size);
|
||||
extern "C" void encrypt_global_metadata(uint8_t *data, size_t size);
|
||||
|
||||
#endif //METADATA_H
|
||||
121
src-tauri/mhycrypto/metadatastringdec.cpp
Normal file
@@ -0,0 +1,121 @@
|
||||
#include "metadatastringdec.h"
|
||||
|
||||
#include <stdexcept>
|
||||
#include <random>
|
||||
#include <stdio.h>
|
||||
|
||||
struct m_header_fields {
|
||||
char filler1[0x18];
|
||||
uint32_t stringLiteralDataOffset; // 18
|
||||
uint32_t stringLiteralDataCount; // 1c
|
||||
uint32_t stringLiteralOffset; // 20
|
||||
uint32_t stringLiteralCount; // 24
|
||||
char filler2[0xd8 - 0x28];
|
||||
uint32_t stringOffset, stringCount;
|
||||
};
|
||||
|
||||
struct m_literal {
|
||||
uint32_t offset, length;
|
||||
};
|
||||
|
||||
void generate_key_for_global_metadata_header_string(uint8_t* data, size_t len, uint8_t* literal_dec_key) {
|
||||
if (len < sizeof(m_header_fields))
|
||||
throw std::out_of_range("data not big enough for global metadata header");
|
||||
|
||||
uint32_t values[0x12] = {
|
||||
*(uint32_t *) (data + 0x60),
|
||||
*(uint32_t *) (data + 0x64),
|
||||
*(uint32_t *) (data + 0x68),
|
||||
*(uint32_t *) (data + 0x6c),
|
||||
*(uint32_t *) (data + 0x140),
|
||||
*(uint32_t *) (data + 0x144),
|
||||
*(uint32_t *) (data + 0x148),
|
||||
*(uint32_t *) (data + 0x14c),
|
||||
*(uint32_t *) (data + 0x100),
|
||||
*(uint32_t *) (data + 0x104),
|
||||
*(uint32_t *) (data + 0x108),
|
||||
*(uint32_t *) (data + 0x10c),
|
||||
*(uint32_t *) (data + 0xf0),
|
||||
*(uint32_t *) (data + 0xf4),
|
||||
*(uint32_t *) (data + 8),
|
||||
*(uint32_t *) (data + 0xc),
|
||||
*(uint32_t *) (data + 0x10),
|
||||
*(uint32_t *) (data + 0x14)
|
||||
};
|
||||
|
||||
uint64_t seed = ((uint64_t) values[values[0] & 0xfu] << 0x20u) | values[(values[0x11] & 0xf) + 2];
|
||||
|
||||
std::mt19937_64 rand (seed);
|
||||
|
||||
for (int i = 0; i < 6; i++) // Skip
|
||||
rand();
|
||||
|
||||
auto key64 = (uint64_t *) literal_dec_key;
|
||||
for (int i = 0; i < 0xa00; i++)
|
||||
key64[i] = rand();
|
||||
}
|
||||
|
||||
void recrypt_global_metadata_header_string_fields(uint8_t *data, size_t len, uint8_t *literal_dec_key) {
|
||||
if (len < sizeof(m_header_fields))
|
||||
throw std::out_of_range("data not big enough for global metadata header");
|
||||
|
||||
uint32_t values[0x12] = {
|
||||
*(uint32_t *) (data + 0x60),
|
||||
*(uint32_t *) (data + 0x64),
|
||||
*(uint32_t *) (data + 0x68),
|
||||
*(uint32_t *) (data + 0x6c),
|
||||
*(uint32_t *) (data + 0x140),
|
||||
*(uint32_t *) (data + 0x144),
|
||||
*(uint32_t *) (data + 0x148),
|
||||
*(uint32_t *) (data + 0x14c),
|
||||
*(uint32_t *) (data + 0x100),
|
||||
*(uint32_t *) (data + 0x104),
|
||||
*(uint32_t *) (data + 0x108),
|
||||
*(uint32_t *) (data + 0x10c),
|
||||
*(uint32_t *) (data + 0xf0),
|
||||
*(uint32_t *) (data + 0xf4),
|
||||
*(uint32_t *) (data + 8),
|
||||
*(uint32_t *) (data + 0xc),
|
||||
*(uint32_t *) (data + 0x10),
|
||||
*(uint32_t *) (data + 0x14)
|
||||
};
|
||||
|
||||
uint64_t seed = ((uint64_t) values[values[0] & 0xfu] << 0x20u) | values[(values[0x11] & 0xf) + 2];
|
||||
|
||||
std::mt19937_64 rand (seed);
|
||||
|
||||
auto header = (m_header_fields *) data;
|
||||
header->stringCount ^= (uint32_t) rand();
|
||||
header->stringOffset ^= (uint32_t) rand();
|
||||
rand();
|
||||
header->stringLiteralOffset ^= (uint32_t) rand();
|
||||
header->stringLiteralDataCount ^= (uint32_t) rand();
|
||||
header->stringLiteralDataOffset ^= (uint32_t) rand();
|
||||
|
||||
auto key64 = (uint64_t *) literal_dec_key;
|
||||
for (int i = 0; i < 0xa00; i++)
|
||||
key64[i] = rand();
|
||||
}
|
||||
|
||||
void recrypt_global_metadata_header_string_literals(uint8_t *data, size_t len, uint8_t *literal_dec_key) {
|
||||
if (len < sizeof(m_header_fields))
|
||||
throw std::out_of_range("data not big enough for global metadata header");
|
||||
|
||||
auto header = (m_header_fields *) data;
|
||||
if ((size_t) header->stringLiteralCount + header->stringLiteralOffset > len)
|
||||
throw std::out_of_range("file trimmed or string literal offset/count field invalid");
|
||||
|
||||
auto literals = (m_literal *) (data + header->stringLiteralOffset);
|
||||
auto count = header->stringLiteralCount / sizeof(m_literal);
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
auto slen = literals[i].length;
|
||||
uint8_t *str = data + header->stringLiteralDataOffset + literals[i].offset;
|
||||
uint8_t *okey = literal_dec_key + (i % 0x2800);
|
||||
|
||||
if ((size_t) header->stringLiteralDataOffset + literals[i].offset + slen > len)
|
||||
throw std::out_of_range("file trimmed or contains invalid string entry");
|
||||
|
||||
for (size_t j = 0; j < slen; j++)
|
||||
str[j] ^= literal_dec_key[(j + 0x1400u) % 0x5000u] ^ (okey[j % 0x2800u] + (uint8_t) j);
|
||||
}
|
||||
}
|
||||
13
src-tauri/mhycrypto/metadatastringdec.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#ifndef METADATASTRINGDEC_H
|
||||
#define METADATASTRINGDEC_H
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
|
||||
void recrypt_global_metadata_header_string_fields(uint8_t *data, size_t len, uint8_t *literal_dec_key);
|
||||
|
||||
void recrypt_global_metadata_header_string_literals(uint8_t *data, size_t len, uint8_t *literal_dec_key);
|
||||
|
||||
void generate_key_for_global_metadata_header_string(uint8_t* data, size_t len, uint8_t* literal_dec_key);
|
||||
|
||||
#endif //METADATASTRINGDEC_H
|
||||
3
src-tauri/rustfmt.toml
Normal file
@@ -0,0 +1,3 @@
|
||||
tab_spaces = 2
|
||||
use_field_init_shorthand = true
|
||||
use_try_shorthand = true
|
||||
@@ -1,36 +1,28 @@
|
||||
use lazy_static::lazy_static;
|
||||
use once_cell::sync::Lazy;
|
||||
|
||||
use std::sync::Mutex;
|
||||
use std::cmp::min;
|
||||
use std::fs::File;
|
||||
use std::io::Write;
|
||||
use std::sync::Mutex;
|
||||
|
||||
use futures_util::StreamExt;
|
||||
|
||||
// This will create a downloads list that will be used to check if we should continue downloading the file
|
||||
lazy_static! {
|
||||
static ref DOWNLOADS: Mutex<Vec<String>> = {
|
||||
let m = Vec::new();
|
||||
Mutex::new(m)
|
||||
};
|
||||
}
|
||||
static DOWNLOADS: Lazy<Mutex<Vec<String>>> = Lazy::new(|| Mutex::new(Vec::new()));
|
||||
|
||||
// Lots of help from: https://gist.github.com/giuliano-oliveira/4d11d6b3bb003dba3a1b53f43d81b30d
|
||||
// and docs ofc
|
||||
#[tauri::command]
|
||||
pub async fn download_file(window: tauri::Window, url: &str, path: &str) -> Result<(), String> {
|
||||
// Reqwest setup
|
||||
let res = match reqwest::get(url)
|
||||
.await {
|
||||
let res = match reqwest::get(url).await {
|
||||
Ok(r) => r,
|
||||
Err(_e) => {
|
||||
emit_download_err(window, format!("Failed to request {}", url), path);
|
||||
return Err(format!("Failed to request {}", url));
|
||||
}
|
||||
};
|
||||
let total_size = res
|
||||
.content_length()
|
||||
.unwrap_or(0);
|
||||
let total_size = res.content_length().unwrap_or(0);
|
||||
|
||||
// Create file path
|
||||
let mut file = match File::create(path) {
|
||||
@@ -59,17 +51,17 @@ pub async fn download_file(window: tauri::Window, url: &str, path: &str) -> Resu
|
||||
let chunk = match item {
|
||||
Ok(itm) => itm,
|
||||
Err(e) => {
|
||||
emit_download_err(window, format!("Error while downloading file"), path);
|
||||
emit_download_err(window, "Error while downloading file".to_string(), path);
|
||||
return Err(format!("Error while downloading file: {}", e));
|
||||
}
|
||||
};
|
||||
let vect = &chunk.to_vec()[..];
|
||||
|
||||
// Write bytes
|
||||
match file.write_all(&vect) {
|
||||
match file.write_all(vect) {
|
||||
Ok(x) => x,
|
||||
Err(e) => {
|
||||
emit_download_err(window, format!("Error while writing file"), path);
|
||||
emit_download_err(window, "Error while writing file".to_string(), path);
|
||||
return Err(format!("Error while writing file: {}", e));
|
||||
}
|
||||
}
|
||||
@@ -78,29 +70,14 @@ pub async fn download_file(window: tauri::Window, url: &str, path: &str) -> Resu
|
||||
let new = min(downloaded + (chunk.len() as u64), total_size);
|
||||
downloaded = new;
|
||||
|
||||
total_downloaded = total_downloaded + chunk.len() as u64;
|
||||
total_downloaded += chunk.len() as u64;
|
||||
|
||||
let mut res_hash = std::collections::HashMap::new();
|
||||
|
||||
res_hash.insert(
|
||||
"downloaded".to_string(),
|
||||
downloaded.to_string(),
|
||||
);
|
||||
|
||||
res_hash.insert(
|
||||
"total".to_string(),
|
||||
total_size.to_string(),
|
||||
);
|
||||
|
||||
res_hash.insert(
|
||||
"path".to_string(),
|
||||
path.to_string(),
|
||||
);
|
||||
|
||||
res_hash.insert(
|
||||
"total_downloaded".to_string(),
|
||||
total_downloaded.to_string(),
|
||||
);
|
||||
res_hash.insert("downloaded".to_string(), downloaded.to_string());
|
||||
res_hash.insert("total".to_string(), total_size.to_string());
|
||||
res_hash.insert("path".to_string(), path.to_string());
|
||||
res_hash.insert("total_downloaded".to_string(), total_downloaded.to_string());
|
||||
|
||||
// Create event to send to frontend
|
||||
window.emit("download_progress", &res_hash).unwrap();
|
||||
@@ -110,21 +87,14 @@ pub async fn download_file(window: tauri::Window, url: &str, path: &str) -> Resu
|
||||
window.emit("download_finished", &path).unwrap();
|
||||
|
||||
// We are done
|
||||
return Ok(());
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn emit_download_err(window: tauri::Window, msg: std::string::String, path: &str) {
|
||||
pub fn emit_download_err(window: tauri::Window, msg: String, path: &str) {
|
||||
let mut res_hash = std::collections::HashMap::new();
|
||||
|
||||
res_hash.insert(
|
||||
"error".to_string(),
|
||||
msg.to_string(),
|
||||
);
|
||||
|
||||
res_hash.insert(
|
||||
"path".to_string(),
|
||||
path.to_string(),
|
||||
);
|
||||
res_hash.insert("error".to_string(), msg);
|
||||
res_hash.insert("path".to_string(), path.to_string());
|
||||
|
||||
window.emit("download_error", &res_hash).unwrap();
|
||||
}
|
||||
@@ -144,4 +114,4 @@ pub fn stop_download(path: String) {
|
||||
if let Err(_e) = std::fs::remove_file(&path) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,35 +1,145 @@
|
||||
use std::fs;
|
||||
use file_diff::diff;
|
||||
use std::{io::{Read, Write}};
|
||||
|
||||
#[tauri::command]
|
||||
pub fn rename(path: String, new_name: String) {
|
||||
let mut new_path = path.clone();
|
||||
|
||||
// Check if file/folder to replace exists
|
||||
if !fs::metadata(&path).is_ok() {
|
||||
if fs::metadata(&path).is_err() {
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if path uses forward or back slashes
|
||||
if new_path.contains("\\") {
|
||||
new_path = path.replace("\\", "/");
|
||||
if new_path.contains('\\') {
|
||||
new_path = path.replace('\\', "/");
|
||||
}
|
||||
|
||||
let path_replaced = &path.replace(&new_path.split("/").last().unwrap(), &new_name);
|
||||
let path_replaced = &path.replace(&new_path.split('/').last().unwrap(), &new_name);
|
||||
|
||||
fs::rename(path, &path_replaced).unwrap();
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn dir_exists(path: &str) -> bool {
|
||||
return fs::metadata(&path).is_ok();
|
||||
fs::metadata(&path).is_ok()
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn dir_is_empty(path: &str) -> bool {
|
||||
return fs::read_dir(&path).unwrap().count() == 0;
|
||||
fs::read_dir(&path).unwrap().count() == 0
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn dir_delete(path: &str) {
|
||||
fs::remove_dir_all(path).unwrap();
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn are_files_identical(path1: &str, path2: &str) -> bool {
|
||||
diff(path1, path2)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn copy_file(path: String, new_path: String) -> bool {
|
||||
let filename = &path.split('/').last().unwrap();
|
||||
let mut new_path_buf = std::path::PathBuf::from(&new_path);
|
||||
|
||||
// If the new path doesn't exist, create it.
|
||||
if !dir_exists(new_path_buf.pop().to_string().as_str()) {
|
||||
std::fs::create_dir_all(&new_path).unwrap();
|
||||
}
|
||||
|
||||
// Copy old to new
|
||||
match std::fs::copy(&path, format!("{}/{}", new_path, filename)) {
|
||||
Ok(_) => true,
|
||||
Err(e) => {
|
||||
println!("Failed to copy file: {}", e);
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn copy_file_with_new_name(path: String, new_path: String, new_name: String) -> bool {
|
||||
let mut new_path_buf = std::path::PathBuf::from(&new_path);
|
||||
|
||||
// If the new path doesn't exist, create it.
|
||||
if !dir_exists(new_path_buf.pop().to_string().as_str()) {
|
||||
match std::fs::create_dir_all(&new_path) {
|
||||
Ok(_) => {}
|
||||
Err(e) => {
|
||||
println!("Failed to create directory: {}", e);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Copy old to new
|
||||
match std::fs::copy(&path, format!("{}/{}", new_path, new_name)) {
|
||||
Ok(_) => true,
|
||||
Err(e) => {
|
||||
println!("Failed to copy file: {}", e);
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn delete_file(path: String) -> bool {
|
||||
match std::fs::remove_file(path) {
|
||||
Ok(_) => true,
|
||||
Err(e) => {
|
||||
println!("Failed to delete file: {}", e);
|
||||
false
|
||||
}
|
||||
};
|
||||
|
||||
false
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn read_file(path: String) -> String {
|
||||
let mut file = match fs::File::open(path) {
|
||||
Ok(file) => file,
|
||||
Err(e) => {
|
||||
println!("Failed to open file: {}", e);
|
||||
return String::new();
|
||||
}
|
||||
};
|
||||
|
||||
let mut contents = String::new();
|
||||
file.read_to_string(&mut contents).unwrap();
|
||||
|
||||
contents
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn write_file(path: String, contents: String) {
|
||||
// Create file if it exists, otherwise just open and rewrite
|
||||
let mut file = match fs::File::open(&path) {
|
||||
Ok(file) => file,
|
||||
Err(e) => {
|
||||
println!("Failed to open file: {}", e);
|
||||
|
||||
// attempt to create file. otherwise return
|
||||
match fs::File::create(&path) {
|
||||
Ok(file) => file,
|
||||
Err(e) => {
|
||||
println!("Failed to create file: {}", e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Write contents to file
|
||||
match file.write_all(contents.as_bytes()) {
|
||||
Ok(_) => (),
|
||||
Err(e) => {
|
||||
println!("Failed to write to file: {}", e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,21 @@
|
||||
use crate::system_helpers::*;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn get_lang(window: tauri::Window, lang: String) -> String {
|
||||
let lang = lang.to_lowercase();
|
||||
|
||||
// Send contents of language file back
|
||||
let contents = match std::fs::read_to_string(format!("{}/lang/{}.json", install_location(), lang)) {
|
||||
let lang_path: PathBuf = [&install_location(), "lang", &format!("{}.json", lang)]
|
||||
.iter()
|
||||
.collect();
|
||||
match std::fs::read_to_string(&lang_path) {
|
||||
Ok(x) => x,
|
||||
Err(e) => {
|
||||
emit_lang_err(window, format!("Failed to read language file: {}", e));
|
||||
return "".to_string();
|
||||
"".to_string()
|
||||
}
|
||||
};
|
||||
|
||||
return contents;
|
||||
}
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
@@ -21,14 +23,14 @@ pub async fn get_languages() -> std::collections::HashMap<String, String> {
|
||||
// for each lang file, set the key as the filename and the value as the lang_name contained in the file
|
||||
let mut languages = std::collections::HashMap::new();
|
||||
|
||||
let mut lang_files = std::fs::read_dir(format!("{}/lang", install_location())).unwrap();
|
||||
let lang_files = std::fs::read_dir(Path::new(&install_location()).join("lang")).unwrap();
|
||||
|
||||
while let Some(entry) = lang_files.next() {
|
||||
for entry in lang_files {
|
||||
let entry = entry.unwrap();
|
||||
let path = entry.path();
|
||||
let filename = path.file_name().unwrap().to_str().unwrap();
|
||||
|
||||
let content = match std::fs::read_to_string(path.to_str().unwrap()) {
|
||||
let content = match std::fs::read_to_string(&path) {
|
||||
Ok(x) => x,
|
||||
Err(e) => {
|
||||
println!("Failed to read language file: {}", e);
|
||||
@@ -39,16 +41,13 @@ pub async fn get_languages() -> std::collections::HashMap<String, String> {
|
||||
languages.insert(filename.to_string(), content);
|
||||
}
|
||||
|
||||
return languages;
|
||||
languages
|
||||
}
|
||||
|
||||
pub fn emit_lang_err(window: tauri::Window, msg: std::string::String) {
|
||||
pub fn emit_lang_err(window: tauri::Window, msg: String) {
|
||||
let mut res_hash = std::collections::HashMap::new();
|
||||
|
||||
res_hash.insert(
|
||||
"error".to_string(),
|
||||
msg.to_string(),
|
||||
);
|
||||
res_hash.insert("error".to_string(), msg);
|
||||
|
||||
window.emit("lang_error", &res_hash).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,41 +1,28 @@
|
||||
#![cfg_attr(
|
||||
all(not(debug_assertions), target_os = "windows"),
|
||||
windows_subsystem = "windows"
|
||||
all(not(debug_assertions), target_os = "windows"),
|
||||
windows_subsystem = "windows"
|
||||
)]
|
||||
|
||||
use lazy_static::lazy_static;
|
||||
use std::{sync::Mutex, collections::HashMap};
|
||||
use once_cell::sync::Lazy;
|
||||
use std::{collections::HashMap, sync::Mutex};
|
||||
|
||||
use std::thread;
|
||||
use structs::APIQuery;
|
||||
use sysinfo::{System, SystemExt};
|
||||
use structs::{APIQuery};
|
||||
|
||||
mod structs;
|
||||
mod system_helpers;
|
||||
mod file_helpers;
|
||||
mod unzip;
|
||||
mod downloader;
|
||||
mod file_helpers;
|
||||
mod lang;
|
||||
mod proxy;
|
||||
mod structs;
|
||||
mod system_helpers;
|
||||
mod unzip;
|
||||
mod web;
|
||||
mod metadata_patcher;
|
||||
|
||||
lazy_static! {
|
||||
static ref WATCH_GAME_PROCESS: Mutex<String> = {
|
||||
let m = "".to_string();
|
||||
Mutex::new(m)
|
||||
};
|
||||
}
|
||||
static WATCH_GAME_PROCESS: Lazy<Mutex<String>> = Lazy::new(|| Mutex::new(String::new()));
|
||||
|
||||
fn main() {
|
||||
// Start the game process watcher.
|
||||
process_watcher();
|
||||
|
||||
// Make BG folder if it doesn't exist.
|
||||
let bg_folder = format!("{}/bg", system_helpers::install_location());
|
||||
if !std::path::Path::new(&bg_folder).exists() {
|
||||
std::fs::create_dir_all(&bg_folder).unwrap();
|
||||
}
|
||||
|
||||
tauri::Builder::default()
|
||||
.invoke_handler(tauri::generate_handler![
|
||||
enable_process_watcher,
|
||||
@@ -43,14 +30,12 @@ fn main() {
|
||||
disconnect,
|
||||
req_get,
|
||||
get_bg_file,
|
||||
base64_decode,
|
||||
is_game_running,
|
||||
get_theme_list,
|
||||
system_helpers::run_command,
|
||||
system_helpers::run_program,
|
||||
system_helpers::run_jar,
|
||||
system_helpers::open_in_browser,
|
||||
system_helpers::copy_file,
|
||||
system_helpers::install_location,
|
||||
system_helpers::is_elevated,
|
||||
proxy::set_proxy_addr,
|
||||
@@ -60,63 +45,71 @@ fn main() {
|
||||
file_helpers::dir_exists,
|
||||
file_helpers::dir_is_empty,
|
||||
file_helpers::dir_delete,
|
||||
file_helpers::copy_file,
|
||||
file_helpers::copy_file_with_new_name,
|
||||
file_helpers::delete_file,
|
||||
file_helpers::are_files_identical,
|
||||
file_helpers::read_file,
|
||||
file_helpers::write_file,
|
||||
downloader::download_file,
|
||||
downloader::stop_download,
|
||||
lang::get_lang,
|
||||
lang::get_languages,
|
||||
web::valid_url
|
||||
web::valid_url,
|
||||
web::web_get,
|
||||
metadata_patcher::patch_metadata
|
||||
])
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
}
|
||||
|
||||
fn process_watcher() {
|
||||
// Every 5 seconds, see if the game process is still running.
|
||||
// If it is not, then we assume the game has closed and disable the proxy
|
||||
// to prevent any requests from being sent to the game.
|
||||
|
||||
// Start a thread so as to not block the main thread.
|
||||
thread::spawn(|| {
|
||||
let mut system = System::new_all();
|
||||
|
||||
loop {
|
||||
// Refresh system info
|
||||
system.refresh_all();
|
||||
|
||||
// Grab the game process name
|
||||
let proc = WATCH_GAME_PROCESS.lock().unwrap().to_string();
|
||||
|
||||
if !&proc.is_empty() {
|
||||
let proc_with_name = system.processes_by_exact_name(&proc);
|
||||
let mut exists = false;
|
||||
|
||||
for _p in proc_with_name {
|
||||
exists = true;
|
||||
break;
|
||||
}
|
||||
|
||||
// If the game process closes, disable the proxy.
|
||||
if !exists {
|
||||
*WATCH_GAME_PROCESS.lock().unwrap() = "".to_string();
|
||||
disconnect();
|
||||
}
|
||||
}
|
||||
thread::sleep(std::time::Duration::from_secs(5));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn is_game_running() -> bool {
|
||||
// Grab the game process name
|
||||
let proc = WATCH_GAME_PROCESS.lock().unwrap().to_string();
|
||||
|
||||
return !proc.is_empty();
|
||||
!proc.is_empty()
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn enable_process_watcher(process: String) {
|
||||
fn enable_process_watcher(window: tauri::Window,process: String) {
|
||||
*WATCH_GAME_PROCESS.lock().unwrap() = process;
|
||||
|
||||
window.listen("disable_process_watcher", |_e| {
|
||||
*WATCH_GAME_PROCESS.lock().unwrap() = "".to_string();
|
||||
});
|
||||
|
||||
println!("Starting process watcher...");
|
||||
|
||||
thread::spawn(move || {
|
||||
let mut system = System::new_all();
|
||||
|
||||
loop {
|
||||
thread::sleep(std::time::Duration::from_secs(5));
|
||||
|
||||
// Refresh system info
|
||||
system.refresh_all();
|
||||
|
||||
// Grab the game process name
|
||||
let proc = WATCH_GAME_PROCESS.lock().unwrap().to_string();
|
||||
|
||||
if !proc.is_empty() {
|
||||
let mut proc_with_name = system.processes_by_exact_name(&proc);
|
||||
let exists = proc_with_name.next().is_some();
|
||||
|
||||
// If the game process closes, disable the proxy.
|
||||
if !exists {
|
||||
println!("Game closed");
|
||||
|
||||
*WATCH_GAME_PROCESS.lock().unwrap() = "".to_string();
|
||||
disconnect();
|
||||
|
||||
window.emit("game_closed", &()).unwrap();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
@@ -142,11 +135,8 @@ fn disconnect() {
|
||||
|
||||
#[tauri::command]
|
||||
async fn req_get(url: String) -> String {
|
||||
// Send a GET request to the specified URL.
|
||||
let response = web::query(&url.to_string()).await;
|
||||
|
||||
// Send the response body back to the client.
|
||||
return response;
|
||||
// Send a GET request to the specified URL and send the response body back to the client.
|
||||
web::query(&url.to_string()).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
@@ -175,20 +165,21 @@ async fn get_theme_list(data_dir: String) -> Vec<HashMap<String, String>> {
|
||||
|
||||
map.insert("json".to_string(), theme_json);
|
||||
map.insert("path".to_string(), path.to_str().unwrap().to_string());
|
||||
|
||||
|
||||
// Push key-value pair containing "json" and "path"
|
||||
themes.push(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return themes;
|
||||
themes
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
// TODO: Replace with downloading the background file & saving it.
|
||||
async fn get_bg_file(bg_path: String, appdata: String) -> String {
|
||||
let copy_loc = appdata;
|
||||
let query = web::query("https://api.grasscutters.xyz/cultivation/query").await;
|
||||
let query = web::query("https://api.grasscutter.io/cultivation/query").await;
|
||||
let response_data: APIQuery = match serde_json::from_str(&query) {
|
||||
Ok(data) => data,
|
||||
Err(e) => {
|
||||
@@ -205,7 +196,7 @@ async fn get_bg_file(bg_path: String, appdata: String) -> String {
|
||||
}
|
||||
|
||||
// Now we check if the bg folder, which is one directory above the game_path, exists.
|
||||
let bg_img_path = format!("{}\\{}", bg_path.clone().to_string(), file_name.as_str());
|
||||
let bg_img_path = format!("{}\\{}", &bg_path, &file_name);
|
||||
|
||||
// If it doesn't, then we do not have backgrounds to grab.
|
||||
if !file_helpers::dir_exists(&bg_path) {
|
||||
@@ -221,21 +212,15 @@ async fn get_bg_file(bg_path: String, appdata: String) -> String {
|
||||
// The image exists, lets copy it to our local '\bg' folder.
|
||||
let bg_img_path_local = format!("{}\\bg\\{}", copy_loc, file_name.as_str());
|
||||
|
||||
return match std::fs::copy(bg_img_path, bg_img_path_local) {
|
||||
match std::fs::copy(bg_img_path, bg_img_path_local) {
|
||||
Ok(_) => {
|
||||
// Copy was successful, lets return true.
|
||||
format!("{}\\{}", copy_loc, response_data.bg_file.as_str())
|
||||
format!("{}\\{}", copy_loc, response_data.bg_file)
|
||||
}
|
||||
Err(e) => {
|
||||
// Copy failed, lets return false
|
||||
println!("Failed to copy background image: {}", e);
|
||||
"".to_string()
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn base64_decode(encoded: String) -> String {
|
||||
let decoded = base64::decode(&encoded).unwrap();
|
||||
return String::from_utf8(decoded).unwrap();
|
||||
}
|
||||
162
src-tauri/src/metadata_patcher.rs
Normal file
@@ -0,0 +1,162 @@
|
||||
use regex::Regex;
|
||||
use std::fs::File;
|
||||
use std::fs::OpenOptions;
|
||||
use std::io::Read;
|
||||
use std::io::Write;
|
||||
|
||||
extern {
|
||||
fn decrypt_global_metadata(data : *mut u8, size : u64);
|
||||
fn encrypt_global_metadata(data : *mut u8, size : u64);
|
||||
}
|
||||
|
||||
fn dll_decrypt_global_metadata(data : *mut u8, size : u64) -> Result<bool, Box<dyn std::error::Error>> {
|
||||
unsafe {
|
||||
decrypt_global_metadata(data, size);
|
||||
Ok(true)
|
||||
}
|
||||
}
|
||||
|
||||
fn dll_encrypt_global_metadata(data : *mut u8, size : u64) -> Result<bool, Box<dyn std::error::Error>> {
|
||||
unsafe {
|
||||
encrypt_global_metadata(data, size);
|
||||
Ok(true)
|
||||
}
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn patch_metadata(metadata_folder: &str) -> bool {
|
||||
let metadata_file = &(metadata_folder.to_owned() + "\\global-metadata-unpatched.dat");
|
||||
println!("Patching metadata file: {}", metadata_file);
|
||||
let decrypted = decrypt_metadata(metadata_file);
|
||||
if do_vecs_match(&decrypted, &Vec::new()) {
|
||||
println!("Failed to decrypt metadata file.");
|
||||
return false;
|
||||
}
|
||||
|
||||
let modified = replace_keys(&decrypted);
|
||||
if do_vecs_match(&modified, &Vec::new()) {
|
||||
println!("Failed to replace keys in metadata file.");
|
||||
return false;
|
||||
}
|
||||
|
||||
let encrypted = encrypt_metadata(&modified);
|
||||
if do_vecs_match(&encrypted, &Vec::new()) {
|
||||
println!("Failed to re-encrypt metadata file.");
|
||||
return false;
|
||||
}
|
||||
|
||||
//write encrypted to file
|
||||
let mut file = match OpenOptions::new().create(true).write(true).open(&(metadata_folder.to_owned() + "\\global-metadata-patched.dat")) {
|
||||
Ok(file) => file,
|
||||
Err(e) => {
|
||||
println!("Failed to open global-metadata: {}", e);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
file.write_all(&encrypted).unwrap();
|
||||
|
||||
true
|
||||
}
|
||||
|
||||
fn decrypt_metadata(file_path: &str) -> Vec<u8> {
|
||||
let mut file = match File::open(file_path) {
|
||||
Ok(file) => file,
|
||||
Err(e) => {
|
||||
println!("Failed to open global-metadata: {}", e);
|
||||
return Vec::new();
|
||||
}
|
||||
};
|
||||
let mut data = Vec::new();
|
||||
|
||||
// Read metadata file
|
||||
match file.read_to_end(&mut data) {
|
||||
Ok(_) => (),
|
||||
Err(e) => {
|
||||
println!("Failed to read global-metadata: {}", e);
|
||||
return Vec::new();
|
||||
}
|
||||
}
|
||||
|
||||
// Decrypt metadata file
|
||||
match dll_decrypt_global_metadata(data.as_mut_ptr(), data.len().try_into().unwrap()) {
|
||||
Ok(_) => {
|
||||
println!("Successfully decrypted global-metadata");
|
||||
data
|
||||
}
|
||||
Err(e) => {
|
||||
println!("Failed to decrypt global-metadata: {}", e);
|
||||
Vec::new()
|
||||
}
|
||||
};
|
||||
|
||||
Vec::new()
|
||||
}
|
||||
|
||||
fn replace_keys(data: &[u8]) -> Vec<u8> {
|
||||
let mut new_data = String::new();
|
||||
|
||||
unsafe {
|
||||
let data_str = String::from_utf8_unchecked(data.to_vec());
|
||||
|
||||
let re = Regex::new(r"<RSAKeyValue>((.|\n|\r)*?)</RSAKeyValue>").unwrap();
|
||||
let matches = re.find_iter(&data_str);
|
||||
|
||||
// dispatch key is index 3
|
||||
// password key is index 2
|
||||
|
||||
for (i, rmatch) in matches.enumerate() {
|
||||
let key = rmatch.as_str();
|
||||
|
||||
if i == 2 {
|
||||
println!("Replacing password key");
|
||||
new_data = replace_rsa_key(&data_str, key, "passwordKey.txt");
|
||||
} else if i == 3 {
|
||||
println!("Replacing dispatch key");
|
||||
new_data = replace_rsa_key(&new_data, key, "dispatchKey.txt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new_data.as_bytes().to_vec();
|
||||
}
|
||||
|
||||
fn replace_rsa_key(old_data: &str, to_replace: &str, file_name: &str) -> String {
|
||||
// Read dispatch key file
|
||||
unsafe {
|
||||
let mut new_key_file = match File::open(&("keys/".to_owned() + file_name)) {
|
||||
Ok(file) => file,
|
||||
Err(e) => {
|
||||
println!("Failed to open keys/{}: {}", file_name, e);
|
||||
return String::new();
|
||||
}
|
||||
};
|
||||
let mut key_data = Vec::new();
|
||||
new_key_file.read_to_end(&mut key_data).unwrap();
|
||||
let new_key = String::from_utf8_unchecked(key_data.to_vec());
|
||||
|
||||
// Replace old key with new key
|
||||
old_data.replace(to_replace, &new_key)
|
||||
}
|
||||
}
|
||||
|
||||
fn encrypt_metadata(old_data: &[u8]) -> Vec<u8> {
|
||||
let mut data = old_data.to_vec();
|
||||
match dll_encrypt_global_metadata(data.as_mut_ptr(), data.len().try_into().unwrap()) {
|
||||
Ok(_) => {
|
||||
println!("Successfully encrypted global-metadata");
|
||||
data
|
||||
}
|
||||
Err(e) => {
|
||||
println!("Failed to encrypt global-metadata: {}", e);
|
||||
Vec::new()
|
||||
}
|
||||
};
|
||||
|
||||
Vec::new()
|
||||
}
|
||||
|
||||
fn do_vecs_match<T: PartialEq>(a: &Vec<T>, b: &Vec<T>) -> bool {
|
||||
let matching = a.iter().zip(b.iter()).filter(|&(a, b)| a == b).count();
|
||||
matching == a.len() && matching == b.len()
|
||||
}
|
||||
@@ -3,37 +3,35 @@
|
||||
* https://github.com/omjadas/hudsucker/blob/main/examples/log.rs
|
||||
*/
|
||||
|
||||
use lazy_static::lazy_static;
|
||||
use std::{sync::Mutex, str::FromStr};
|
||||
use once_cell::sync::Lazy;
|
||||
use std::{str::FromStr, sync::Mutex};
|
||||
|
||||
use rcgen::*;
|
||||
use hudsucker::{
|
||||
async_trait::async_trait,
|
||||
certificate_authority::RcgenAuthority,
|
||||
hyper::{Body, Request, Response},
|
||||
*,
|
||||
};
|
||||
use rcgen::*;
|
||||
|
||||
use std::fs;
|
||||
use std::net::SocketAddr;
|
||||
use registry::{Hive, Data, Security};
|
||||
use std::path::Path;
|
||||
|
||||
use rustls_pemfile as pemfile;
|
||||
use tauri::http::Uri;
|
||||
use crate::system_helpers::run_command;
|
||||
|
||||
#[cfg(windows)]
|
||||
use registry::{Data, Hive, Security};
|
||||
|
||||
async fn shutdown_signal() {
|
||||
tokio::signal::ctrl_c().await
|
||||
tokio::signal::ctrl_c()
|
||||
.await
|
||||
.expect("Failed to install CTRL+C signal handler");
|
||||
}
|
||||
|
||||
// Global ver for getting server address.
|
||||
lazy_static! {
|
||||
static ref SERVER: Mutex<String> = {
|
||||
let m = "http://localhost:443".to_string();
|
||||
Mutex::new(m)
|
||||
};
|
||||
}
|
||||
static SERVER: Lazy<Mutex<String>> = Lazy::new(|| Mutex::new("http://localhost:443".to_string()));
|
||||
|
||||
#[derive(Clone)]
|
||||
struct ProxyHandler;
|
||||
@@ -45,16 +43,18 @@ pub fn set_proxy_addr(addr: String) {
|
||||
|
||||
#[async_trait]
|
||||
impl HttpHandler for ProxyHandler {
|
||||
async fn handle_request(&mut self,
|
||||
_context: &HttpContext,
|
||||
mut request: Request<Body>,
|
||||
async fn handle_request(
|
||||
&mut self,
|
||||
_context: &HttpContext,
|
||||
mut request: Request<Body>,
|
||||
) -> RequestOrResponse {
|
||||
let uri = request.uri().to_string();
|
||||
let uri_path = request.uri().path();
|
||||
|
||||
|
||||
if uri.contains("hoyoverse.com") || uri.contains("mihoyo.com") || uri.contains("yuanshen.com") {
|
||||
// Create new URI.
|
||||
let new_uri = Uri::from_str(format!("{}{}", SERVER.lock().unwrap(), uri_path).as_str()).unwrap();
|
||||
let new_uri =
|
||||
Uri::from_str(format!("{}{}", SERVER.lock().unwrap(), uri_path).as_str()).unwrap();
|
||||
// Set request URI to the new one.
|
||||
*request.uri_mut() = new_uri;
|
||||
}
|
||||
@@ -62,10 +62,13 @@ impl HttpHandler for ProxyHandler {
|
||||
RequestOrResponse::Request(request)
|
||||
}
|
||||
|
||||
async fn handle_response(&mut self,
|
||||
_context: &HttpContext,
|
||||
response: Response<Body>,
|
||||
) -> Response<Body> { response }
|
||||
async fn handle_response(
|
||||
&mut self,
|
||||
_context: &HttpContext,
|
||||
response: Response<Body>,
|
||||
) -> Response<Body> {
|
||||
response
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -73,20 +76,22 @@ impl HttpHandler for ProxyHandler {
|
||||
*/
|
||||
pub async fn create_proxy(proxy_port: u16, certificate_path: String) {
|
||||
// Get the certificate and private key.
|
||||
let mut private_key_bytes: &[u8] = &fs::read(format!("{}\\private.key", certificate_path)).expect("Could not read private key");
|
||||
let mut ca_cert_bytes: &[u8] = &fs::read(format!("{}\\cert.crt", certificate_path)).expect("Could not read certificate");
|
||||
let mut private_key_bytes: &[u8] =
|
||||
&fs::read(format!("{}\\private.key", certificate_path)).expect("Could not read private key");
|
||||
let mut ca_cert_bytes: &[u8] =
|
||||
&fs::read(format!("{}\\cert.crt", certificate_path)).expect("Could not read certificate");
|
||||
|
||||
// Parse the private key and certificate.
|
||||
let private_key = rustls::PrivateKey(
|
||||
pemfile::pkcs8_private_keys(&mut private_key_bytes)
|
||||
.expect("Failed to parse private key")
|
||||
.remove(0)
|
||||
.remove(0),
|
||||
);
|
||||
|
||||
let ca_cert = rustls::Certificate(
|
||||
pemfile::certs(&mut ca_cert_bytes)
|
||||
.expect("Failed to parse CA certificate")
|
||||
.remove(0)
|
||||
.remove(0),
|
||||
);
|
||||
|
||||
// Create the certificate authority.
|
||||
@@ -108,44 +113,65 @@ pub async fn create_proxy(proxy_port: u16, certificate_path: String) {
|
||||
/**
|
||||
* Connects to the local HTTP(S) proxy server.
|
||||
*/
|
||||
#[cfg(windows)]
|
||||
pub fn connect_to_proxy(proxy_port: u16) {
|
||||
if cfg!(target_os = "windows") {
|
||||
// Create 'ProxyServer' string.
|
||||
let server_string: String = format!("http=127.0.0.1:{};https=127.0.0.1:{}", proxy_port, proxy_port);
|
||||
// Create 'ProxyServer' string.
|
||||
let server_string: String = format!(
|
||||
"http=127.0.0.1:{};https=127.0.0.1:{}",
|
||||
proxy_port, proxy_port
|
||||
);
|
||||
|
||||
// Fetch the 'Internet Settings' registry key.
|
||||
let settings = Hive::CurrentUser.open(r"Software\Microsoft\Windows\CurrentVersion\Internet Settings", Security::Write).unwrap();
|
||||
// Fetch the 'Internet Settings' registry key.
|
||||
let settings = Hive::CurrentUser
|
||||
.open(
|
||||
r"Software\Microsoft\Windows\CurrentVersion\Internet Settings",
|
||||
Security::Write,
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
// Set registry values.
|
||||
settings.set_value("ProxyServer", &Data::String(server_string.parse().unwrap())).unwrap();
|
||||
settings.set_value("ProxyEnable", &Data::U32(1)).unwrap();
|
||||
}
|
||||
// Set registry values.
|
||||
settings
|
||||
.set_value("ProxyServer", &Data::String(server_string.parse().unwrap()))
|
||||
.unwrap();
|
||||
settings.set_value("ProxyEnable", &Data::U32(1)).unwrap();
|
||||
|
||||
println!("Connected to the proxy.");
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
pub fn connect_to_proxy(_proxy_port: u16) {
|
||||
println!("Connecting to the proxy is not implemented on this platform.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Disconnects from the local HTTP(S) proxy server.
|
||||
*/
|
||||
#[cfg(windows)]
|
||||
pub fn disconnect_from_proxy() {
|
||||
if cfg!(target_os = "windows") {
|
||||
// Fetch the 'Internet Settings' registry key.
|
||||
let settings = Hive::CurrentUser.open(r"Software\Microsoft\Windows\CurrentVersion\Internet Settings", Security::Write).unwrap();
|
||||
// Fetch the 'Internet Settings' registry key.
|
||||
let settings = Hive::CurrentUser
|
||||
.open(
|
||||
r"Software\Microsoft\Windows\CurrentVersion\Internet Settings",
|
||||
Security::Write,
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
// Set registry values.
|
||||
settings.set_value("ProxyEnable", &Data::U32(0)).unwrap();
|
||||
}
|
||||
// Set registry values.
|
||||
settings.set_value("ProxyEnable", &Data::U32(0)).unwrap();
|
||||
|
||||
println!("Disconnected from proxy.");
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
pub fn disconnect_from_proxy() {}
|
||||
|
||||
/*
|
||||
* Generates a private key and certificate used by the certificate authority.
|
||||
* Additionally installs the certificate and private key in the Root CA store.
|
||||
* Source: https://github.com/zu1k/good-mitm/raw/master/src/ca/gen.rs
|
||||
*/
|
||||
#[tauri::command]
|
||||
pub fn generate_ca_files(path: &str) {
|
||||
pub fn generate_ca_files(path: &Path) {
|
||||
let mut params = CertificateParams::default();
|
||||
let mut details = DistinguishedName::new();
|
||||
|
||||
@@ -154,7 +180,7 @@ pub fn generate_ca_files(path: &str) {
|
||||
details.push(DnType::OrganizationName, "Grasscutters");
|
||||
details.push(DnType::CountryName, "CN");
|
||||
details.push(DnType::LocalityName, "CN");
|
||||
|
||||
|
||||
// Set details in the parameter.
|
||||
params.distinguished_name = details;
|
||||
// Set other properties.
|
||||
@@ -162,49 +188,82 @@ pub fn generate_ca_files(path: &str) {
|
||||
params.key_usages = vec![
|
||||
KeyUsagePurpose::DigitalSignature,
|
||||
KeyUsagePurpose::KeyCertSign,
|
||||
KeyUsagePurpose::CrlSign
|
||||
KeyUsagePurpose::CrlSign,
|
||||
];
|
||||
|
||||
|
||||
// Create certificate.
|
||||
let cert_path = format!("{}\\ca", path);
|
||||
|
||||
let cert = Certificate::from_params(params).unwrap();
|
||||
let cert_crt = cert.serialize_pem().unwrap();
|
||||
let private_key = cert.serialize_private_key_pem();
|
||||
|
||||
// Make certificate directory.
|
||||
match fs::create_dir(&cert_path) {
|
||||
Ok(_) => {},
|
||||
let cert_dir = path.join("ca");
|
||||
match fs::create_dir(&cert_dir) {
|
||||
Ok(_) => {}
|
||||
Err(e) => {
|
||||
println!("{}", e);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Write the certificate to a file.
|
||||
match fs::write(format!("{}\\cert.crt", &cert_path), cert_crt) {
|
||||
Ok(_) => println!("Wrote certificate to {}", &cert_path),
|
||||
Err(e) => println!("Error writing certificate to {}: {}", &cert_path, e),
|
||||
let cert_path = cert_dir.join("cert.crt");
|
||||
match fs::write(&cert_path, cert_crt) {
|
||||
Ok(_) => println!("Wrote certificate to {}", cert_path.to_str().unwrap()),
|
||||
Err(e) => println!(
|
||||
"Error writing certificate to {}: {}",
|
||||
cert_path.to_str().unwrap(),
|
||||
e
|
||||
),
|
||||
}
|
||||
|
||||
// Write the private key to a file.
|
||||
match fs::write(format!("{}\\private.key", &cert_path), private_key) {
|
||||
Ok(_) => println!("Wrote private key to {}", &cert_path),
|
||||
Err(e) => println!("Error writing private key to {}: {}", &cert_path, e),
|
||||
let private_key_path = cert_dir.join("private.key");
|
||||
match fs::write(&private_key_path, private_key) {
|
||||
Ok(_) => println!(
|
||||
"Wrote private key to {}",
|
||||
private_key_path.to_str().unwrap()
|
||||
),
|
||||
Err(e) => println!(
|
||||
"Error writing private key to {}: {}",
|
||||
private_key_path.to_str().unwrap(),
|
||||
e
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
// Install certificate into the system's Root CA store.
|
||||
install_ca_files(path);
|
||||
install_ca_files(&cert_path);
|
||||
}
|
||||
|
||||
/*
|
||||
* Attempts to install the certificate authority's certificate into the Root CA store.
|
||||
*/
|
||||
pub fn install_ca_files(path: &str) {
|
||||
if cfg!(target_os = "windows") {
|
||||
run_command(format!("certutil -user -addstore \"Root\" {}\\ca\\cert.crt", path).to_string());
|
||||
} else {
|
||||
run_command(format!("security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain {}/ca/cert.crt", path).to_string());
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
pub fn install_ca_files(cert_path: &Path) {
|
||||
crate::system_helpers::run_command(
|
||||
"certutil",
|
||||
vec!["-user", "-addstore", "Root", cert_path.to_str().unwrap()],
|
||||
);
|
||||
println!("Installed certificate.");
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
pub fn install_ca_files(cert_path: &Path) {
|
||||
crate::system_helpers::run_command(
|
||||
"security",
|
||||
vec![
|
||||
"add-trusted-cert",
|
||||
"-d",
|
||||
"-r",
|
||||
"trustRoot",
|
||||
"-k",
|
||||
"/Library/Keychains/System.keychain",
|
||||
cert_path.to_str().unwrap(),
|
||||
],
|
||||
);
|
||||
println!("Installed certificate.");
|
||||
}
|
||||
|
||||
#[cfg(not(any(windows, target_os = "macos")))]
|
||||
pub fn install_ca_files(_cert_path: &Path) {
|
||||
println!("Certificate installation is not supported on this platform.");
|
||||
}
|
||||
|
||||
@@ -5,4 +5,4 @@ use serde::Deserialize;
|
||||
#[derive(Deserialize)]
|
||||
pub(crate) struct APIQuery {
|
||||
pub bg_file: String,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,36 +1,17 @@
|
||||
|
||||
use std::thread;
|
||||
use std::process::Command;
|
||||
use tauri;
|
||||
use open;
|
||||
|
||||
use crate::file_helpers;
|
||||
use duct::cmd;
|
||||
|
||||
#[tauri::command]
|
||||
pub fn run_program(path: String) {
|
||||
// Open the program from the specified path.
|
||||
|
||||
// Open in new thread to prevent blocking.
|
||||
thread::spawn(move || {
|
||||
open::that(&path).unwrap();
|
||||
std::thread::spawn(move || {
|
||||
// Without unwrap_or, this can crash when UAC prompt is denied
|
||||
open::that(&path).unwrap_or(());
|
||||
});
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn run_command(command: String) {
|
||||
// Run the specified command.
|
||||
if cfg!(target_os = "windows") {
|
||||
Command::new("cmd")
|
||||
.args(["/C", command.as_str()])
|
||||
.output()
|
||||
.expect("failed to execute process")
|
||||
} else {
|
||||
Command::new("sh")
|
||||
.arg("-c")
|
||||
.arg(command.as_str())
|
||||
.output()
|
||||
.expect("failed to execute process")
|
||||
};
|
||||
pub fn run_command(program: &str, args: Vec<&str>) {
|
||||
cmd(program, args).run().expect("Failed to run command");
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
@@ -42,7 +23,10 @@ pub fn run_jar(path: String, execute_in: String, java_path: String) {
|
||||
};
|
||||
|
||||
// Open the program from the specified path.
|
||||
match open::with(format!("/k cd /D \"{}\" & {}", &execute_in, &command).to_string(), "C:\\Windows\\System32\\cmd.exe") {
|
||||
match open::with(
|
||||
format!("/k cd /D \"{}\" & {}", &execute_in, &command),
|
||||
"C:\\Windows\\System32\\cmd.exe",
|
||||
) {
|
||||
Ok(_) => (),
|
||||
Err(e) => println!("Failed to open jar ({} from {}): {}", &path, &execute_in, e),
|
||||
};
|
||||
@@ -57,26 +41,6 @@ pub fn open_in_browser(url: String) {
|
||||
};
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn copy_file(path: String, new_path: String) -> bool {
|
||||
let filename = &path.split("/").last().unwrap();
|
||||
let mut new_path_buf = std::path::PathBuf::from(&new_path);
|
||||
|
||||
// If the new path doesn't exist, create it.
|
||||
if !file_helpers::dir_exists(new_path_buf.pop().to_string().as_str()) {
|
||||
std::fs::create_dir_all(&new_path).unwrap();
|
||||
}
|
||||
|
||||
// Copy old to new
|
||||
match std::fs::copy(&path, format!("{}/{}", new_path, filename)) {
|
||||
Ok(_) => true,
|
||||
Err(e) => {
|
||||
println!("Failed to copy file: {}", e);
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn install_location() -> String {
|
||||
let mut exe_path = std::env::current_exe().unwrap();
|
||||
@@ -87,7 +51,14 @@ pub fn install_location() -> String {
|
||||
return exe_path.to_str().unwrap().to_string();
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
#[tauri::command]
|
||||
pub fn is_elevated() -> bool {
|
||||
return is_elevated::is_elevated();
|
||||
}
|
||||
is_elevated::is_elevated()
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
#[tauri::command]
|
||||
pub fn is_elevated() -> bool {
|
||||
sudo::check() == sudo::RunningAs::Root
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
use zip_extract;
|
||||
use zip;
|
||||
use std::fs::File;
|
||||
use std::path;
|
||||
use std::thread;
|
||||
@@ -25,21 +23,18 @@ pub fn unzip(window: tauri::Window, zipfile: String, destpath: String) {
|
||||
|
||||
match zip_extract::extract(&f, &full_path, true) {
|
||||
Ok(_) => {
|
||||
println!("Extracted zip file to: {}", full_path.to_str().unwrap_or("Error"));
|
||||
println!(
|
||||
"Extracted zip file to: {}",
|
||||
full_path.to_str().unwrap_or("Error")
|
||||
);
|
||||
}
|
||||
Err(e) => {
|
||||
println!("Failed to extract zip file: {}", e);
|
||||
let mut res_hash = std::collections::HashMap::new();
|
||||
|
||||
res_hash.insert(
|
||||
"error".to_string(),
|
||||
e.to_string(),
|
||||
);
|
||||
res_hash.insert("error".to_string(), e.to_string());
|
||||
|
||||
res_hash.insert(
|
||||
"path".to_string(),
|
||||
zipfile.to_string(),
|
||||
);
|
||||
res_hash.insert("path".to_string(), zipfile.to_string());
|
||||
|
||||
window.emit("download_error", &res_hash).unwrap();
|
||||
}
|
||||
@@ -52,7 +47,9 @@ pub fn unzip(window: tauri::Window, zipfile: String, destpath: String) {
|
||||
|
||||
// If the contents is a jar file, emit that we have extracted a new jar file
|
||||
if name.ends_with(".jar") {
|
||||
window.emit("jar_extracted", destpath.to_string() + name).unwrap();
|
||||
window
|
||||
.emit("jar_extracted", destpath.to_string() + name)
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
// Delete zip file
|
||||
@@ -67,4 +64,4 @@ pub fn unzip(window: tauri::Window, zipfile: String, destpath: String) {
|
||||
|
||||
window.emit("extract_end", &zipfile).unwrap();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,13 @@ use reqwest::header::USER_AGENT;
|
||||
pub(crate) async fn query(site: &str) -> String {
|
||||
let client = reqwest::Client::new();
|
||||
|
||||
let response = client.get(site).header(USER_AGENT, "cultivation").send().await.unwrap();
|
||||
return response.text().await.unwrap();
|
||||
let response = client
|
||||
.get(site)
|
||||
.header(USER_AGENT, "cultivation")
|
||||
.send()
|
||||
.await
|
||||
.unwrap();
|
||||
response.text().await.unwrap()
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
@@ -12,7 +17,18 @@ pub(crate) async fn valid_url(url: String) -> bool {
|
||||
// Check if we get a 200 response
|
||||
let client = reqwest::Client::new();
|
||||
|
||||
let response = client.get(url).header(USER_AGENT, "cultivation").send().await.unwrap();
|
||||
let response = client
|
||||
.get(url)
|
||||
.header(USER_AGENT, "cultivation")
|
||||
.send()
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
return response.status().as_str() == "200";
|
||||
}
|
||||
response.status().as_str() == "200"
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn web_get(url: String) -> String {
|
||||
// Send a GET request to the specified URL and send the response body back to the client.
|
||||
query(&url).await
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
},
|
||||
"package": {
|
||||
"productName": "Cultivation",
|
||||
"version": "1.0.0"
|
||||
"version": "1.0.2"
|
||||
},
|
||||
"tauri": {
|
||||
"allowlist": {
|
||||
@@ -55,7 +55,9 @@
|
||||
"signingIdentity": null
|
||||
},
|
||||
"resources": [
|
||||
"lang/*.json"
|
||||
"lang/*.json",
|
||||
"keys/*",
|
||||
"./mhycrypto.dll"
|
||||
],
|
||||
"targets": "all",
|
||||
"windows": {
|
||||
@@ -72,10 +74,11 @@
|
||||
"csp": "default-src 'self' https://asset.localhost; img-src 'self'; img-src https://* asset: https://asset.localhost"
|
||||
},
|
||||
"updater": {
|
||||
"active": true,
|
||||
"active": false,
|
||||
"dialog": true,
|
||||
"endpoints": [
|
||||
"https://api.grasscutters.xyz/cultivation/update?version={{current_version}}"
|
||||
"https://api.grasscutter.io/cultivation/updater?version={{current_version}}",
|
||||
"https://api.grasscutters.xyz/cultivation/updater?version={{current_version}}"
|
||||
],
|
||||
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEIyM0MzMzk0NkM4OTQzNQpSV1ExbE1oR09jTWpDNFJ4NURsaS9mdHpDWmpBM3JNVHkrdER4bS9KdHFCQnNVSWs0ZjZTU295WAo="
|
||||
},
|
||||
|
||||
@@ -3,20 +3,27 @@ import ReactDOM from 'react-dom/client'
|
||||
|
||||
import './index.css'
|
||||
import App from './ui/App'
|
||||
// import Debug from './ui/Debug'
|
||||
import Debug from './ui/Debug'
|
||||
|
||||
import { getConfigOption } from './utils/configuration'
|
||||
|
||||
const root = ReactDOM.createRoot(
|
||||
document.getElementById('root') as HTMLElement
|
||||
)
|
||||
|
||||
let isDebug = false;
|
||||
|
||||
(async() => {
|
||||
isDebug = await getConfigOption('debug_enabled')
|
||||
})
|
||||
|
||||
root.render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
{
|
||||
isDebug ? <Debug /> : <App />
|
||||
}
|
||||
</React.StrictMode>
|
||||
)
|
||||
|
||||
// If you want to start measuring performance in your app, pass a function
|
||||
// to log results (for example: reportWebVitals(console.log))
|
||||
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
|
||||
import reportWebVitals from './utils/reportWebVitals'
|
||||
reportWebVitals(console.log)
|
||||
isDebug && reportWebVitals(console.log)
|
||||
67
src/resources/icons/akebi.svg
Normal file
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
|
||||
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
|
||||
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
|
||||
width="1024.000000pt" height="1024.000000pt" viewBox="0 0 1024.000000 1024.000000"
|
||||
preserveAspectRatio="xMidYMid meet">
|
||||
|
||||
<g transform="translate(0.000000,1024.000000) scale(0.100000,-0.100000)"
|
||||
fill="#000000" stroke="none">
|
||||
<path d="M7045 10204 c-301 -50 -596 -277 -731 -564 -96 -204 -111 -463 -40
|
||||
-692 16 -52 14 -58 -26 -58 -62 0 -220 -85 -331 -178 -24 -20 -105 -91 -178
|
||||
-157 -74 -66 -177 -156 -229 -200 -208 -175 -629 -573 -1001 -944 -152 -152
|
||||
-286 -284 -297 -294 -18 -17 -27 -17 -75 -8 -96 21 -249 29 -361 20 -321 -26
|
||||
-613 -162 -836 -389 -341 -346 -457 -846 -303 -1301 l36 -106 -66 -100 c-102
|
||||
-155 -212 -343 -303 -518 -353 -683 -556 -1455 -531 -2025 6 -136 29 -341 47
|
||||
-415 36 -156 58 -234 92 -335 47 -137 52 -147 134 -315 90 -182 113 -220 223
|
||||
-375 376 -528 945 -931 1571 -1113 261 -76 439 -94 503 -52 27 17 30 17 105
|
||||
-4 125 -35 209 -50 345 -62 107 -9 152 -8 279 6 118 13 180 15 277 8 214 -14
|
||||
475 -9 566 11 144 31 312 80 395 114 14 6 68 27 120 48 91 36 302 135 365 172
|
||||
180 104 373 265 507 422 346 407 518 977 520 1725 0 287 -10 448 -48 755 -43
|
||||
357 -95 631 -208 1100 -24 102 -47 199 -51 217 -5 26 -1 41 25 78 48 70 108
|
||||
204 132 297 32 118 31 366 0 482 -75 272 -258 503 -507 639 l-77 42 -68 202
|
||||
c-37 112 -70 213 -73 225 -3 13 -14 57 -26 98 -12 41 -33 134 -47 205 -23 115
|
||||
-26 154 -27 345 0 223 1 232 62 580 44 245 54 349 47 490 -10 234 -52 334
|
||||
-206 495 -98 103 -128 150 -167 261 -24 70 -27 94 -28 209 0 135 10 185 58
|
||||
280 49 99 182 235 282 288 179 96 373 112 464 39 62 -49 101 -117 101 -174 0
|
||||
-81 -49 -152 -117 -172 -13 -3 -32 -8 -42 -11 -13 -4 -34 7 -65 34 -26 22 -63
|
||||
45 -84 52 -107 32 -219 -73 -198 -185 7 -37 89 -141 129 -163 137 -76 279 -77
|
||||
428 -3 102 52 190 149 236 263 36 89 42 239 14 326 -36 108 -112 215 -206 286
|
||||
-80 62 -158 92 -265 105 -105 11 -142 11 -245 -6z m-574 -1640 c138 -41 189
|
||||
-186 160 -459 -13 -115 -45 -328 -62 -405 -19 -86 -49 -386 -49 -493 0 -163
|
||||
17 -299 71 -552 7 -36 35 -132 102 -350 l24 -80 -31 -2 c-114 -9 -233 -28
|
||||
-305 -50 -193 -55 -383 -185 -509 -347 -12 -16 -24 -27 -27 -24 -6 5 -22 125
|
||||
-30 223 -3 39 -10 113 -15 165 -10 105 -26 365 -35 595 -5 120 -11 158 -26
|
||||
192 -34 70 -110 104 -187 84 -44 -12 -77 -47 -217 -230 -38 -51 -90 -118 -115
|
||||
-150 -25 -32 -70 -91 -100 -131 -30 -40 -64 -84 -76 -98 l-21 -25 -37 67 c-89
|
||||
159 -229 312 -386 419 l-81 55 213 214 c371 372 775 751 1063 997 94 79 193
|
||||
166 220 192 78 75 185 157 239 184 60 30 136 33 217 9z m-2317 -1783 c351 -93
|
||||
611 -365 682 -712 22 -109 15 -291 -16 -403 -107 -396 -472 -688 -900 -722
|
||||
l-85 -6 70 50 c180 127 282 307 293 513 16 326 -203 611 -533 695 -90 22 -256
|
||||
23 -347 1 -136 -33 -284 -119 -366 -212 -22 -25 -42 -45 -44 -45 -9 0 11 102
|
||||
33 175 104 343 411 610 782 681 104 20 329 12 431 -15z m1310 -406 c21 -268
|
||||
29 -351 51 -545 31 -262 72 -520 120 -765 26 -130 66 -320 75 -360 5 -22 28
|
||||
-128 50 -235 23 -107 45 -213 50 -235 41 -178 113 -614 145 -880 48 -401 57
|
||||
-943 20 -1215 -55 -407 -186 -801 -368 -1102 -107 -178 -168 -262 -258 -355
|
||||
-146 -150 -290 -212 -494 -213 -252 0 -520 107 -800 319 -274 207 -539 609
|
||||
-674 1021 -112 339 -154 603 -154 960 0 278 18 425 82 671 92 348 301 725 615
|
||||
1106 l50 61 87 16 c472 86 871 430 1017 876 42 128 55 211 58 383 l4 168 120
|
||||
157 c169 220 194 252 196 249 1 -1 5 -38 8 -82z m1043 -511 c-144 -112 -216
|
||||
-335 -168 -519 27 -101 69 -171 148 -245 74 -69 141 -104 246 -127 67 -14 90
|
||||
-15 159 -5 145 21 277 102 353 218 60 90 86 178 86 287 0 51 -3 102 -6 112
|
||||
-13 40 26 -17 61 -89 95 -196 84 -447 -28 -633 -183 -303 -569 -423 -917 -284
|
||||
-171 69 -330 226 -398 394 -152 373 46 791 432 913 73 23 82 17 32 -22z
|
||||
m-3393 -1044 c104 -70 239 -133 356 -166 52 -15 97 -28 98 -30 4 -2 -15 -29
|
||||
-83 -124 -60 -83 -171 -254 -217 -335 -185 -323 -305 -691 -349 -1070 -19
|
||||
-158 -16 -519 5 -690 34 -284 98 -554 186 -790 44 -120 179 -400 231 -480 171
|
||||
-266 299 -420 509 -610 50 -45 61 -59 47 -63 -47 -10 -352 117 -535 224 -700
|
||||
409 -1152 1060 -1253 1804 -19 136 -16 466 5 625 78 591 314 1222 678 1813
|
||||
l70 113 87 -84 c48 -46 122 -107 165 -137z m3105 -469 c175 -88 288 -116 481
|
||||
-116 190 0 316 30 470 111 30 16 58 30 61 32 15 7 131 -523 183 -833 64 -382
|
||||
88 -661 88 -1015 -1 -346 -24 -553 -94 -820 -112 -430 -342 -768 -675 -993
|
||||
-139 -94 -386 -208 -643 -297 -67 -24 -174 -50 -255 -64 -94 -17 -350 -22
|
||||
-359 -8 -2 4 16 26 40 47 42 37 171 184 204 231 176 256 269 425 360 654 118
|
||||
295 181 554 221 907 19 168 21 222 16 503 -4 173 -11 369 -16 434 -30 341
|
||||
-103 828 -177 1168 -15 73 -18 108 -7 108 4 0 50 -22 102 -49z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.5 KiB |
@@ -22,6 +22,7 @@ import { dataDir } from '@tauri-apps/api/path'
|
||||
import { appWindow } from '@tauri-apps/api/window'
|
||||
import { convertFileSrc } from '@tauri-apps/api/tauri'
|
||||
import { getTheme, loadTheme } from '../utils/themes'
|
||||
import { unpatchGame } from '../utils/metadata'
|
||||
|
||||
interface IProps {
|
||||
[key: string]: never;
|
||||
@@ -36,7 +37,7 @@ interface IState {
|
||||
bgFile: string;
|
||||
}
|
||||
|
||||
const DEFAULT_BG = 'https://api.grasscutters.xyz/content/bgfile'
|
||||
const DEFAULT_BG = 'https://api.grasscutter.io/cultivation/bgfile'
|
||||
|
||||
const downloadHandler = new DownloadHandler()
|
||||
|
||||
@@ -56,10 +57,21 @@ class App extends React.Component<IProps, IState> {
|
||||
console.log(payload)
|
||||
})
|
||||
|
||||
listen('jar_extracted', ({ payload }) => {
|
||||
listen('jar_extracted', ({ payload }: { payload: string}) => {
|
||||
setConfigOption('grasscutter_path', payload)
|
||||
})
|
||||
|
||||
// Emitted for metadata replacing-purposes
|
||||
listen('game_closed', async () => {
|
||||
const unpatched = await unpatchGame()
|
||||
|
||||
console.log(`unpatched game? ${unpatched}`)
|
||||
|
||||
if (!unpatched) {
|
||||
alert(`Could not unpatch game! (You should be able to find your metadata backup in ${await dataDir()}\\cultivation\\)`)
|
||||
}
|
||||
})
|
||||
|
||||
let min = false
|
||||
|
||||
// periodically check if we need to min/max based on whether the game is open
|
||||
@@ -79,7 +91,6 @@ class App extends React.Component<IProps, IState> {
|
||||
async componentDidMount() {
|
||||
const cert_generated = await getConfigOption('cert_generated')
|
||||
const game_exe = await getConfigOption('game_install_path')
|
||||
const custom_bg = await getConfigOption('customBackground')
|
||||
const game_path = game_exe?.substring(0, game_exe.replace(/\\/g, '/').lastIndexOf('/')) || ''
|
||||
const root_path = game_path?.substring(0, game_path.replace(/\\/g, '/').lastIndexOf('/')) || ''
|
||||
|
||||
@@ -90,6 +101,9 @@ class App extends React.Component<IProps, IState> {
|
||||
await loadTheme(themeObj, document)
|
||||
}
|
||||
|
||||
// Get custom bg AFTER theme is loaded !! important !!
|
||||
const custom_bg = await getConfigOption('customBackground')
|
||||
|
||||
if(!custom_bg || !/png|jpg|jpeg$/.test(custom_bg)) {
|
||||
if(game_path) {
|
||||
// Get the bg by invoking, then set the background to that bg.
|
||||
@@ -164,7 +178,7 @@ class App extends React.Component<IProps, IState> {
|
||||
{
|
||||
// Mini downloads section
|
||||
this.state.miniDownloadsOpen ? (
|
||||
<div className="MiniDownloads">
|
||||
<div className="MiniDownloads" id="miniDownloadContainer">
|
||||
<MiniDialog
|
||||
title="Downloads"
|
||||
closeFn={() => {
|
||||
@@ -192,6 +206,7 @@ class App extends React.Component<IProps, IState> {
|
||||
// Options menu
|
||||
this.state.optionsOpen ? (
|
||||
<Options
|
||||
downloadManager={downloadHandler}
|
||||
closeFn={() => this.setState({ optionsOpen: !this.state.optionsOpen })}
|
||||
/>
|
||||
) : null
|
||||
@@ -207,7 +222,7 @@ class App extends React.Component<IProps, IState> {
|
||||
) : null
|
||||
}
|
||||
|
||||
<div className="BottomSection">
|
||||
<div className="BottomSection" id="bottomSectionContainer">
|
||||
<ServerLaunchSection />
|
||||
|
||||
<div id="DownloadProgress"
|
||||
|
||||
@@ -40,7 +40,7 @@ function none() {
|
||||
alert('none')
|
||||
}
|
||||
|
||||
class Debug extends React.Component<any, any>{
|
||||
class Debug extends React.Component{
|
||||
render() {
|
||||
return (
|
||||
<div className="App">
|
||||
|
||||
@@ -32,16 +32,16 @@ export default class MiniDialog extends React.Component<IProps, never> {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="MiniDialog">
|
||||
<div className="MiniDialog" id="miniDialogContainer">
|
||||
{
|
||||
this.props.closeable !== undefined && this.props.closeable ?
|
||||
<div className="MiniDialogTop" onClick={this.props.closeFn}>
|
||||
<div className="MiniDialogTop" id="miniDialogContainerTop" onClick={this.props.closeFn}>
|
||||
<span>{this.props?.title}</span>
|
||||
<img src={Close} className="MiniDialogClose" />
|
||||
<img src={Close} className="MiniDialogClose" id="miniDialogButtonClose" />
|
||||
</div> : null
|
||||
}
|
||||
|
||||
<div className="MiniDialogInner">
|
||||
<div className="MiniDialogInner" id="miniDialogContent">
|
||||
{this.props.children}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -16,12 +16,12 @@ export default class RightBar extends React.Component {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="RightBar">
|
||||
<div className="RightBarInner">
|
||||
<div className="BarDiscord BarImg" onClick={() => this.openInBrowser(DISCORD)}>
|
||||
<div className="RightBar" id="rightBarContainer">
|
||||
<div className="RightBarInner" id="rightBarContent">
|
||||
<div className="BarDiscord BarImg" id="rightBarButtonDiscord" onClick={() => this.openInBrowser(DISCORD)}>
|
||||
<img src={Discord} />
|
||||
</div>
|
||||
<div className="BarGithub BarImg" onClick={() => this.openInBrowser(GITHUB)}>
|
||||
<div className="BarGithub BarImg" id="rightBarButtonGithub" onClick={() => this.openInBrowser(GITHUB)}>
|
||||
<img src={Github} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -62,20 +62,27 @@
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
align-items: flex-start;
|
||||
|
||||
height: 100%;
|
||||
max-height: 60px;
|
||||
}
|
||||
|
||||
#officialPlay {
|
||||
width: 60%
|
||||
.ServerLaunchButtons .BigButton {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
#officialPlay {
|
||||
max-width: 60%;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
#akebiLaunch,
|
||||
#serverLaunch {
|
||||
width: 5%;
|
||||
}
|
||||
|
||||
.AkebiIcon,
|
||||
.ServerIcon {
|
||||
height: 20px;
|
||||
filter: invert(28%) sepia(28%) saturate(1141%) hue-rotate(352deg) brightness(96%) contrast(88%);
|
||||
|
||||
@@ -8,12 +8,12 @@ import { translate } from '../../utils/language'
|
||||
import { invoke } from '@tauri-apps/api/tauri'
|
||||
|
||||
import Server from '../../resources/icons/server.svg'
|
||||
import Akebi from '../../resources/icons/akebi.svg'
|
||||
|
||||
import './ServerLaunchSection.css'
|
||||
import {dataDir} from '@tauri-apps/api/path'
|
||||
|
||||
interface IProps {
|
||||
[key: string]: any
|
||||
}
|
||||
import { getGameExecutable } from '../../utils/game'
|
||||
import { patchGame, unpatchGame } from '../../utils/metadata'
|
||||
|
||||
interface IState {
|
||||
grasscutterEnabled: boolean;
|
||||
@@ -29,10 +29,12 @@ interface IState {
|
||||
|
||||
httpsLabel: string;
|
||||
httpsEnabled: boolean;
|
||||
|
||||
swag: boolean;
|
||||
}
|
||||
|
||||
export default class ServerLaunchSection extends React.Component<IProps, IState> {
|
||||
constructor(props: IProps) {
|
||||
export default class ServerLaunchSection extends React.Component<{}, IState> {
|
||||
constructor(props: {}) {
|
||||
super(props)
|
||||
|
||||
this.state = {
|
||||
@@ -45,11 +47,13 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
|
||||
portPlaceholder: '',
|
||||
portHelpText: '',
|
||||
httpsLabel: '',
|
||||
httpsEnabled: false
|
||||
httpsEnabled: false,
|
||||
swag: false
|
||||
}
|
||||
|
||||
this.toggleGrasscutter = this.toggleGrasscutter.bind(this)
|
||||
this.playGame = this.playGame.bind(this)
|
||||
this.launchAkebi = this.launchAkebi.bind(this)
|
||||
this.setIp = this.setIp.bind(this)
|
||||
this.setPort = this.setPort.bind(this)
|
||||
this.toggleHttps = this.toggleHttps.bind(this)
|
||||
@@ -69,6 +73,7 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
|
||||
portHelpText: await translate('help.port_help_text'),
|
||||
httpsLabel: await translate('main.https_enable'),
|
||||
httpsEnabled: config.https_enabled || false,
|
||||
swag: config.swag_mode || false
|
||||
})
|
||||
}
|
||||
|
||||
@@ -85,21 +90,25 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
|
||||
await saveConfig(config)
|
||||
}
|
||||
|
||||
async playGame() {
|
||||
async playGame(exe?: string, proc_name?: string) {
|
||||
const config = await getConfig()
|
||||
|
||||
if (!config.game_install_path) return alert('Game path not set!')
|
||||
|
||||
if(!await getGameExecutable()) {
|
||||
alert('Game executable not set!')
|
||||
return
|
||||
}
|
||||
|
||||
// Connect to proxy
|
||||
if (config.toggle_grasscutter) {
|
||||
let game_exe = config.game_install_path
|
||||
const patched = await patchGame()
|
||||
|
||||
if (game_exe.includes('\\')) {
|
||||
game_exe = game_exe.substring(config.game_install_path.lastIndexOf('\\') + 1)
|
||||
} else {
|
||||
game_exe = game_exe.substring(config.game_install_path.lastIndexOf('/') + 1)
|
||||
if (!patched) {
|
||||
alert('Could not patch game!')
|
||||
return
|
||||
}
|
||||
|
||||
const game_exe = await getGameExecutable()
|
||||
|
||||
// Save last connected server and port
|
||||
await setConfigOption('last_ip', this.state.ip)
|
||||
await setConfigOption('last_port', this.state.port)
|
||||
@@ -107,7 +116,7 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
|
||||
// Set IP
|
||||
await invoke('set_proxy_addr', { addr: (this.state.httpsEnabled ? 'https':'http') + '://' + this.state.ip + ':' + this.state.port })
|
||||
await invoke('enable_process_watcher', {
|
||||
process: game_exe
|
||||
process: proc_name || game_exe
|
||||
})
|
||||
|
||||
// Connect to proxy
|
||||
@@ -115,13 +124,10 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
|
||||
|
||||
// Open server as well if the options are set
|
||||
if (config.grasscutter_with_game) {
|
||||
let jarFolder = config.grasscutter_path
|
||||
const jarFolderArr = config.grasscutter_path.replace(/\\/g, '/').split('/')
|
||||
jarFolderArr.pop()
|
||||
|
||||
if (jarFolder.includes('/')) {
|
||||
jarFolder = jarFolder.substring(0, config.grasscutter_path.lastIndexOf('/'))
|
||||
} else {
|
||||
jarFolder = jarFolder.substring(0, config.grasscutter_path.lastIndexOf('\\'))
|
||||
}
|
||||
const jarFolder = jarFolderArr.join('/')
|
||||
|
||||
await invoke('run_jar', {
|
||||
path: config.grasscutter_path,
|
||||
@@ -129,15 +135,22 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
|
||||
javaPath: config.java_path || ''
|
||||
})
|
||||
}
|
||||
} else {
|
||||
const unpatched = await unpatchGame()
|
||||
|
||||
if (!unpatched) {
|
||||
alert(`Could not unpatch game, aborting launch! (You can find your metadata backup in ${await dataDir()}\\cultivation\\)`)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// Launch the program
|
||||
const gameExists = await invoke('dir_exists', {
|
||||
path: config.game_install_path
|
||||
path: exe || config.game_install_path
|
||||
})
|
||||
|
||||
if (gameExists) await invoke('run_program', { path: config.game_install_path })
|
||||
else alert('Game not found! At: ' + config.game_install_path)
|
||||
if (gameExists) await invoke('run_program', { path: exe || config.game_install_path })
|
||||
else alert('Game not found! At: ' + (exe || config.game_install_path))
|
||||
}
|
||||
|
||||
async launchServer() {
|
||||
@@ -161,6 +174,16 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
|
||||
})
|
||||
}
|
||||
|
||||
async launchAkebi() {
|
||||
const config = await getConfig()
|
||||
|
||||
// Get game exe from game path, so we can watch it
|
||||
const pathArr = config.game_install_path.replace(/\\/g, '/').split('/')
|
||||
const gameExec = pathArr[pathArr.length - 1]
|
||||
|
||||
await this.playGame(config.akebi_path, gameExec)
|
||||
}
|
||||
|
||||
setIp(text: string) {
|
||||
this.setState({
|
||||
ip: text
|
||||
@@ -196,7 +219,7 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
|
||||
{
|
||||
this.state.grasscutterEnabled && (
|
||||
<div>
|
||||
<div className="ServerConfig">
|
||||
<div className="ServerConfig" id="serverConfigContainer">
|
||||
<TextInput id="ip" key="ip" placeholder={this.state.ipPlaceholder} onChange={this.setIp} initalValue={this.state.ip} />
|
||||
<TextInput style={{
|
||||
width: '10%',
|
||||
@@ -205,15 +228,21 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
|
||||
<Checkbox id="httpsEnable" label={this.state.httpsLabel} onChange={this.toggleHttps} checked={this.state.httpsEnabled} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
<div className="ServerLaunchButtons">
|
||||
<div className="ServerLaunchButtons" id="serverLaunchContainer">
|
||||
<BigButton onClick={this.playGame} id="officialPlay">{this.state.buttonLabel}</BigButton>
|
||||
{
|
||||
this.state.swag && (
|
||||
<BigButton onClick={this.launchAkebi} id="akebiLaunch">
|
||||
<img className="AkebiIcon" id="akebiIcon" src={Akebi} />
|
||||
</BigButton>
|
||||
)
|
||||
}
|
||||
<BigButton onClick={this.launchServer} id="serverLaunch">
|
||||
<img className="ServerIcon" src={Server} />
|
||||
<img className="ServerIcon" id="serverLaunchIcon" src={Server} />
|
||||
</BigButton>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -25,4 +25,30 @@
|
||||
#version {
|
||||
margin: 0px 6px;
|
||||
color: #434343;
|
||||
}
|
||||
|
||||
#unassumingButton {
|
||||
font-weight: bold;
|
||||
margin: 0px 6px;
|
||||
color: #141414;
|
||||
|
||||
transition: color 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
#unassumingButton:hover {
|
||||
color: #434343;
|
||||
}
|
||||
|
||||
#unassumingButton.spin {
|
||||
color: #fff;
|
||||
animation: spin 0.5s ease-in-out;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
@@ -5,11 +5,11 @@ import closeIcon from '../../resources/icons/close.svg'
|
||||
import minIcon from '../../resources/icons/min.svg'
|
||||
import cogBtn from '../../resources/icons/cog.svg'
|
||||
import downBtn from '../../resources/icons/download.svg'
|
||||
import gameBtn from '../../resources/icons/game.svg'
|
||||
|
||||
import Tr from '../../utils/language'
|
||||
|
||||
import './TopBar.css'
|
||||
import { getConfig, setConfigOption } from '../../utils/configuration'
|
||||
|
||||
interface IProps {
|
||||
optFunc: () => void;
|
||||
@@ -19,13 +19,21 @@ interface IProps {
|
||||
|
||||
interface IState {
|
||||
version: string;
|
||||
clicks: number;
|
||||
intv: NodeJS.Timeout | null;
|
||||
}
|
||||
|
||||
export default class TopBar extends React.Component<IProps, IState> {
|
||||
constructor(props: IProps) {
|
||||
super(props)
|
||||
|
||||
this.state = { version: '0.0.0' }
|
||||
this.state = {
|
||||
version: '0.0.0',
|
||||
clicks: 0,
|
||||
intv: null
|
||||
}
|
||||
|
||||
this.activateClick = this.activateClick.bind(this)
|
||||
}
|
||||
|
||||
async componentDidMount() {
|
||||
@@ -41,16 +49,59 @@ export default class TopBar extends React.Component<IProps, IState> {
|
||||
appWindow.minimize()
|
||||
}
|
||||
|
||||
async activateClick() {
|
||||
const config = await getConfig()
|
||||
|
||||
// They already got it, no need to reactivate
|
||||
if (config.swag_mode) return
|
||||
|
||||
if (this.state.clicks === 2) {
|
||||
setTimeout(() => {
|
||||
// Gotta clear it so it goes back to regular colors
|
||||
this.setState({
|
||||
clicks: 0
|
||||
})
|
||||
}, 600)
|
||||
|
||||
// Activate... SWAG MODE
|
||||
await setConfigOption('swag_mode', true)
|
||||
|
||||
// Reload the window
|
||||
window.location.reload()
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
if (this.state.clicks < 3) {
|
||||
this.setState({
|
||||
clicks: this.state.clicks + 1,
|
||||
intv: setTimeout(() => this.setState({ clicks: 0 }), 1500)
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="TopBar" data-tauri-drag-region>
|
||||
<div className="TopBar" id="topBarContainer" data-tauri-drag-region>
|
||||
<div id="title">
|
||||
<span data-tauri-drag-region>
|
||||
<Tr text="main.title" />
|
||||
</span>
|
||||
<span data-tauri-drag-region id="version">{this.state?.version}</span>
|
||||
</div>
|
||||
<div className="TopBtns">
|
||||
{
|
||||
/**
|
||||
* HEY YOU
|
||||
*
|
||||
* If you're looking at the source code to find the swag mode thing, that's okay! If you're not, move along...
|
||||
* Just do me a favor and don't go telling everyone about how you found it. If you are just helping someone who
|
||||
* for some reason needs it, that's fine, but not EVERYONE needs it, which is why it exists in the first place.
|
||||
*/
|
||||
}
|
||||
<div id="unassumingButton" className={this.state.clicks === 2 ? 'spin' : ''} onClick={this.activateClick}>?</div>
|
||||
<div className="TopBtns" id="topBarButtonContainer">
|
||||
<div id="closeBtn" onClick={this.handleClose} className='TopButton'>
|
||||
<img src={closeIcon} alt="close" />
|
||||
</div>
|
||||
|
||||
@@ -3,7 +3,7 @@ import './BigButton.css'
|
||||
|
||||
interface IProps {
|
||||
children: React.ReactNode;
|
||||
onClick: () => any;
|
||||
onClick: () => unknown;
|
||||
id: string;
|
||||
disabled?: boolean;
|
||||
}
|
||||
@@ -23,7 +23,7 @@ export default class BigButton extends React.Component<IProps, IState> {
|
||||
this.handleClick = this.handleClick.bind(this)
|
||||
}
|
||||
|
||||
static getDerivedStateFromProps(props: IProps, state: IState) {
|
||||
static getDerivedStateFromProps(props: IProps, _state: IState) {
|
||||
return {
|
||||
disabled: props.disabled
|
||||
}
|
||||
|
||||
@@ -14,7 +14,8 @@ interface IProps {
|
||||
readonly?: boolean
|
||||
placeholder?: string
|
||||
folder?: boolean
|
||||
customClearBehaviour?: () => void
|
||||
customClearBehaviour?: () => void,
|
||||
openFolder?: string
|
||||
}
|
||||
|
||||
interface IState {
|
||||
@@ -67,10 +68,12 @@ export default class DirInput extends React.Component<IProps, IState> {
|
||||
directory: true
|
||||
})
|
||||
} else {
|
||||
console.log(this.props.openFolder)
|
||||
path = await open({
|
||||
filters: [
|
||||
{ name: 'Files', extensions: this.props.extensions || ['*'] }
|
||||
]
|
||||
],
|
||||
defaultPath: this.props.openFolder
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -12,9 +12,7 @@ interface IProps {
|
||||
id?: string;
|
||||
clearable?: boolean;
|
||||
customClearBehaviour?: () => void;
|
||||
style?: {
|
||||
[key: string]: any;
|
||||
}
|
||||
style?: React.CSSProperties;
|
||||
}
|
||||
|
||||
interface IState {
|
||||
|
||||
@@ -8,7 +8,7 @@ import { dataDir } from '@tauri-apps/api/path'
|
||||
|
||||
import './Downloads.css'
|
||||
import Divider from './Divider'
|
||||
import { getConfigOption, setConfigOption } from '../../../utils/configuration'
|
||||
import { getConfigOption } from '../../../utils/configuration'
|
||||
import { invoke } from '@tauri-apps/api'
|
||||
import { listen } from '@tauri-apps/api/event'
|
||||
import HelpButton from '../common/HelpButton'
|
||||
@@ -183,15 +183,15 @@ export default class Downloads extends React.Component<IProps, IState> {
|
||||
grasscutter_downloading: this.props.downloadManager.downloadingJar(),
|
||||
resources_downloading: this.props.downloadManager.downloadingResources(),
|
||||
repo_downloading: this.props.downloadManager.downloadingRepo(),
|
||||
grasscutter_set: gc_path && gc_path !== '',
|
||||
grasscutter_set: gc_path !== '',
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Menu closeFn={this.props.closeFn} className="Downloads" heading="Downloads">
|
||||
<div className='DownloadMenuSection'>
|
||||
<div className='DownloadLabel'>
|
||||
<div className='DownloadMenuSection' id="downloadMenuContainerGCStable">
|
||||
<div className='DownloadLabel' id="downloadMenuLabelGCStable">
|
||||
<Tr text={
|
||||
this.state.grasscutter_set ? 'downloads.grasscutter_stable' : 'downloads.grasscutter_stable_update'
|
||||
} />
|
||||
@@ -199,14 +199,14 @@ export default class Downloads extends React.Component<IProps, IState> {
|
||||
<Tr text="help.gc_stable_jar" />
|
||||
</HelpButton>
|
||||
</div>
|
||||
<div className='DownloadValue'>
|
||||
<div className='DownloadValue' id="downloadMenuButtonGCStable">
|
||||
<BigButton disabled={this.state.grasscutter_downloading} onClick={this.downloadGrasscutterStable} id="grasscutterStableBtn" >
|
||||
<Tr text="components.download" />
|
||||
</BigButton>
|
||||
</div>
|
||||
</div>
|
||||
<div className='DownloadMenuSection'>
|
||||
<div className='DownloadLabel'>
|
||||
<div className='DownloadMenuSection' id="downloadMenuContainerGCDev">
|
||||
<div className='DownloadLabel' id="downloadMenuLabelGCDev">
|
||||
<Tr text={
|
||||
this.state.grasscutter_set ? 'downloads.grasscutter_latest' : 'downloads.grasscutter_latest_update'
|
||||
} />
|
||||
@@ -214,7 +214,7 @@ export default class Downloads extends React.Component<IProps, IState> {
|
||||
<Tr text="help.gc_dev_jar" />
|
||||
</HelpButton>
|
||||
</div>
|
||||
<div className='DownloadValue'>
|
||||
<div className='DownloadValue' id="downloadMenuButtonGCDev">
|
||||
<BigButton disabled={this.state.grasscutter_downloading} onClick={this.downloadGrasscutterLatest} id="grasscutterLatestBtn" >
|
||||
<Tr text="components.download" />
|
||||
</BigButton>
|
||||
@@ -223,8 +223,8 @@ export default class Downloads extends React.Component<IProps, IState> {
|
||||
|
||||
<Divider />
|
||||
|
||||
<div className='DownloadMenuSection'>
|
||||
<div className='DownloadLabel'>
|
||||
<div className='DownloadMenuSection' id="downloadMenuContainerGCStableData">
|
||||
<div className='DownloadLabel' id="downloadMenuLabelGCStableData">
|
||||
<Tr text={
|
||||
this.state.grasscutter_set ? 'downloads.grasscutter_stable_data' : 'downloads.grasscutter_stable_data_update'
|
||||
} />
|
||||
@@ -232,14 +232,14 @@ export default class Downloads extends React.Component<IProps, IState> {
|
||||
<Tr text="help.gc_stable_data" />
|
||||
</HelpButton>
|
||||
</div>
|
||||
<div className='DownloadValue'>
|
||||
<div className='DownloadValue' id="downloadMenuButtonGCStableData">
|
||||
<BigButton disabled={this.state.repo_downloading} onClick={this.downloadGrasscutterStableRepo} id="grasscutterStableRepo" >
|
||||
<Tr text="components.download" />
|
||||
</BigButton>
|
||||
</div>
|
||||
</div>
|
||||
<div className='DownloadMenuSection'>
|
||||
<div className='DownloadLabel'>
|
||||
<div className='DownloadMenuSection' id="downloadMenuContainerGCDevData">
|
||||
<div className='DownloadLabel' id="downloadMenuLabelGCDevData">
|
||||
<Tr text={
|
||||
this.state.grasscutter_set ? 'downloads.grasscutter_latest_data' : 'downloads.grasscutter_latest_data_update'
|
||||
} />
|
||||
@@ -247,7 +247,7 @@ export default class Downloads extends React.Component<IProps, IState> {
|
||||
<Tr text="help.gc_dev_data" />
|
||||
</HelpButton>
|
||||
</div>
|
||||
<div className='DownloadValue'>
|
||||
<div className='DownloadValue' id="downloadMenuButtonGCDevData">
|
||||
<BigButton disabled={this.state.repo_downloading} onClick={this.downloadGrasscutterStableRepo} id="grasscutterDevRepo" >
|
||||
<Tr text="components.download" />
|
||||
</BigButton>
|
||||
@@ -256,14 +256,14 @@ export default class Downloads extends React.Component<IProps, IState> {
|
||||
|
||||
<Divider />
|
||||
|
||||
<div className='DownloadMenuSection'>
|
||||
<div className='DownloadLabel'>
|
||||
<div className='DownloadMenuSection' id="downloadMenuContainerResources">
|
||||
<div className='DownloadLabel' id="downloadMenuLabelResources">
|
||||
<Tr text="downloads.resources" />
|
||||
<HelpButton>
|
||||
<Tr text="help.resources" />
|
||||
</HelpButton>
|
||||
</div>
|
||||
<div className='DownloadValue'>
|
||||
<div className='DownloadValue' id="downloadMenuButtonResources">
|
||||
<BigButton disabled={this.state.resources_downloading || !this.state.grasscutter_set || this.state.resources_exist} onClick={this.downloadResources} id="resourcesBtn" >
|
||||
<Tr text="components.download" />
|
||||
</BigButton>
|
||||
|
||||
@@ -14,6 +14,12 @@
|
||||
border-radius: 10px;
|
||||
|
||||
box-shadow: 0px 0px 5px 3px rgba(0, 0, 0, 0.2);
|
||||
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.Menu::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.MenuInner {
|
||||
|
||||
@@ -17,14 +17,14 @@ export default class Menu extends React.Component<IProps, never> {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className={'Menu ' + this.props.className}>
|
||||
<div className='MenuTop'>
|
||||
<div className="MenuHeading">{this.props.heading}</div>
|
||||
<div className="MenuExit" onClick={this.props.closeFn}>
|
||||
<img src={Close} className="MenuClose" />
|
||||
<div className={'Menu ' + this.props.className} id="menuContainer">
|
||||
<div className='MenuTop' id="menuContainerTop">
|
||||
<div className="MenuHeading" id="menuHeading">{this.props.heading}</div>
|
||||
<div className="MenuExit" id="menuButtonCloseContainer" onClick={this.props.closeFn}>
|
||||
<img src={Close} className="MenuClose" id="menuButtonCloseIcon" />
|
||||
</div>
|
||||
</div>
|
||||
<div className='MenuInner'>
|
||||
<div className='MenuInner' id="menuContent">
|
||||
{this.props.children}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -6,4 +6,13 @@
|
||||
|
||||
margin-bottom: 8px;
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.OptionSection .BigButton {
|
||||
height: 100%;
|
||||
min-height: 30px;
|
||||
}
|
||||
|
||||
.OptionSection .BigButtonText {
|
||||
font-size: 12px;
|
||||
}
|
||||
@@ -3,16 +3,21 @@ import { invoke } from '@tauri-apps/api'
|
||||
import { dataDir } from '@tauri-apps/api/path'
|
||||
import DirInput from '../common/DirInput'
|
||||
import Menu from './Menu'
|
||||
import Tr, { getLanguages } from '../../../utils/language'
|
||||
import Tr, { getLanguages, translate } from '../../../utils/language'
|
||||
import { setConfigOption, getConfig, getConfigOption } from '../../../utils/configuration'
|
||||
import Checkbox from '../common/Checkbox'
|
||||
import Divider from './Divider'
|
||||
import { getThemeList } from '../../../utils/themes'
|
||||
import * as server from '../../../utils/server'
|
||||
|
||||
import './Options.css'
|
||||
import BigButton from '../common/BigButton'
|
||||
import DownloadHandler from '../../../utils/download'
|
||||
import * as meta from '../../../utils/metadata'
|
||||
|
||||
interface IProps {
|
||||
closeFn: () => void;
|
||||
downloadManager: DownloadHandler;
|
||||
}
|
||||
|
||||
interface IState {
|
||||
@@ -25,6 +30,11 @@ interface IState {
|
||||
bg_url_or_path: string
|
||||
themes: string[]
|
||||
theme: string
|
||||
encryption: boolean
|
||||
swag: boolean
|
||||
|
||||
// Swag stuff
|
||||
akebi_path: string
|
||||
}
|
||||
|
||||
export default class Options extends React.Component<IProps, IState> {
|
||||
@@ -40,20 +50,33 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
current_language: 'en',
|
||||
bg_url_or_path: '',
|
||||
themes: ['default'],
|
||||
theme: ''
|
||||
theme: '',
|
||||
encryption: false,
|
||||
swag: false,
|
||||
|
||||
// Swag stuff
|
||||
akebi_path: '',
|
||||
}
|
||||
|
||||
this.setGameExec = this.setGameExec.bind(this)
|
||||
this.setGameExecutable = this.setGameExecutable.bind(this)
|
||||
this.setGrasscutterJar = this.setGrasscutterJar.bind(this)
|
||||
this.setJavaPath = this.setJavaPath.bind(this)
|
||||
this.setAkebi = this.setAkebi.bind(this)
|
||||
this.toggleGrasscutterWithGame = this.toggleGrasscutterWithGame.bind(this)
|
||||
this.setCustomBackground = this.setCustomBackground.bind(this)
|
||||
this.toggleEncryption = this.toggleEncryption.bind(this)
|
||||
this.restoreMetadata = this.restoreMetadata.bind(this)
|
||||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const config = await getConfig()
|
||||
const languages = await getLanguages()
|
||||
|
||||
// Remove jar from path
|
||||
const path = config.grasscutter_path.replace(/\\/g, '/')
|
||||
const folderPath = path.substring(0, path.lastIndexOf('/'))
|
||||
const encEnabled = await server.encryptionEnabled(folderPath + '/config.json')
|
||||
|
||||
this.setState({
|
||||
game_install_path: config.game_install_path || '',
|
||||
grasscutter_path: config.grasscutter_path || '',
|
||||
@@ -62,18 +85,23 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
language_options: languages,
|
||||
current_language: config.language || 'en',
|
||||
bg_url_or_path: config.customBackground || '',
|
||||
themes: (await getThemeList()).map(t => t.name),
|
||||
theme: config.theme || 'default'
|
||||
themes: (await getThemeList()).map((t) => t.name),
|
||||
theme: config.theme || 'default',
|
||||
encryption: await translate(encEnabled ? 'options.enabled' : 'options.disabled'),
|
||||
swag: config.swag_mode || false,
|
||||
|
||||
// Swag stuff
|
||||
akebi_path: config.akebi_path || '',
|
||||
})
|
||||
|
||||
this.forceUpdate()
|
||||
}
|
||||
|
||||
setGameExec(value: string) {
|
||||
setGameExecutable(value: string) {
|
||||
setConfigOption('game_install_path', value)
|
||||
|
||||
this.setState({
|
||||
game_install_path: value
|
||||
game_install_path: value,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -81,7 +109,7 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
setConfigOption('grasscutter_path', value)
|
||||
|
||||
this.setState({
|
||||
grasscutter_path: value
|
||||
grasscutter_path: value,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -89,7 +117,15 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
setConfigOption('java_path', value)
|
||||
|
||||
this.setState({
|
||||
java_path: value
|
||||
java_path: value,
|
||||
})
|
||||
}
|
||||
|
||||
setAkebi(value: string) {
|
||||
setConfigOption('akebi_path', value)
|
||||
|
||||
this.setState({
|
||||
akebi_path: value
|
||||
})
|
||||
}
|
||||
|
||||
@@ -108,7 +144,7 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
setConfigOption('grasscutter_with_game', changedVal)
|
||||
|
||||
this.setState({
|
||||
grasscutter_with_game: changedVal
|
||||
grasscutter_with_game: changedVal,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -119,16 +155,16 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
|
||||
if (!isUrl) {
|
||||
const filename = value.replace(/\\/g, '/').split('/').pop()
|
||||
const localBgPath = (await dataDir() as string).replace(/\\/g, '/')
|
||||
|
||||
const localBgPath = ((await dataDir()) as string).replace(/\\/g, '/')
|
||||
|
||||
await setConfigOption('customBackground', `${localBgPath}/cultivation/bg/${filename}`)
|
||||
|
||||
|
||||
// Copy the file over to the local directory
|
||||
await invoke('copy_file', {
|
||||
path: value.replace(/\\/g, '/'),
|
||||
newPath: `${localBgPath}cultivation/bg/`
|
||||
newPath: `${localBgPath}cultivation/bg/`,
|
||||
})
|
||||
|
||||
|
||||
window.location.reload()
|
||||
} else {
|
||||
await setConfigOption('customBackground', value)
|
||||
@@ -136,52 +172,135 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
}
|
||||
}
|
||||
|
||||
async toggleEncryption() {
|
||||
const config = await getConfig()
|
||||
|
||||
// Check if grasscutter path is set
|
||||
if (!config.grasscutter_path) {
|
||||
alert('Grasscutter not set!')
|
||||
return
|
||||
}
|
||||
|
||||
// Remove jar from path
|
||||
const path = config.grasscutter_path.replace(/\\/g, '/')
|
||||
const folderPath = path.substring(0, path.lastIndexOf('/'))
|
||||
|
||||
await server.toggleEncryption(folderPath + '/config.json')
|
||||
|
||||
this.setState({
|
||||
encryption: await translate(
|
||||
(await server.encryptionEnabled(folderPath + '/config.json')) ? 'options.enabled' : 'options.disabled'
|
||||
),
|
||||
})
|
||||
}
|
||||
|
||||
async restoreMetadata() {
|
||||
console.log(this.props)
|
||||
await meta.restoreMetadata(this.props.downloadManager)
|
||||
}
|
||||
|
||||
async installCert() {
|
||||
await invoke('generate_ca_files', {
|
||||
path: await dataDir() + 'cultivation'
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Menu closeFn={this.props.closeFn} className="Options" heading="Options">
|
||||
<div className='OptionSection'>
|
||||
<div className='OptionLabel'>
|
||||
<Tr text="options.game_exec" />
|
||||
<div className="OptionSection" id="menuOptionsContainerGamePath">
|
||||
<div className="OptionLabel" id="menuOptionsLabelGamePath">
|
||||
<Tr text="options.game_path" />
|
||||
</div>
|
||||
<div className='OptionValue'>
|
||||
<DirInput onChange={this.setGameExec} value={this.state?.game_install_path} extensions={['exe']} />
|
||||
<div className="OptionValue" id="menuOptionsDirGamePath">
|
||||
<DirInput onChange={this.setGameExecutable} value={this.state?.game_install_path} extensions={['exe']} />
|
||||
</div>
|
||||
</div>
|
||||
<div className='OptionSection'>
|
||||
<div className='OptionLabel'>
|
||||
<div className="OptionSection" id="menuOptionsContainermetaDownload">
|
||||
<div className="OptionLabel" id="menuOptionsLabelmetaDownload">
|
||||
<Tr text="options.recover_metadata" />
|
||||
</div>
|
||||
<div className="OptionValue" id="menuOptionsButtonmetaDownload">
|
||||
<BigButton onClick={this.restoreMetadata} id="metaDownload">
|
||||
<Tr text='components.download' />
|
||||
</BigButton>
|
||||
</div>
|
||||
</div>
|
||||
<div className='OptionSection' id="menuOptionsContainerGCJar">
|
||||
<div className='OptionLabel' id="menuOptionsLabelGCJar">
|
||||
<Tr text="options.grasscutter_jar" />
|
||||
</div>
|
||||
<div className='OptionValue'>
|
||||
<div className="OptionValue" id="menuOptionsDirGCJar">
|
||||
<DirInput onChange={this.setGrasscutterJar} value={this.state?.grasscutter_path} extensions={['jar']} />
|
||||
</div>
|
||||
</div>
|
||||
<div className="OptionSection" id="menuOptionsContainerToggleEnc">
|
||||
<div className="OptionLabel" id="menuOptionsLabelToggleEnc">
|
||||
<Tr text="options.toggle_encryption" />
|
||||
</div>
|
||||
<div className="OptionValue" id="menuOptionsButtonToggleEnc">
|
||||
<BigButton onClick={this.toggleEncryption} id="toggleEnc">
|
||||
{this.state.encryption}
|
||||
</BigButton>
|
||||
</div>
|
||||
</div>
|
||||
<div className='OptionSection' id="menuOptionsContainerInstallCert">
|
||||
<div className='OptionLabel' id="menuOptionsLabelInstallCert">
|
||||
<Tr text="options.install_certificate" />
|
||||
</div>
|
||||
<div className='OptionValue' id="menuOptionsButtonInstallCert">
|
||||
<BigButton disabled={false} onClick={this.installCert} id="installCert">
|
||||
<Tr text="components.install" />
|
||||
</BigButton>
|
||||
</div>
|
||||
</div>
|
||||
{
|
||||
this.state.swag && (
|
||||
<>
|
||||
<Divider />
|
||||
<div className='OptionSection' id="menuOptionsContainerAkebi">
|
||||
<div className='OptionLabel' id="menuOptionsLabelAkebi">
|
||||
<Tr text="swag.akebi" />
|
||||
</div>
|
||||
<div className='OptionValue' id="menuOptionsDirAkebi">
|
||||
<DirInput onChange={this.setAkebi} value={this.state?.akebi_path} extensions={['exe']} />
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
<Divider />
|
||||
|
||||
<div className='OptionSection'>
|
||||
<div className='OptionLabel'>
|
||||
|
||||
<div className="OptionSection" id="menuOptionsContainerGCWGame">
|
||||
<div className="OptionLabel" id="menuOptionsLabelGCWDame">
|
||||
<Tr text="options.grasscutter_with_game" />
|
||||
</div>
|
||||
<div className='OptionValue'>
|
||||
<Checkbox onChange={this.toggleGrasscutterWithGame} checked={this.state?.grasscutter_with_game} id="gcWithGame" />
|
||||
<div className="OptionValue" id="menuOptionsCheckboxGCWGame">
|
||||
<Checkbox
|
||||
onChange={this.toggleGrasscutterWithGame}
|
||||
checked={this.state?.grasscutter_with_game}
|
||||
id="gcWithGame"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Divider />
|
||||
|
||||
<div className='OptionSection'>
|
||||
<div className='OptionLabel'>
|
||||
<div className="OptionSection" id="menuOptionsContainerThemes">
|
||||
<div className="OptionLabel" id="menuOptionsLabelThemes">
|
||||
<Tr text="options.theme" />
|
||||
</div>
|
||||
<div className='OptionValue'>
|
||||
<select value={this.state.theme} onChange={(event) => {
|
||||
this.setTheme(event.target.value)
|
||||
}}>
|
||||
{this.state.themes.map(t => (
|
||||
<option
|
||||
key={t}
|
||||
value={t}>
|
||||
|
||||
<div className="OptionValue" id="menuOptionsSelectThemes">
|
||||
<select
|
||||
value={this.state.theme}
|
||||
id="menuOptionsSelectMenuThemes"
|
||||
onChange={(event) => {
|
||||
this.setTheme(event.target.value)
|
||||
}}
|
||||
>
|
||||
{this.state.themes.map((t) => (
|
||||
<option key={t} value={t}>
|
||||
{t}
|
||||
</option>
|
||||
))}
|
||||
@@ -191,20 +310,20 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
|
||||
<Divider />
|
||||
|
||||
<div className='OptionSection'>
|
||||
<div className='OptionLabel'>
|
||||
<div className="OptionSection" id="menuOptionsContainerJavaPath">
|
||||
<div className="OptionLabel" id="menuOptionsLabelJavaPath">
|
||||
<Tr text="options.java_path" />
|
||||
</div>
|
||||
<div className='OptionValue'>
|
||||
<div className="OptionValue" id="menuOptionsDirJavaPath">
|
||||
<DirInput onChange={this.setJavaPath} value={this.state?.java_path} extensions={['exe']} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className='OptionSection'>
|
||||
<div className='OptionLabel'>
|
||||
<div className="OptionSection" id="menuOptionsContainerBG">
|
||||
<div className="OptionLabel" id="menuOptionsLabelBG">
|
||||
<Tr text="options.background" />
|
||||
</div>
|
||||
<div className='OptionValue'>
|
||||
<div className="OptionValue" id="menuOptionsDirBG">
|
||||
<DirInput
|
||||
onChange={this.setCustomBackground}
|
||||
value={this.state?.bg_url_or_path}
|
||||
@@ -219,19 +338,20 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className='OptionSection'>
|
||||
<div className='OptionLabel'>
|
||||
<div className="OptionSection" id="menuOptionsContainerLang">
|
||||
<div className="OptionLabel" id="menuOptionsLabelLang">
|
||||
<Tr text="options.language" />
|
||||
</div>
|
||||
<div className='OptionValue'>
|
||||
<select value={this.state.current_language} onChange={(event) => {
|
||||
this.setLanguage(event.target.value)
|
||||
}}>
|
||||
{this.state.language_options.map(lang => (
|
||||
<option
|
||||
key={Object.keys(lang)[0]}
|
||||
value={Object.keys(lang)[0]}>
|
||||
|
||||
<div className="OptionValue" id="menuOptionsSelectLang">
|
||||
<select
|
||||
value={this.state.current_language}
|
||||
id="menuOptionsSelectMenuLang"
|
||||
onChange={(event) => {
|
||||
this.setLanguage(event.target.value)
|
||||
}}
|
||||
>
|
||||
{this.state.language_options.map((lang) => (
|
||||
<option key={Object.keys(lang)[0]} value={Object.keys(lang)[0]}>
|
||||
{lang[Object.keys(lang)[0]]}
|
||||
</option>
|
||||
))}
|
||||
@@ -241,4 +361,4 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
</Menu>
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,8 +11,28 @@ interface IProps {
|
||||
|
||||
interface IState {
|
||||
selected: string;
|
||||
news: any;
|
||||
commitList: any;
|
||||
news?: JSX.Element;
|
||||
commitList?: JSX.Element[];
|
||||
}
|
||||
|
||||
interface GrasscutterAPIResponse {
|
||||
commits: {
|
||||
gc_stable: CommitResponse[];
|
||||
gc_dev: CommitResponse[];
|
||||
cultivation: CommitResponse[];
|
||||
}
|
||||
}
|
||||
|
||||
interface CommitResponse {
|
||||
sha: string;
|
||||
commit: Commit;
|
||||
}
|
||||
|
||||
interface Commit {
|
||||
author: {
|
||||
name: string;
|
||||
};
|
||||
message: string;
|
||||
}
|
||||
|
||||
export default class NewsSection extends React.Component<IProps, IState> {
|
||||
@@ -21,8 +41,6 @@ export default class NewsSection extends React.Component<IProps, IState> {
|
||||
|
||||
this.state = {
|
||||
selected: props.selected || 'commits',
|
||||
news: null,
|
||||
commitList: null
|
||||
}
|
||||
|
||||
this.setSelected = this.setSelected.bind(this)
|
||||
@@ -42,42 +60,41 @@ export default class NewsSection extends React.Component<IProps, IState> {
|
||||
|
||||
async showLatestCommits() {
|
||||
if (!this.state.commitList) {
|
||||
const commits: string = await invoke('req_get', { url: 'https://api.grasscutters.xyz/cultivation/query' })
|
||||
let obj
|
||||
const response: string = await invoke('req_get', { url: 'https://api.grasscutter.io/cultivation/query' })
|
||||
let grasscutterApiResponse: GrasscutterAPIResponse | null = null
|
||||
|
||||
try {
|
||||
obj = JSON.parse(commits)
|
||||
grasscutterApiResponse = JSON.parse(response)
|
||||
} catch(e) {
|
||||
obj = {}
|
||||
grasscutterApiResponse = null
|
||||
}
|
||||
|
||||
// If it didn't work, use official API
|
||||
if (!obj.commits) {
|
||||
const commits: string = await invoke('req_get', { url: 'https://api.github.com/repos/Grasscutters/Grasscutter/commits' })
|
||||
obj = JSON.parse(commits)
|
||||
let commits: CommitResponse[]
|
||||
if (grasscutterApiResponse?.commits == null) {
|
||||
// If it didn't work, use official API
|
||||
const response: string = await invoke('req_get', { url: 'https://api.github.com/repos/Grasscutters/Grasscutter/commits' })
|
||||
commits = JSON.parse(response)
|
||||
} else {
|
||||
const decoded: string = await invoke('base64_decode', { encoded: obj.commits })
|
||||
const commitData = JSON.parse(decoded)
|
||||
obj = commitData.gc_stable
|
||||
commits = grasscutterApiResponse.commits.gc_stable
|
||||
}
|
||||
|
||||
// Probably rate-limited
|
||||
if (!Array.isArray(obj)) return
|
||||
if (!Array.isArray(commits)) return
|
||||
|
||||
// Get only first 5
|
||||
const commitsList = obj.slice(0, 10)
|
||||
const commitsListHtml = commitsList.map((commit: any) => {
|
||||
const commitsList = commits.slice(0, 10)
|
||||
const commitsListHtml = commitsList.map((commitResponse: CommitResponse) => {
|
||||
return (
|
||||
<tr className="Commit" key={commit.sha}>
|
||||
<td className="CommitAuthor"><span>{commit.commit.author.name}</span></td>
|
||||
<td className="CommitMessage"><span>{commit.commit.message}</span></td>
|
||||
<tr className="Commit" id="newsCommitsTable" key={commitResponse.sha}>
|
||||
<td className="CommitAuthor"><span>{commitResponse.commit.author.name}</span></td>
|
||||
<td className="CommitMessage"><span>{commitResponse.commit.message}</span></td>
|
||||
</tr>
|
||||
)
|
||||
})
|
||||
|
||||
this.setState({
|
||||
commitList: commitsListHtml,
|
||||
news: commitsListHtml
|
||||
news: <>{commitsListHtml}</>
|
||||
})
|
||||
}
|
||||
|
||||
@@ -85,12 +102,16 @@ export default class NewsSection extends React.Component<IProps, IState> {
|
||||
}
|
||||
|
||||
async showNews() {
|
||||
let news = <tr></tr>
|
||||
let news: JSX.Element | JSX.Element[] = <tr></tr>
|
||||
|
||||
switch(this.state.selected) {
|
||||
case 'commits':
|
||||
news = await this.showLatestCommits()
|
||||
case 'commits': {
|
||||
const commits = await this.showLatestCommits()
|
||||
if (commits != null) {
|
||||
news = commits
|
||||
}
|
||||
break
|
||||
}
|
||||
|
||||
case 'latest_version':
|
||||
news = <tr><td>Latest version</td></tr>
|
||||
@@ -102,14 +123,14 @@ export default class NewsSection extends React.Component<IProps, IState> {
|
||||
}
|
||||
|
||||
this.setState({
|
||||
news
|
||||
news: <>{news}</>
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="NewsSection">
|
||||
<div className="NewsTabs">
|
||||
<div className="NewsSection" id="newsContainer">
|
||||
<div className="NewsTabs" id="newsTabsContainer">
|
||||
<div className={'NewsTab ' + (this.state.selected === 'commits' ? 'selected' : '')} id="commits" onClick={() => this.setSelected('commits')}>
|
||||
<Tr text="news.latest_commits" />
|
||||
</div>
|
||||
@@ -117,7 +138,7 @@ export default class NewsSection extends React.Component<IProps, IState> {
|
||||
<Tr text="news.latest_version" />
|
||||
</div>
|
||||
</div>
|
||||
<table className="NewsContent">
|
||||
<table className="NewsContent" id="newsContent">
|
||||
<tbody>
|
||||
{this.state.news}
|
||||
</tbody>
|
||||
|
||||
@@ -20,6 +20,7 @@ let defaultConfig: Configuration
|
||||
cert_generated: false,
|
||||
theme: 'default',
|
||||
https_enabled: false,
|
||||
debug_enabled: false
|
||||
}
|
||||
})()
|
||||
|
||||
@@ -39,21 +40,27 @@ export interface Configuration {
|
||||
language: string
|
||||
customBackground: string
|
||||
cert_generated: boolean
|
||||
theme: string;
|
||||
theme: string
|
||||
https_enabled: boolean
|
||||
debug_enabled: boolean
|
||||
swag_mode?: boolean
|
||||
|
||||
// Swag stuff
|
||||
akebi_path?: string
|
||||
}
|
||||
|
||||
export async function setConfigOption(key: string, value: any): Promise<void> {
|
||||
const config: any = await getConfig()
|
||||
export async function setConfigOption<K extends keyof Configuration>(key: K, value: Configuration[K]): Promise<void> {
|
||||
const config = await getConfig()
|
||||
config[key] = value
|
||||
|
||||
await saveConfig(<Configuration> config)
|
||||
}
|
||||
|
||||
export async function getConfigOption(key: string): Promise<any> {
|
||||
const config: any = await getConfig()
|
||||
export async function getConfigOption<K extends keyof Configuration>(key: K): Promise<Configuration[K]> {
|
||||
const config = await getConfig()
|
||||
const defaults = defaultConfig
|
||||
|
||||
return config[key] || null
|
||||
return config[key] || defaults[key]
|
||||
}
|
||||
|
||||
export async function getConfig() {
|
||||
@@ -81,7 +88,7 @@ export async function saveConfig(obj: Configuration) {
|
||||
async function readConfigFile() {
|
||||
const local = await dataDir()
|
||||
|
||||
if (!configFilePath) configFilePath = local + 'cultivation\\configuration.json'
|
||||
if (!configFilePath) configFilePath = local + 'cultivation/configuration.json'
|
||||
|
||||
// Ensure Cultivation dir exists
|
||||
const dirs = await fs.readDir(local)
|
||||
@@ -91,12 +98,12 @@ async function readConfigFile() {
|
||||
await fs.createDir(local + 'cultivation').catch(e => console.log(e))
|
||||
}
|
||||
|
||||
const innerDirs = await fs.readDir(local + '\\cultivation')
|
||||
const innerDirs = await fs.readDir(local + '/cultivation')
|
||||
|
||||
// Create grasscutter dir for potential installation
|
||||
if (!innerDirs.find((fileOrDir) => fileOrDir?.name === 'grasscutter')) {
|
||||
// Create dir
|
||||
await fs.createDir(local + 'cultivation\\grasscutter').catch(e => console.log(e))
|
||||
await fs.createDir(local + 'cultivation/grasscutter').catch(e => console.log(e))
|
||||
}
|
||||
|
||||
const dataFiles = await fs.readDir(local + 'cultivation')
|
||||
|
||||
27
src/utils/game.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { getConfig } from './configuration'
|
||||
|
||||
export async function getGameExecutable() {
|
||||
const config = await getConfig()
|
||||
|
||||
if(!config.game_install_path) {
|
||||
return null
|
||||
}
|
||||
|
||||
const pathArr = config.game_install_path.replace(/\\/g, '/').split('/')
|
||||
return pathArr[pathArr.length - 1]
|
||||
}
|
||||
|
||||
export async function getGameFolder() {
|
||||
const config = await getConfig()
|
||||
|
||||
if(!config.game_install_path) {
|
||||
return null
|
||||
}
|
||||
|
||||
const pathArr = config.game_install_path.replace(/\\/g, '/').split('/')
|
||||
pathArr.pop()
|
||||
|
||||
const path = pathArr.join('/')
|
||||
|
||||
return path
|
||||
}
|
||||
229
src/utils/metadata.ts
Normal file
@@ -0,0 +1,229 @@
|
||||
import { invoke } from '@tauri-apps/api'
|
||||
import { dataDir } from '@tauri-apps/api/path'
|
||||
import DownloadHandler from './download'
|
||||
import { getGameExecutable, getGameFolder } from './game'
|
||||
|
||||
export async function patchMetadata() {
|
||||
const metadataExists = await invoke('dir_exists', {
|
||||
path: await getGameMetadataPath() + '\\global-metadata.dat'
|
||||
})
|
||||
|
||||
if (!metadataExists) {
|
||||
return false
|
||||
}
|
||||
|
||||
console.log('Copying unpatched metadata to backup location')
|
||||
|
||||
// Copy unpatched metadata to backup location
|
||||
const copiedMeta = await invoke('copy_file_with_new_name', {
|
||||
path: await getGameMetadataPath() + '\\global-metadata.dat',
|
||||
newPath: await getBackupMetadataPath(),
|
||||
newName: 'global-metadata-unpatched.dat'
|
||||
})
|
||||
|
||||
if (!copiedMeta) {
|
||||
console.log(await getBackupMetadataPath())
|
||||
return false
|
||||
}
|
||||
|
||||
// backup was successful! Time to patch
|
||||
|
||||
console.log('Patching backedup metadata')
|
||||
|
||||
const patchedMeta = await invoke('patch_metadata', {
|
||||
metadataFolder: await getBackupMetadataPath(),
|
||||
})
|
||||
|
||||
if (!patchedMeta) {
|
||||
return false
|
||||
}
|
||||
|
||||
// Patch also worked! Time to replace
|
||||
console.log('Replacing unpatched game metadata with patched metadata')
|
||||
|
||||
const replacedMeta = await invoke('copy_file_with_new_name', {
|
||||
path: await getBackupMetadataPath() + '\\global-metadata-patched.dat',
|
||||
newPath: await getGameMetadataPath(),
|
||||
newName: 'global-metadata.dat'
|
||||
})
|
||||
|
||||
if (!replacedMeta) {
|
||||
return false
|
||||
}
|
||||
|
||||
console.log('Replacement successful!')
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
export async function patchGame() {
|
||||
const backupExists = await invoke('dir_exists', {
|
||||
path: await getBackupMetadataPath() + '\\global-metadata-unpatched.dat'
|
||||
})
|
||||
|
||||
if (!backupExists) {
|
||||
// No backup found? Patching creates one
|
||||
const patched = await patchMetadata()
|
||||
|
||||
if (!patched) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// Are we already patched? If so, that's fine, just continue as normal
|
||||
const gameIsPatched = await invoke('are_files_identical', {
|
||||
path1: await getBackupMetadataPath() + '\\global-metadata-patched.dat',
|
||||
path2: await getGameMetadataPath() + '\\global-metadata.dat'
|
||||
})
|
||||
|
||||
if (gameIsPatched) {
|
||||
return true
|
||||
}
|
||||
|
||||
// Is the current backup the same as the games current metadata?
|
||||
const backupIsCurrent = await invoke('are_files_identical', {
|
||||
path1: await getBackupMetadataPath() + '\\global-metadata-unpatched.dat',
|
||||
path2: await getGameMetadataPath() + '\\global-metadata.dat'
|
||||
})
|
||||
|
||||
// Game has probably been updated. We need to repatch the game...
|
||||
if (!backupIsCurrent) {
|
||||
const deletedOldBackup = await invoke('delete_file', {
|
||||
path: await getBackupMetadataPath() + '\\global-metadata-unpatched.dat'
|
||||
})
|
||||
const deletedOldPatched = await invoke('delete_file', {
|
||||
path: await getBackupMetadataPath() + '\\global-metadata-patched.dat'
|
||||
})
|
||||
|
||||
// It's fine if these deletes fail. The game will be replaced anyway.
|
||||
if (!deletedOldBackup) {
|
||||
console.log('Warning: Failed to delete old backup!')
|
||||
}
|
||||
|
||||
if (!deletedOldPatched) {
|
||||
console.log('Warning: Failed to delete old patched metadata!')
|
||||
}
|
||||
|
||||
console.log('Patching Metadata')
|
||||
|
||||
const patched = await patchMetadata()
|
||||
|
||||
if (!patched) {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
console.log('Metadata is not patched')
|
||||
console.log('Replacing unpatched metadata')
|
||||
|
||||
// Finally, replace the unpatched metadata with the patched one
|
||||
const replaced = await invoke('copy_file_with_new_name', {
|
||||
path: await getBackupMetadataPath() + '\\global-metadata-patched.dat',
|
||||
newPath: await getGameMetadataPath(),
|
||||
newName: 'global-metadata.dat'
|
||||
})
|
||||
|
||||
if (!replaced) {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
export async function unpatchGame() {
|
||||
const backupExists = await invoke('dir_exists', {
|
||||
path: await getBackupMetadataPath() + '\\global-metadata-unpatched.dat'
|
||||
})
|
||||
|
||||
if (!backupExists) {
|
||||
// Let's just hope the game isn't on a patched metadata since we don't have a backup...
|
||||
return true
|
||||
}
|
||||
|
||||
const metaPatched = await invoke('are_files_identical', {
|
||||
path1: await getBackupMetadataPath() + '\\global-metadata-patched.dat',
|
||||
path2: await getGameMetadataPath() + '\\global-metadata.dat'
|
||||
})
|
||||
|
||||
const metaExists = await invoke('dir_exists', {
|
||||
path: await getGameMetadataPath() + '\\global-metadata.dat'
|
||||
})
|
||||
|
||||
if (!metaPatched && metaExists) {
|
||||
// Game isn't patched
|
||||
return true
|
||||
}
|
||||
|
||||
console.log('Replacing patched game metadata with unpatched metadata')
|
||||
|
||||
const replaced = await invoke('copy_file_with_new_name', {
|
||||
path: await getBackupMetadataPath() + '\\global-metadata-unpatched.dat',
|
||||
newPath: await getGameMetadataPath(),
|
||||
newName: 'global-metadata.dat'
|
||||
})
|
||||
|
||||
return replaced
|
||||
}
|
||||
|
||||
export async function getGameMetadataPath() {
|
||||
const gameExec = await getGameExecutable()
|
||||
|
||||
if (!gameExec) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (await getGameFolder() + '\\' + gameExec.replace('.exe', '_Data') + '\\Managed\\Metadata').replace(/\\/g, '/')
|
||||
}
|
||||
|
||||
export async function getBackupMetadataPath() {
|
||||
return await dataDir() + 'cultivation\\metadata'
|
||||
}
|
||||
|
||||
export async function globalMetadataLink() {
|
||||
const versionAPIUrl = 'https://sdk-os-static.mihoyo.com/hk4e_global/mdk/launcher/api/resource?channel_id=1&key=gcStgarh&launcher_id=10&sub_channel_id=0'
|
||||
|
||||
// Get versions from API
|
||||
const versions = JSON.parse(await invoke('web_get', {
|
||||
url: versionAPIUrl
|
||||
}))
|
||||
|
||||
if (!versions || versions.retcode !== 0) {
|
||||
console.log('Failed to get versions from API')
|
||||
return null
|
||||
}
|
||||
|
||||
// Get latest version
|
||||
const latest = versions.data.game.latest
|
||||
|
||||
return latest.decompressed_path as string + '/GenshinImpact_Data/Managed/Metadata/global-metadata.dat'
|
||||
}
|
||||
|
||||
export async function restoreMetadata(manager: DownloadHandler) {
|
||||
const backupExists = await invoke('dir_exists', {
|
||||
path: await getBackupMetadataPath() + '\\global-metadata-unpatched.dat'
|
||||
})
|
||||
|
||||
if (!backupExists) {
|
||||
console.log('No backup found! Replacing with global metadata link')
|
||||
|
||||
const metaLink = await globalMetadataLink()
|
||||
|
||||
if (!metaLink) {
|
||||
console.log('Coudl not get global metadata link!')
|
||||
return false
|
||||
}
|
||||
|
||||
// Download the file
|
||||
manager.addDownload(metaLink, await getBackupMetadataPath() + '\\global-metadata-unpatched.dat', () => {
|
||||
unpatchGame()
|
||||
})
|
||||
}
|
||||
|
||||
console.log('Restoring backedup metadata')
|
||||
|
||||
await unpatchGame()
|
||||
|
||||
return true
|
||||
}
|
||||
40
src/utils/server.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import { invoke } from '@tauri-apps/api'
|
||||
|
||||
export async function toggleEncryption(path: string) {
|
||||
let serverConf
|
||||
|
||||
try {
|
||||
serverConf = JSON.parse(await invoke('read_file', {
|
||||
path,
|
||||
}))
|
||||
} catch(e) {
|
||||
console.log(`Server config at ${path} not found or invalid`)
|
||||
return
|
||||
}
|
||||
|
||||
const enabled = serverConf.server.http.encryption.useEncryption
|
||||
|
||||
serverConf.server.http.encryption.useEncryption = !enabled
|
||||
serverConf.server.http.encryption.useInRouting = !enabled
|
||||
|
||||
// Write file
|
||||
await invoke('write_file', {
|
||||
path,
|
||||
contents: JSON.stringify(serverConf, null, 2),
|
||||
})
|
||||
}
|
||||
|
||||
export async function encryptionEnabled(path: string) {
|
||||
let serverConf
|
||||
|
||||
try {
|
||||
serverConf = JSON.parse(await invoke('read_file', {
|
||||
path,
|
||||
}))
|
||||
} catch(e) {
|
||||
console.log(`Server config at ${path} not found or invalid`)
|
||||
return false
|
||||
}
|
||||
|
||||
return serverConf.server.http.encryption.useEncryption
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import { invoke } from '@tauri-apps/api'
|
||||
import { dataDir } from '@tauri-apps/api/path'
|
||||
import { convertFileSrc } from '@tauri-apps/api/tauri'
|
||||
import { getConfig, setConfigOption } from './configuration'
|
||||
|
||||
interface Theme {
|
||||
name: string
|
||||
@@ -77,6 +78,9 @@ export async function getTheme(name: string) {
|
||||
}
|
||||
|
||||
export async function loadTheme(theme: ThemeList, document: Document) {
|
||||
// Get config, since we will set the custom background in there
|
||||
const config = await getConfig()
|
||||
|
||||
// We are going to dynamically load stylesheets into the document
|
||||
const head = document.head
|
||||
|
||||
@@ -107,22 +111,32 @@ export async function loadTheme(theme: ThemeList, document: Document) {
|
||||
|
||||
// Set custom background
|
||||
if (theme.customBackgroundURL) {
|
||||
document.body.style.backgroundImage = `url('${theme.customBackgroundURL}')`
|
||||
// If the custom bg is already set don't overwrite
|
||||
if (config.customBackground === '') {
|
||||
config.customBackground = theme.customBackgroundURL
|
||||
}
|
||||
}
|
||||
|
||||
// Set custom background
|
||||
if (theme.customBackgroundPath) {
|
||||
const bgPath = await dataDir() + 'cultivation/grasscutter/theme.png'
|
||||
const bgPath = (await dataDir()).replace(/\\/g, '/') + 'cultivation/bg/'
|
||||
const imageName = theme.customBackgroundPath.split('/').pop()
|
||||
|
||||
// Save the background to our data dir
|
||||
await invoke('copy_file', {
|
||||
path: theme.path + '/' + theme.customBackgroundPath,
|
||||
new_path: bgPath
|
||||
newPath: bgPath
|
||||
})
|
||||
|
||||
// Set the background
|
||||
document.body.style.backgroundImage = `url('${bgPath}')`
|
||||
// If the custom bg is already set don't overwrite
|
||||
if (config.customBackground === '') {
|
||||
config.customBackground = bgPath + imageName
|
||||
}
|
||||
}
|
||||
|
||||
// Write config
|
||||
await setConfigOption('customBackground', config.customBackground)
|
||||
|
||||
return
|
||||
}
|
||||
237
yarn.lock
@@ -1697,20 +1697,20 @@
|
||||
resolved "https://registry.npmjs.org/@tauri-apps/cli/-/cli-1.0.0-rc.13.tgz"
|
||||
integrity sha512-q7i45Mi1SMv5XllNoX09QS4Q/fYVFwD6piVYmqMSrKY/T5RwedQhytiVH60TxC2xk6o0akVHa7BdYiyJvXNR8A==
|
||||
optionalDependencies:
|
||||
"@tauri-apps/cli-darwin-arm64" "1.0.0-rc.13"
|
||||
"@tauri-apps/cli-darwin-x64" "1.0.0-rc.13"
|
||||
"@tauri-apps/cli-linux-arm-gnueabihf" "1.0.0-rc.13"
|
||||
"@tauri-apps/cli-linux-arm64-gnu" "1.0.0-rc.13"
|
||||
"@tauri-apps/cli-linux-arm64-musl" "1.0.0-rc.13"
|
||||
"@tauri-apps/cli-linux-x64-gnu" "1.0.0-rc.13"
|
||||
"@tauri-apps/cli-linux-x64-musl" "1.0.0-rc.13"
|
||||
"@tauri-apps/cli-win32-ia32-msvc" "1.0.0-rc.13"
|
||||
"@tauri-apps/cli-win32-x64-msvc" "1.0.0-rc.13"
|
||||
"@tauri-apps/cli-darwin-arm64" "1.0.0-rc.12"
|
||||
"@tauri-apps/cli-darwin-x64" "1.0.0-rc.12"
|
||||
"@tauri-apps/cli-linux-arm-gnueabihf" "1.0.0-rc.12"
|
||||
"@tauri-apps/cli-linux-arm64-gnu" "1.0.0-rc.12"
|
||||
"@tauri-apps/cli-linux-arm64-musl" "1.0.0-rc.12"
|
||||
"@tauri-apps/cli-linux-x64-gnu" "1.0.0-rc.12"
|
||||
"@tauri-apps/cli-linux-x64-musl" "1.0.0-rc.12"
|
||||
"@tauri-apps/cli-win32-ia32-msvc" "1.0.0-rc.12"
|
||||
"@tauri-apps/cli-win32-x64-msvc" "1.0.0-rc.12"
|
||||
|
||||
"@testing-library/dom@^8.5.0":
|
||||
version "8.13.0"
|
||||
resolved "https://registry.npmjs.org/@testing-library/dom/-/dom-8.13.0.tgz"
|
||||
integrity sha512-9VHgfIatKNXQNaZTtLnalIy0jNZzY35a4S3oi08YAt9Hv1VsfZ/DfA45lM8D/UhtHBGJ4/lGwp0PZkVndRkoOQ==
|
||||
version "8.14.0"
|
||||
resolved "https://registry.npmjs.org/@testing-library/dom/-/dom-8.14.0.tgz"
|
||||
integrity sha512-m8FOdUo77iMTwVRCyzWcqxlEIk+GnopbrRI15a0EaLbpZSCinIVI4kSQzWhkShK83GogvEFJSsHF3Ws0z1vrqA==
|
||||
dependencies:
|
||||
"@babel/code-frame" "^7.10.4"
|
||||
"@babel/runtime" "^7.12.5"
|
||||
@@ -1838,15 +1838,7 @@
|
||||
"@types/eslint" "*"
|
||||
"@types/estree" "*"
|
||||
|
||||
"@types/eslint@*":
|
||||
version "8.4.2"
|
||||
resolved "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.2.tgz"
|
||||
integrity sha512-Z1nseZON+GEnFjJc04sv4NSALGjhFwy6K0HXt7qsn5ArfAKtb63dXNJHf+1YW6IpOIYRBGUbu3GwJdj8DGnCjA==
|
||||
dependencies:
|
||||
"@types/estree" "*"
|
||||
"@types/json-schema" "*"
|
||||
|
||||
"@types/eslint@^7.28.2":
|
||||
"@types/eslint@*", "@types/eslint@^7.28.2":
|
||||
version "7.29.0"
|
||||
resolved "https://registry.npmjs.org/@types/eslint/-/eslint-7.29.0.tgz"
|
||||
integrity sha512-VNcvioYDH8/FxaeTKkM4/TiTwt6pBV9E3OfGmvaw8tPl0rrHCJ4Ll15HRT+pMiFAf/MLQvAzC+6RzUMEL9Ceng==
|
||||
@@ -1937,19 +1929,14 @@
|
||||
"@types/json5@^0.0.29":
|
||||
version "0.0.29"
|
||||
resolved "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz"
|
||||
integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4=
|
||||
integrity "sha1-7ihweulOEdK4J7y+UnC86n8+ce4= sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ=="
|
||||
|
||||
"@types/mime@^1":
|
||||
version "1.3.2"
|
||||
resolved "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz"
|
||||
integrity sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==
|
||||
|
||||
"@types/node@*":
|
||||
version "17.0.31"
|
||||
resolved "https://registry.npmjs.org/@types/node/-/node-17.0.31.tgz"
|
||||
integrity sha512-AR0x5HbXGqkEx9CadRH3EBYx/VkiUgZIhP4wvPn/+5KIsgpNoyFaRlVe0Zlx9gRtg8fA06a9tskE2MSN7TcG4Q==
|
||||
|
||||
"@types/node@^16.7.13":
|
||||
"@types/node@*", "@types/node@^16.7.13":
|
||||
version "16.11.33"
|
||||
resolved "https://registry.npmjs.org/@types/node/-/node-16.11.33.tgz"
|
||||
integrity sha512-0PJ0vg+JyU0MIan58IOIFRtSvsb7Ri+7Wltx2qAg94eMOrpg4+uuP3aUHCpxXc1i0jCXiC+zIamSZh3l9AbcQA==
|
||||
@@ -2496,7 +2483,7 @@ aria-query@^5.0.0:
|
||||
array-flatten@1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz"
|
||||
integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=
|
||||
integrity "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="
|
||||
|
||||
array-flatten@^2.1.2:
|
||||
version "2.1.2"
|
||||
@@ -2542,12 +2529,12 @@ array.prototype.flatmap@^1.2.5:
|
||||
asap@~2.0.6:
|
||||
version "2.0.6"
|
||||
resolved "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz"
|
||||
integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=
|
||||
integrity "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY= sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA=="
|
||||
|
||||
ast-types-flow@^0.0.7:
|
||||
version "0.0.7"
|
||||
resolved "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz"
|
||||
integrity sha1-9wtzXGvKGlycItmCw+Oef+ujva0=
|
||||
integrity "sha1-9wtzXGvKGlycItmCw+Oef+ujva0= sha512-eBvWn1lvIApYMhzQMsu9ciLfkBY499mFZlNqG+/9WR7PVlroQw0vG30cOQQbaKz3sCEc44TAOu2ykzqXSNnwag=="
|
||||
|
||||
async@^3.2.3:
|
||||
version "3.2.3"
|
||||
@@ -2557,7 +2544,7 @@ async@^3.2.3:
|
||||
asynckit@^0.4.0:
|
||||
version "0.4.0"
|
||||
resolved "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz"
|
||||
integrity sha1-x57Zf380y48robyXkLzDZkdLS3k=
|
||||
integrity "sha1-x57Zf380y48robyXkLzDZkdLS3k= sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
|
||||
|
||||
at-least-node@^1.0.0:
|
||||
version "1.0.0"
|
||||
@@ -2742,7 +2729,7 @@ balanced-match@^1.0.0:
|
||||
batch@0.6.1:
|
||||
version "0.6.1"
|
||||
resolved "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz"
|
||||
integrity sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=
|
||||
integrity "sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY= sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw=="
|
||||
|
||||
bfj@^7.0.2:
|
||||
version "7.0.2"
|
||||
@@ -2800,7 +2787,7 @@ bonjour-service@^1.0.11:
|
||||
boolbase@^1.0.0, boolbase@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz"
|
||||
integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24=
|
||||
integrity "sha1-aN/1++YMUes3cl6p4+0xDcwed24= sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww=="
|
||||
|
||||
brace-expansion@^1.1.7:
|
||||
version "1.1.11"
|
||||
@@ -2860,7 +2847,7 @@ builtin-modules@^3.1.0:
|
||||
bytes@3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz"
|
||||
integrity sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=
|
||||
integrity "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg= sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw=="
|
||||
|
||||
bytes@3.1.2:
|
||||
version "3.1.2"
|
||||
@@ -3017,7 +3004,7 @@ cliui@^7.0.2:
|
||||
co@^4.6.0:
|
||||
version "4.6.0"
|
||||
resolved "https://registry.npmjs.org/co/-/co-4.6.0.tgz"
|
||||
integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=
|
||||
integrity "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ=="
|
||||
|
||||
coa@^2.0.2:
|
||||
version "2.0.2"
|
||||
@@ -3050,7 +3037,7 @@ color-convert@^2.0.1:
|
||||
color-name@1.1.3:
|
||||
version "1.1.3"
|
||||
resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz"
|
||||
integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=
|
||||
integrity "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="
|
||||
|
||||
color-name@^1.1.4, color-name@~1.1.4:
|
||||
version "1.1.4"
|
||||
@@ -3102,7 +3089,7 @@ common-tags@^1.8.0:
|
||||
commondir@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz"
|
||||
integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=
|
||||
integrity "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg=="
|
||||
|
||||
compressible@~2.0.16:
|
||||
version "2.0.18"
|
||||
@@ -3127,7 +3114,7 @@ compression@^1.7.4:
|
||||
concat-map@0.0.1:
|
||||
version "0.0.1"
|
||||
resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz"
|
||||
integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
|
||||
integrity "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="
|
||||
|
||||
confusing-browser-globals@^1.0.11:
|
||||
version "1.0.11"
|
||||
@@ -3161,7 +3148,7 @@ convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0:
|
||||
cookie-signature@1.0.6:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz"
|
||||
integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw=
|
||||
integrity "sha1-4wOogrNCzD7oylE6eZmXNNqzriw= sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ=="
|
||||
|
||||
cookie@0.5.0:
|
||||
version "0.5.0"
|
||||
@@ -3339,7 +3326,7 @@ css-what@^6.0.1:
|
||||
css.escape@^1.5.1:
|
||||
version "1.5.1"
|
||||
resolved "https://registry.npmjs.org/css.escape/-/css.escape-1.5.1.tgz"
|
||||
integrity sha1-QuJ9T6BK4y+TGktNQZH6nN3ul8s=
|
||||
integrity "sha1-QuJ9T6BK4y+TGktNQZH6nN3ul8s= sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg=="
|
||||
|
||||
css@^3.0.0:
|
||||
version "3.0.0"
|
||||
@@ -3481,12 +3468,12 @@ decimal.js@^10.2.1:
|
||||
decode-uri-component@^0.2.0:
|
||||
version "0.2.0"
|
||||
resolved "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz"
|
||||
integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=
|
||||
integrity "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= sha512-hjf+xovcEn31w/EUYdTXQh/8smFL/dzYjohQGEIgjyNavaJfBY2p5F527Bo1VPATxv0VYTUC2bOcXvqFwk78Og=="
|
||||
|
||||
dedent@^0.7.0:
|
||||
version "0.7.0"
|
||||
resolved "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz"
|
||||
integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=
|
||||
integrity "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw= sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA=="
|
||||
|
||||
deep-is@^0.1.3, deep-is@~0.1.3:
|
||||
version "0.1.4"
|
||||
@@ -3521,12 +3508,12 @@ define-properties@^1.1.3, define-properties@^1.1.4:
|
||||
defined@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz"
|
||||
integrity sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=
|
||||
integrity "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM= sha512-Y2caI5+ZwS5c3RiNDJ6u53VhQHv+hHKwhkI1iHvceKUHw9Df6EK2zRLfjejRgMuCuxK7PfSWIMwWecceVvThjQ=="
|
||||
|
||||
delayed-stream@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz"
|
||||
integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk=
|
||||
integrity "sha1-3zrhmayt+31ECqrgsp4icrJOxhk= sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ=="
|
||||
|
||||
depd@2.0.0:
|
||||
version "2.0.0"
|
||||
@@ -3536,7 +3523,7 @@ depd@2.0.0:
|
||||
depd@~1.1.2:
|
||||
version "1.1.2"
|
||||
resolved "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz"
|
||||
integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=
|
||||
integrity "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ=="
|
||||
|
||||
destroy@1.2.0:
|
||||
version "1.2.0"
|
||||
@@ -3595,7 +3582,7 @@ dlv@^1.1.3:
|
||||
dns-equal@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.npmjs.org/dns-equal/-/dns-equal-1.0.0.tgz"
|
||||
integrity sha1-s55/HabrCnW6nBcySzR1PEfgZU0=
|
||||
integrity "sha1-s55/HabrCnW6nBcySzR1PEfgZU0= sha512-z+paD6YUQsk+AbGCEM4PrOXSss5gd66QfcVBFTKR/HpFL9jCqikS94HYwKww6fQyO7IxrIIyUu+g0Ka9tUS2Cg=="
|
||||
|
||||
dns-packet@^5.2.2:
|
||||
version "5.3.1"
|
||||
@@ -3714,7 +3701,7 @@ duplexer@^0.1.2:
|
||||
ee-first@1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz"
|
||||
integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=
|
||||
integrity "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
|
||||
|
||||
ejs@^3.1.6:
|
||||
version "3.1.7"
|
||||
@@ -3756,7 +3743,7 @@ emojis-list@^3.0.0:
|
||||
encodeurl@~1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz"
|
||||
integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=
|
||||
integrity "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w=="
|
||||
|
||||
enhanced-resolve@^5.9.2:
|
||||
version "5.9.3"
|
||||
@@ -3843,12 +3830,12 @@ escalade@^3.1.1:
|
||||
escape-html@~1.0.3:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz"
|
||||
integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=
|
||||
integrity "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="
|
||||
|
||||
escape-string-regexp@^1.0.5:
|
||||
version "1.0.5"
|
||||
resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz"
|
||||
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
|
||||
integrity "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg=="
|
||||
|
||||
escape-string-regexp@^2.0.0:
|
||||
version "2.0.0"
|
||||
@@ -4128,7 +4115,7 @@ esutils@^2.0.2:
|
||||
etag@~1.8.1:
|
||||
version "1.8.1"
|
||||
resolved "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz"
|
||||
integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=
|
||||
integrity "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg=="
|
||||
|
||||
eventemitter3@^4.0.0:
|
||||
version "4.0.7"
|
||||
@@ -4158,7 +4145,7 @@ execa@^5.0.0:
|
||||
exit@^0.1.2:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz"
|
||||
integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=
|
||||
integrity "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ=="
|
||||
|
||||
expect@^27.5.1:
|
||||
version "27.5.1"
|
||||
@@ -4231,7 +4218,7 @@ fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0:
|
||||
fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6:
|
||||
version "2.0.6"
|
||||
resolved "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz"
|
||||
integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=
|
||||
integrity "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw=="
|
||||
|
||||
fastq@^1.6.0:
|
||||
version "1.13.0"
|
||||
@@ -4313,7 +4300,7 @@ find-cache-dir@^3.3.1:
|
||||
find-up@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz"
|
||||
integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c=
|
||||
integrity "sha1-RdG35QbHF93UgndaK3eSCjwMV6c= sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ=="
|
||||
dependencies:
|
||||
locate-path "^2.0.0"
|
||||
|
||||
@@ -4399,7 +4386,7 @@ fraction.js@^4.2.0:
|
||||
fresh@0.5.2:
|
||||
version "0.5.2"
|
||||
resolved "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz"
|
||||
integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=
|
||||
integrity "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q=="
|
||||
|
||||
fs-extra@^10.0.0:
|
||||
version "10.1.0"
|
||||
@@ -4428,7 +4415,7 @@ fs-monkey@1.0.3:
|
||||
fs.realpath@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz"
|
||||
integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8=
|
||||
integrity "sha1-FQStJSMVjKpA20onh8sBQRmU6k8= sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="
|
||||
|
||||
fsevents@^2.3.2, fsevents@~2.3.2:
|
||||
version "2.3.2"
|
||||
@@ -4453,7 +4440,7 @@ function.prototype.name@^1.1.5:
|
||||
functional-red-black-tree@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz"
|
||||
integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=
|
||||
integrity "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g=="
|
||||
|
||||
functions-have-names@^1.2.2:
|
||||
version "1.2.3"
|
||||
@@ -4603,7 +4590,7 @@ has-bigints@^1.0.1, has-bigints@^1.0.2:
|
||||
has-flag@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz"
|
||||
integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0=
|
||||
integrity "sha1-tdRU3CGZriJWmfNGfloH87lVuv0= sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw=="
|
||||
|
||||
has-flag@^4.0.0:
|
||||
version "4.0.0"
|
||||
@@ -4649,7 +4636,7 @@ hoopy@^0.1.4:
|
||||
hpack.js@^2.1.6:
|
||||
version "2.1.6"
|
||||
resolved "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz"
|
||||
integrity sha1-h3dMCUnlE/QuhFdbPEVoH63ioLI=
|
||||
integrity "sha1-h3dMCUnlE/QuhFdbPEVoH63ioLI= sha512-zJxVehUdMGIKsRaNt7apO2Gqp0BdqW5yaiGHXXmbpvxgBYVZnAql+BJb4RO5ad2MgpbZKn5G6nMnegrH1FcNYQ=="
|
||||
dependencies:
|
||||
inherits "^2.0.1"
|
||||
obuf "^1.0.0"
|
||||
@@ -4710,7 +4697,7 @@ htmlparser2@^6.1.0:
|
||||
http-deceiver@^1.2.7:
|
||||
version "1.2.7"
|
||||
resolved "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz"
|
||||
integrity sha1-+nFolEq5pRnTN8sL7HKE3D5yPYc=
|
||||
integrity "sha1-+nFolEq5pRnTN8sL7HKE3D5yPYc= sha512-LmpOGxTfbpgtGVxJrj5k7asXHCgNZp5nLfp+hWc8QQRqtb7fUy6kRY3BO1h9ddF6yIPYUARgxGOwB42DnxIaNw=="
|
||||
|
||||
http-errors@2.0.0:
|
||||
version "2.0.0"
|
||||
@@ -4726,7 +4713,7 @@ http-errors@2.0.0:
|
||||
http-errors@~1.6.2:
|
||||
version "1.6.3"
|
||||
resolved "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz"
|
||||
integrity sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=
|
||||
integrity "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0= sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A=="
|
||||
dependencies:
|
||||
depd "~1.1.2"
|
||||
inherits "2.0.3"
|
||||
@@ -4807,7 +4794,7 @@ idb@^6.1.4:
|
||||
identity-obj-proxy@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.npmjs.org/identity-obj-proxy/-/identity-obj-proxy-3.0.0.tgz"
|
||||
integrity sha1-lNK9qWCERT7zb7xarsN+D3nx/BQ=
|
||||
integrity "sha1-lNK9qWCERT7zb7xarsN+D3nx/BQ= sha512-00n6YnVHKrinT9t0d9+5yZC6UBNJANpYEQvL2LlX6Ab9lnmxzIRcEmTPuyGScvl1+jKuCICX1Z0Ab1pPKKdikA=="
|
||||
dependencies:
|
||||
harmony-reflect "^1.4.6"
|
||||
|
||||
@@ -4840,7 +4827,7 @@ import-local@^3.0.2:
|
||||
imurmurhash@^0.1.4:
|
||||
version "0.1.4"
|
||||
resolved "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz"
|
||||
integrity sha1-khi5srkoojixPcT7a21XbyMUU+o=
|
||||
integrity "sha1-khi5srkoojixPcT7a21XbyMUU+o= sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA=="
|
||||
|
||||
indent-string@^4.0.0:
|
||||
version "4.0.0"
|
||||
@@ -4850,7 +4837,7 @@ indent-string@^4.0.0:
|
||||
inflight@^1.0.4:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz"
|
||||
integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=
|
||||
integrity "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA=="
|
||||
dependencies:
|
||||
once "^1.3.0"
|
||||
wrappy "1"
|
||||
@@ -4863,7 +4850,7 @@ inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, i
|
||||
inherits@2.0.3:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz"
|
||||
integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=
|
||||
integrity "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw=="
|
||||
|
||||
ini@^1.3.5:
|
||||
version "1.3.8"
|
||||
@@ -4892,7 +4879,7 @@ ipaddr.js@^2.0.1:
|
||||
is-arrayish@^0.2.1:
|
||||
version "0.2.1"
|
||||
resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz"
|
||||
integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=
|
||||
integrity "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg=="
|
||||
|
||||
is-bigint@^1.0.1:
|
||||
version "1.0.4"
|
||||
@@ -4943,7 +4930,7 @@ is-docker@^2.0.0, is-docker@^2.1.1:
|
||||
is-extglob@^2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz"
|
||||
integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=
|
||||
integrity "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ=="
|
||||
|
||||
is-fullwidth-code-point@^3.0.0:
|
||||
version "3.0.0"
|
||||
@@ -4965,7 +4952,7 @@ is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1:
|
||||
is-module@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz"
|
||||
integrity sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=
|
||||
integrity "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE= sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g=="
|
||||
|
||||
is-negative-zero@^2.0.2:
|
||||
version "2.0.2"
|
||||
@@ -4987,7 +4974,7 @@ is-number@^7.0.0:
|
||||
is-obj@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz"
|
||||
integrity sha1-PkcprB9f3gJc19g6iW2rn09n2w8=
|
||||
integrity "sha1-PkcprB9f3gJc19g6iW2rn09n2w8= sha512-l4RyHgRqGN4Y3+9JHVrNqO+tN0rV5My76uW5/nuO4K1b6vw5G8d/cmFjP9tRfEsdhZNt0IFdZuK/c2Vr4Nb+Qg=="
|
||||
|
||||
is-plain-obj@^3.0.0:
|
||||
version "3.0.0"
|
||||
@@ -5010,7 +4997,7 @@ is-regex@^1.1.4:
|
||||
is-regexp@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz"
|
||||
integrity sha1-/S2INUXEa6xaYz57mgnof6LLUGk=
|
||||
integrity "sha1-/S2INUXEa6xaYz57mgnof6LLUGk= sha512-7zjFAPO4/gwyQAAgRRmqeEeyIICSdmCqa3tsVHMdBzaXXRiqopZL4Cyghg/XulGWrtABTpbnYYzzIRffLkP4oA=="
|
||||
|
||||
is-root@^2.1.0:
|
||||
version "2.1.0"
|
||||
@@ -5046,7 +5033,7 @@ is-symbol@^1.0.2, is-symbol@^1.0.3:
|
||||
is-typedarray@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz"
|
||||
integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=
|
||||
integrity "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA=="
|
||||
|
||||
is-weakref@^1.0.2:
|
||||
version "1.0.2"
|
||||
@@ -5065,12 +5052,12 @@ is-wsl@^2.2.0:
|
||||
isarray@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz"
|
||||
integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=
|
||||
integrity "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ=="
|
||||
|
||||
isexe@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz"
|
||||
integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=
|
||||
integrity "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="
|
||||
|
||||
istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0:
|
||||
version "3.2.0"
|
||||
@@ -5658,7 +5645,7 @@ jsesc@^2.5.1:
|
||||
jsesc@~0.5.0:
|
||||
version "0.5.0"
|
||||
resolved "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz"
|
||||
integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=
|
||||
integrity "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA=="
|
||||
|
||||
json-parse-better-errors@^1.0.2:
|
||||
version "1.0.2"
|
||||
@@ -5688,7 +5675,7 @@ json-schema@^0.4.0:
|
||||
json-stable-stringify-without-jsonify@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz"
|
||||
integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=
|
||||
integrity "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw=="
|
||||
|
||||
json5@^1.0.1:
|
||||
version "1.0.1"
|
||||
@@ -5747,7 +5734,7 @@ language-subtag-registry@~0.3.2:
|
||||
language-tags@^1.0.5:
|
||||
version "1.0.5"
|
||||
resolved "https://registry.npmjs.org/language-tags/-/language-tags-1.0.5.tgz"
|
||||
integrity sha1-0yHbxNowuovzAk4ED6XBRmH5GTo=
|
||||
integrity "sha1-0yHbxNowuovzAk4ED6XBRmH5GTo= sha512-qJhlO9cGXi6hBGKoxEG/sKZDAHD5Hnu9Hs4WbOY3pCWXDhw0N8x1NenNzm2EnNLkLkk7J2SdxAkDSbb6ftT+UQ=="
|
||||
dependencies:
|
||||
language-subtag-registry "~0.3.2"
|
||||
|
||||
@@ -5767,7 +5754,7 @@ levn@^0.4.1:
|
||||
levn@~0.3.0:
|
||||
version "0.3.0"
|
||||
resolved "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz"
|
||||
integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=
|
||||
integrity "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA=="
|
||||
dependencies:
|
||||
prelude-ls "~1.1.2"
|
||||
type-check "~0.3.2"
|
||||
@@ -5804,7 +5791,7 @@ loader-utils@^3.2.0:
|
||||
locate-path@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz"
|
||||
integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=
|
||||
integrity "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA=="
|
||||
dependencies:
|
||||
p-locate "^2.0.0"
|
||||
path-exists "^3.0.0"
|
||||
@@ -5834,12 +5821,12 @@ locate-path@^6.0.0:
|
||||
lodash.debounce@^4.0.8:
|
||||
version "4.0.8"
|
||||
resolved "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz"
|
||||
integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168=
|
||||
integrity "sha1-gteb/zCmfEAF/9XiUVMArZyk168= sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow=="
|
||||
|
||||
lodash.memoize@^4.1.2:
|
||||
version "4.1.2"
|
||||
resolved "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz"
|
||||
integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=
|
||||
integrity "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4= sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag=="
|
||||
|
||||
lodash.merge@^4.6.2:
|
||||
version "4.6.2"
|
||||
@@ -5849,12 +5836,12 @@ lodash.merge@^4.6.2:
|
||||
lodash.sortby@^4.7.0:
|
||||
version "4.7.0"
|
||||
resolved "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz"
|
||||
integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=
|
||||
integrity "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA=="
|
||||
|
||||
lodash.uniq@^4.5.0:
|
||||
version "4.5.0"
|
||||
resolved "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz"
|
||||
integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=
|
||||
integrity "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ=="
|
||||
|
||||
lodash@^4.17.15, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.7.0:
|
||||
version "4.17.21"
|
||||
@@ -5885,7 +5872,7 @@ lru-cache@^6.0.0:
|
||||
lz-string@^1.4.4:
|
||||
version "1.4.4"
|
||||
resolved "https://registry.npmjs.org/lz-string/-/lz-string-1.4.4.tgz"
|
||||
integrity sha1-wNjq82BZ9wV5bh40SBHPTEmNOiY=
|
||||
integrity "sha1-wNjq82BZ9wV5bh40SBHPTEmNOiY= sha512-0ckx7ZHRPqb0oUm8zNr+90mtf9DQB60H1wMCjBtfi62Kl3a7JbHob6gA2bC+xRvZoOL+1hzUK8jeuEIQE8svEQ=="
|
||||
|
||||
magic-string@^0.25.0, magic-string@^0.25.7:
|
||||
version "0.25.9"
|
||||
@@ -5921,7 +5908,7 @@ mdn-data@2.0.4:
|
||||
media-typer@0.3.0:
|
||||
version "0.3.0"
|
||||
resolved "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz"
|
||||
integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=
|
||||
integrity "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ=="
|
||||
|
||||
memfs@^3.1.2, memfs@^3.4.1:
|
||||
version "3.4.1"
|
||||
@@ -5933,7 +5920,7 @@ memfs@^3.1.2, memfs@^3.4.1:
|
||||
merge-descriptors@1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz"
|
||||
integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=
|
||||
integrity "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w=="
|
||||
|
||||
merge-stream@^2.0.0:
|
||||
version "2.0.0"
|
||||
@@ -5948,7 +5935,7 @@ merge2@^1.3.0, merge2@^1.4.1:
|
||||
methods@~1.1.2:
|
||||
version "1.1.2"
|
||||
resolved "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz"
|
||||
integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=
|
||||
integrity "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w=="
|
||||
|
||||
micromatch@^4.0.2, micromatch@^4.0.4:
|
||||
version "4.0.5"
|
||||
@@ -6033,14 +6020,14 @@ mkdirp@~0.5.1:
|
||||
ms@2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz"
|
||||
integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=
|
||||
integrity "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
|
||||
|
||||
ms@2.1.2:
|
||||
ms@2.1.2, ms@^2.1.1:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz"
|
||||
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
|
||||
|
||||
ms@2.1.3, ms@^2.1.1:
|
||||
ms@2.1.3:
|
||||
version "2.1.3"
|
||||
resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz"
|
||||
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
|
||||
@@ -6061,7 +6048,7 @@ nanoid@^3.3.3:
|
||||
natural-compare@^1.4.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz"
|
||||
integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=
|
||||
integrity "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw=="
|
||||
|
||||
negotiator@0.6.3:
|
||||
version "0.6.3"
|
||||
@@ -6089,7 +6076,7 @@ node-forge@^1:
|
||||
node-int64@^0.4.0:
|
||||
version "0.4.0"
|
||||
resolved "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz"
|
||||
integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=
|
||||
integrity "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw=="
|
||||
|
||||
node-releases@^2.0.3:
|
||||
version "2.0.4"
|
||||
@@ -6104,7 +6091,7 @@ normalize-path@^3.0.0, normalize-path@~3.0.0:
|
||||
normalize-range@^0.1.2:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz"
|
||||
integrity sha1-LRDAa9/TEuqXd2laTShDlFa3WUI=
|
||||
integrity "sha1-LRDAa9/TEuqXd2laTShDlFa3WUI= sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA=="
|
||||
|
||||
normalize-url@^6.0.1:
|
||||
version "6.1.0"
|
||||
@@ -6140,7 +6127,7 @@ nwsapi@^2.2.0:
|
||||
object-assign@^4.1.1:
|
||||
version "4.1.1"
|
||||
resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz"
|
||||
integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=
|
||||
integrity "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg=="
|
||||
|
||||
object-hash@^3.0.0:
|
||||
version "3.0.0"
|
||||
@@ -6231,7 +6218,7 @@ on-headers@~1.0.2:
|
||||
once@^1.3.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz"
|
||||
integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E=
|
||||
integrity "sha1-WDsap3WWHUsROsF9nFC6753Xa9E= sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w=="
|
||||
dependencies:
|
||||
wrappy "1"
|
||||
|
||||
@@ -6299,7 +6286,7 @@ p-limit@^3.0.2:
|
||||
p-locate@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz"
|
||||
integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=
|
||||
integrity "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg=="
|
||||
dependencies:
|
||||
p-limit "^1.1.0"
|
||||
|
||||
@@ -6335,7 +6322,7 @@ p-retry@^4.5.0:
|
||||
p-try@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz"
|
||||
integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=
|
||||
integrity "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww=="
|
||||
|
||||
p-try@^2.0.0:
|
||||
version "2.2.0"
|
||||
@@ -6388,7 +6375,7 @@ pascal-case@^3.1.2:
|
||||
path-exists@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz"
|
||||
integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=
|
||||
integrity "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ=="
|
||||
|
||||
path-exists@^4.0.0:
|
||||
version "4.0.0"
|
||||
@@ -6398,7 +6385,7 @@ path-exists@^4.0.0:
|
||||
path-is-absolute@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz"
|
||||
integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18=
|
||||
integrity "sha1-F0uSaHNVNP+8es5r9TpanhtcX18= sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg=="
|
||||
|
||||
path-key@^3.0.0, path-key@^3.1.0:
|
||||
version "3.1.1"
|
||||
@@ -6413,7 +6400,7 @@ path-parse@^1.0.6, path-parse@^1.0.7:
|
||||
path-to-regexp@0.1.7:
|
||||
version "0.1.7"
|
||||
resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz"
|
||||
integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=
|
||||
integrity "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ=="
|
||||
|
||||
path-type@^4.0.0:
|
||||
version "4.0.0"
|
||||
@@ -6423,7 +6410,7 @@ path-type@^4.0.0:
|
||||
performance-now@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz"
|
||||
integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=
|
||||
integrity "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow=="
|
||||
|
||||
picocolors@^0.2.1:
|
||||
version "0.2.1"
|
||||
@@ -7000,7 +6987,7 @@ prelude-ls@^1.2.1:
|
||||
prelude-ls@~1.1.2:
|
||||
version "1.1.2"
|
||||
resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz"
|
||||
integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=
|
||||
integrity "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w=="
|
||||
|
||||
pretty-bytes@^5.3.0, pretty-bytes@^5.4.1:
|
||||
version "5.6.0"
|
||||
@@ -7084,7 +7071,7 @@ punycode@^2.1.0, punycode@^2.1.1:
|
||||
q@^1.1.2:
|
||||
version "1.5.1"
|
||||
resolved "https://registry.npmjs.org/q/-/q-1.5.1.tgz"
|
||||
integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=
|
||||
integrity "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw=="
|
||||
|
||||
qs@6.10.3:
|
||||
version "6.10.3"
|
||||
@@ -7383,7 +7370,7 @@ regjsparser@^0.8.2:
|
||||
relateurl@^0.2.7:
|
||||
version "0.2.7"
|
||||
resolved "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz"
|
||||
integrity sha1-VNvzd+UUQKypCkzSdGANP/LYiKk=
|
||||
integrity "sha1-VNvzd+UUQKypCkzSdGANP/LYiKk= sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog=="
|
||||
|
||||
renderkid@^3.0.0:
|
||||
version "3.0.0"
|
||||
@@ -7399,7 +7386,7 @@ renderkid@^3.0.0:
|
||||
require-directory@^2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz"
|
||||
integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I=
|
||||
integrity "sha1-jGStX9MNqxyXbiNE/+f3kqam30I= sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q=="
|
||||
|
||||
require-from-string@^2.0.2:
|
||||
version "2.0.2"
|
||||
@@ -7409,7 +7396,7 @@ require-from-string@^2.0.2:
|
||||
requires-port@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz"
|
||||
integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=
|
||||
integrity "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ=="
|
||||
|
||||
resolve-cwd@^3.0.0:
|
||||
version "3.0.0"
|
||||
@@ -7504,15 +7491,15 @@ run-parallel@^1.1.9:
|
||||
|
||||
run-script-os@^1.1.6:
|
||||
version "1.1.6"
|
||||
resolved "https://registry.yarnpkg.com/run-script-os/-/run-script-os-1.1.6.tgz#8b0177fb1b54c99a670f95c7fdc54f18b9c72347"
|
||||
resolved "https://registry.npmjs.org/run-script-os/-/run-script-os-1.1.6.tgz"
|
||||
integrity sha512-ql6P2LzhBTTDfzKts+Qo4H94VUKpxKDFz6QxxwaUZN0mwvi7L3lpOI7BqPCq7lgDh3XLl0dpeXwfcVIitlrYrw==
|
||||
|
||||
safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
|
||||
safe-buffer@5.1.2, safe-buffer@>=5.1.0, safe-buffer@^5.1.0, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
|
||||
version "5.1.2"
|
||||
resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz"
|
||||
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
|
||||
|
||||
safe-buffer@5.2.1, safe-buffer@>=5.1.0, safe-buffer@^5.1.0, safe-buffer@~5.2.0:
|
||||
safe-buffer@5.2.1, safe-buffer@~5.2.0:
|
||||
version "5.2.1"
|
||||
resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz"
|
||||
integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==
|
||||
@@ -7594,7 +7581,7 @@ schema-utils@^4.0.0:
|
||||
select-hose@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz"
|
||||
integrity sha1-Yl2GWPhlr0Psliv8N2o3NZpJlMo=
|
||||
integrity "sha1-Yl2GWPhlr0Psliv8N2o3NZpJlMo= sha512-mEugaLK+YfkijB4fx0e6kImuJdCIt2LxCRcbEYPqRGCs4F2ogyfZU5IAZRdjCP8JPq2AtdNoC/Dux63d9Kiryg=="
|
||||
|
||||
selfsigned@^2.0.1:
|
||||
version "2.0.1"
|
||||
@@ -7656,7 +7643,7 @@ serialize-javascript@^6.0.0:
|
||||
serve-index@^1.9.1:
|
||||
version "1.9.1"
|
||||
resolved "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz"
|
||||
integrity sha1-03aNabHn2C5c4FD/9bRTvqEqkjk=
|
||||
integrity "sha1-03aNabHn2C5c4FD/9bRTvqEqkjk= sha512-pXHfKNP4qujrtteMrSBb0rc8HJ9Ms/GrXwcUtUtD5s4ewDJI8bT3Cz2zTVRMKtri49pLx2e0Ya8ziP5Ya2pZZw=="
|
||||
dependencies:
|
||||
accepts "~1.3.4"
|
||||
batch "0.6.1"
|
||||
@@ -7824,7 +7811,7 @@ spdy@^4.0.2:
|
||||
sprintf-js@~1.0.2:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz"
|
||||
integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=
|
||||
integrity "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g=="
|
||||
|
||||
stable@^0.1.8:
|
||||
version "0.1.8"
|
||||
@@ -7851,7 +7838,7 @@ statuses@2.0.1:
|
||||
"statuses@>= 1.4.0 < 2":
|
||||
version "1.5.0"
|
||||
resolved "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz"
|
||||
integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=
|
||||
integrity "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA=="
|
||||
|
||||
string-length@^4.0.1:
|
||||
version "4.0.2"
|
||||
@@ -7955,7 +7942,7 @@ strip-ansi@^7.0.1:
|
||||
strip-bom@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz"
|
||||
integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=
|
||||
integrity "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA=="
|
||||
|
||||
strip-bom@^4.0.0:
|
||||
version "4.0.0"
|
||||
@@ -8166,7 +8153,7 @@ test-exclude@^6.0.0:
|
||||
text-table@^0.2.0:
|
||||
version "0.2.0"
|
||||
resolved "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz"
|
||||
integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=
|
||||
integrity "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw=="
|
||||
|
||||
throat@^6.0.1:
|
||||
version "6.0.1"
|
||||
@@ -8186,7 +8173,7 @@ tmpl@1.0.5:
|
||||
to-fast-properties@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz"
|
||||
integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=
|
||||
integrity "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog=="
|
||||
|
||||
to-regex-range@^5.0.1:
|
||||
version "5.0.1"
|
||||
@@ -8212,7 +8199,7 @@ tough-cookie@^4.0.0:
|
||||
tr46@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz"
|
||||
integrity sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=
|
||||
integrity "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk= sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA=="
|
||||
dependencies:
|
||||
punycode "^2.1.0"
|
||||
|
||||
@@ -8265,7 +8252,7 @@ type-check@^0.4.0, type-check@~0.4.0:
|
||||
type-check@~0.3.2:
|
||||
version "0.3.2"
|
||||
resolved "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz"
|
||||
integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=
|
||||
integrity "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg=="
|
||||
dependencies:
|
||||
prelude-ls "~1.1.2"
|
||||
|
||||
@@ -8367,12 +8354,12 @@ universalify@^2.0.0:
|
||||
unpipe@1.0.0, unpipe@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz"
|
||||
integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=
|
||||
integrity "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ=="
|
||||
|
||||
unquote@~1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.npmjs.org/unquote/-/unquote-1.1.1.tgz"
|
||||
integrity sha1-j97XMk7G6IoP+LkF58CYzcCG1UQ=
|
||||
integrity "sha1-j97XMk7G6IoP+LkF58CYzcCG1UQ= sha512-vRCqFv6UhXpWxZPyGDh/F3ZpNv8/qo7w6iufLpQg9aKnQ71qM4B5KiI7Mia9COcjEhrO9LueHpMYjYzsWH3OIg=="
|
||||
|
||||
upath@^1.2.0:
|
||||
version "1.2.0"
|
||||
@@ -8389,7 +8376,7 @@ uri-js@^4.2.2:
|
||||
util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz"
|
||||
integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=
|
||||
integrity "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
|
||||
|
||||
util.promisify@~1.0.0:
|
||||
version "1.0.1"
|
||||
@@ -8404,12 +8391,12 @@ util.promisify@~1.0.0:
|
||||
utila@~0.4:
|
||||
version "0.4.0"
|
||||
resolved "https://registry.npmjs.org/utila/-/utila-0.4.0.tgz"
|
||||
integrity sha1-ihagXURWV6Oupe7MWxKk+lN5dyw=
|
||||
integrity "sha1-ihagXURWV6Oupe7MWxKk+lN5dyw= sha512-Z0DbgELS9/L/75wZbro8xAnT50pBVFQZ+hUEueGDU5FN51YSCYM+jdxsfCiHjwNP/4LCDD0i/graKpeBnOXKRA=="
|
||||
|
||||
utils-merge@1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz"
|
||||
integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=
|
||||
integrity "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA=="
|
||||
|
||||
uuid@^8.3.2:
|
||||
version "8.3.2"
|
||||
@@ -8433,7 +8420,7 @@ v8-to-istanbul@^8.1.0:
|
||||
vary@~1.1.2:
|
||||
version "1.1.2"
|
||||
resolved "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz"
|
||||
integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=
|
||||
integrity "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg=="
|
||||
|
||||
w3c-hr-time@^1.0.2:
|
||||
version "1.0.2"
|
||||
@@ -8855,7 +8842,7 @@ wrap-ansi@^7.0.0:
|
||||
wrappy@1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz"
|
||||
integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
|
||||
integrity "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
|
||||
|
||||
write-file-atomic@^3.0.0:
|
||||
version "3.0.3"
|
||||
|
||||