mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-06-28 14:44:15 +00:00
fix: copy mii.js and edit it
This commit is contained in:
parent
75e2444541
commit
fae79e67af
8 changed files with 678 additions and 15 deletions
|
|
@ -3,7 +3,6 @@ import path from "path";
|
|||
import sharp from "sharp";
|
||||
|
||||
import { AES_CCM } from "@trafficlunar/asmcrypto.js";
|
||||
import Mii from "@pretendonetwork/mii-js";
|
||||
import qrcode from "qrcode-generator";
|
||||
|
||||
import { auth } from "@/lib/auth";
|
||||
|
|
@ -11,6 +10,8 @@ import { prisma } from "@/lib/prisma";
|
|||
import { MII_DECRYPTION_KEY } from "@/lib/constants";
|
||||
import { nameSchema, tagsSchema } from "@/lib/schemas";
|
||||
|
||||
import Mii from "@/utils/mii.js/mii";
|
||||
|
||||
const uploadsDirectory = path.join(process.cwd(), "public", "uploads");
|
||||
|
||||
export async function POST(request: Request) {
|
||||
|
|
@ -32,7 +33,8 @@ export async function POST(request: Request) {
|
|||
|
||||
const qrBytes = new Uint8Array(qrBytesRaw);
|
||||
|
||||
// Decrypt the QR code
|
||||
// Decrypt the Mii part of the QR code
|
||||
// (Credits to kazuki-4ys)
|
||||
const nonce = qrBytes.subarray(0, 8);
|
||||
const content = qrBytes.subarray(8, 0x70);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue