Skip to content

Commit 04828e0

Browse files
committed
feat: save code
1 parent 5d51b3f commit 04828e0

File tree

1 file changed

+41
-6
lines changed

1 file changed

+41
-6
lines changed

src/App.vue

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<script setup lang="ts">
22
import Layout from "@/components/layout/Layout.vue";
33
import ErrorBoundary from "@/components/handlers/ErrorBoundary.vue";
4-
import ExtensionLoader from "@/components/extensions/ExtensionLoader.vue";
54
import { provide, shallowReactive, nextTick, defineAsyncComponent } from "vue";
65
import Router from "@/components/layout/Router.vue";
76
import {
@@ -22,7 +21,8 @@ import NonBundledClasses from "@/components/misc/NonBundledClasses.vue";
2221
import { RouteItems } from "@/constants/routes.ts";
2322
import { capitalize } from "@/lib/helpers/capitalize.ts";
2423
import { log } from "@/lib/handlers/log.ts";
25-
import { Command } from "@tauri-apps/plugin-shell";
24+
// import { Command } from "@tauri-apps/plugin-shell";
25+
// import { initializeLauncher } from "@/lib/main/initialize-launcher.ts";
2626
// import "ses";
2727
// eslint-disable-next-line unicorn/prefer-node-protocol
2828
// import { Buffer } from "buffer";
@@ -31,10 +31,14 @@ import { Command } from "@tauri-apps/plugin-shell";
3131
const LogViewer = defineAsyncComponent(
3232
() => import("@/components/logging/LogViewer.vue"),
3333
);
34+
const ExtensionLoader = defineAsyncComponent(
35+
() => import("@/components/extensions/ExtensionLoader.vue"),
36+
);
3437
38+
/*
3539
(async () => {
3640
if (!localStorage.getItem("CH0304_home.skel")) {
37-
localStorage.setItem("CH0304_home.skel", String.raw`{"SettingModel":{"version":5,"skel":"CH0304_home.skel","atlas":"CH0304_home.atlas","eyeTouch":"Touch_Me","idol":"Idle_01","x":459,"y":693,"scale":0.34,"angle":0,"bgmVolume":0.1,"talkVolume":0.45,"showTouch":false,"panelDisplay":false,"showTalkDialog":false,"textX":767,"textY":382,"textSize":16,"autoTalk":0,"resolution":"2k","startAnimation":"Start_Idle_01","startScene":true,"language":"中文"},"EventInfos":[{"BoneName":"Spine_03","Width":1500,"Height":800,"Animations":["Talk_01_M","Talk_02_M","Talk_03_M","Talk_04_M","Talk_05_M"],"AnimationIndex":10,"TextIndex":0,"ClickType":"click","EmptyAnimation":true},{"BoneName":"front hat_03b","Width":800,"Height":500,"Animations":["Pat_01_M"],"AnimationIndex":20,"TextIndex":0,"ClickType":"pointerdown","EmptyAnimation":false}],"AnimationsTexts":{"中文":{"CH0304_MemorialLobby_1_1":"……我想起了第一次拿起画笔的那天。","CH0304_MemorialLobby_1_2":"那时……我单纯地、笔直地面对着画布。","CH0304_MemorialLobby_2_1":"现在的我……已经不一样了。","CH0304_MemorialLobby_2_2":"不知道该画什么,失去了自信……","CH0304_MemorialLobby_3_1":"就在那时,老师告诉了我。","CH0304_MemorialLobby_3_2":"「名为『梦想』的魔法,早已寄宿在你的心里。」","CH0304_MemorialLobby_4_1":"只要还有梦想……接下来就不会在道路上迷失了吧。","CH0304_MemorialLobby_4_2":"老师……如果可以的话,愿意和我一起走这条路吗?","CH0304_MemorialLobby_5":"一条用五彩缤纷的梦想铺成的魔法之路!"},"日本語":{"CH0304_MemorialLobby_1_1":"……はじめて絵を描いた日を、思い出します。","CH0304_MemorialLobby_1_2":"あのときは……まっすぐ、純粋に、キャンバスと向き合っていました。","CH0304_MemorialLobby_2_1":"今の私は……違います。","CH0304_MemorialLobby_2_2":"何を描けばいいのか分からなくなって、自信を失ってしまって……。","CH0304_MemorialLobby_3_1":"そんなとき、マスターが教えてくれたんです。","CH0304_MemorialLobby_3_2":"「夢」という魔法は、もう心の中に宿ってるって。","CH0304_MemorialLobby_4_1":"夢があるなら……これからは、道に迷わずに済みそうです。","CH0304_MemorialLobby_4_2":"マスター……よければ、私と同じ道を歩みませんか?","CH0304_MemorialLobby_5":"色とりどりの夢でいっぱいの、魔法の道を!"},"English":{"CH0304_MemorialLobby_1_1":"...I remember the first day I ever picked up a brush.","CH0304_MemorialLobby_1_2":"Back then... I faced the canvas straight on, with pure heart.","CH0304_MemorialLobby_2_1":"But now... I’m not the same.","CH0304_MemorialLobby_2_2":"I no longer know what to paint, and I’ve lost my confidence...","CH0304_MemorialLobby_3_1":"At that moment, Master told me:","CH0304_MemorialLobby_3_2":"“The magic called ‘dream’ has already taken root inside your heart.”","CH0304_MemorialLobby_4_1":"As long as I have that dream... I won’t lose my way anymore.","CH0304_MemorialLobby_4_2":"Master... if you’d like, would you walk this same path with me?","CH0304_MemorialLobby_5":"A magical road paved with countless, colorful dreams!"},"Tiếng Việt":{"CH0304_MemorialLobby_1_1":".....Em vẫn nhớ ngày đầu tiên, mình bắt đầu vẽ tranh.","CH0304_MemorialLobby_1_2":"Lúc đó.. Em đối diện với khuôn canvas... \nTheo cách chân thành và thuần khiết nhất.","CH0304_MemorialLobby_2_1":"Còn em bây giờ... khác nhiều rồi.","CH0304_MemorialLobby_2_2":"Khi cầm cọ lên, em không biết nên vẽ gì nữa. \nEm mất tự tin về chính bản thân mình.","CH0304_MemorialLobby_3_1":"Và chính khi ấy, \nMaster lại dạy cho em một bài học","CH0304_MemorialLobby_3_2":"“Về phép màu mang tên ''Giấc mơ''.. \nVẫn luôn trú ngụ trong trái tim chúng ta ấy.”","CH0304_MemorialLobby_4_1":"Miễn còn có Giấc mơ... Thì từ giờ trở đi... \nEm không phải lo mình lạc lối nữa.","CH0304_MemorialLobby_4_2":"Master... Nếu người không ngại thì... Hãy cùng em đi chung một lối nhé?","CH0304_MemorialLobby_5":"Trên con đường ma thuật, Ngập tràn những giấc mơ muôn màu!"}}}`);
41+
localStorage.setItem("CH0304_home.skel", String.raw`{"SettingModel":{"version":5,"skel":"CH0304_home.skel","atlas":"CH0304_home.atlas","eyeTouch":"Touch_Me","idol":"Idle_01","x":459,"y":693,"scale":0.34,"angle":0,"bgmVolume":0.1,"talkVolume":0.45,"showTouch":false,"panelDisplay":false,"showTalkDialog":false,"textX":767,"textY":382,"textSize":16,"autoTalk":0,"resolution":"2k","startAnimation":"Start_Idle_01","startScene":true,"language":"中文"},"EventInfos":[{"BoneName":"Spine_03","Width":1500,"Height":800,"Animations":["Talk_01_M","Talk_02_M","Talk_03_M","Talk_04_M","Talk_05_M"],"AnimationIndex":10,"TextIndex":0,"ClickType":"click","EmptyAnimation":true},{"BoneName":"front hat_03b","Width":800,"Height":500,"Animations":["Pat_01_M"],"AnimationIndex":20,"TextIndex":0,"ClickType":"pointerdown","EmptyAnimation":false}],"AnimationsTexts":{"中文":{"CH0304_MemorialLobby_1_1":"……我想起了第一次拿起画笔的那天。","CH0304_MemorialLobby_1_2":"那时……我单纯地、笔直地面对着画布。","CH0304_MemorialLobby_2_1":"现在的我……已经不一样了。","CH0304_MemorialLobby_2_2":"不知道该画什么,失去了自信……","CH0304_MemorialLobby_3_1":"就在那时,老师告诉了我。","CH0304_MemorialLobby_3_2":"「名为『梦想』的魔法,早已寄宿在你的心里。」","CH0304_MemorialLobby_4_1":"只要还有梦想……接下来就不会在道路上迷失了吧。","CH0304_MemorialLobby_4_2":"老师……如果可以的话,愿意和我一起走这条路吗?","CH0304_MemorialLobby_5":"一条用五彩缤纷的梦想铺成的魔法之路!"},"日本語":{"CH0304_MemorialLobby_1_1":"……はじめて絵を描いた日を、思い出します。","CH0304_MemorialLobby_1_2":"あのときは……まっすぐ、純粋に、キャンバスと向き合っていました。","CH0304_MemorialLobby_2_1":"今の私は……違います。","CH0304_MemorialLobby_2_2":"何を描けばいいのか分からなくなって、自信を失ってしまって……。","CH0304_MemorialLobby_3_1":"そんなとき、マスターが教えてくれたんです。","CH0304_MemorialLobby_3_2":"「夢」という魔法は、もう心の中に宿ってるって。","CH0304_MemorialLobby_4_1":"夢があるなら……これからは、道に迷わずに済みそうです。","CH0304_MemorialLobby_4_2":"マスター……よければ、私と同じ道を歩みませんか?","CH0304_MemorialLobby_5":"色とりどりの夢でいっぱいの、魔法の道を!"},"English":{"CH0304_MemorialLobby_1_1":"...I remember the first day I ever picked up a brush.","CH0304_MemorialLobby_1_2":"Back then... I faced the canvas straight on, with pure heart.","CH0304_MemorialLobby_2_1":"But now... I’m not the same.","CH0304_MemorialLobby_2_2":"I no longer know what to paint, and I’ve lost my confidence...","CH0304_MemorialLobby_3_1":"At that moment, Master told me:","CH0304_MemorialLobby_3_2":"“The magic called ‘dream’ has already taken root inside your heart.”","CH0304_MemorialLobby_4_1":"As long as I have that dream... I won’t lose my way anymore.","CH0304_MemorialLobby_4_2":"Master... if you’d like, would you walk this same path with me?","CH0304_MemorialLobby_5":"A magical road paved with countless, colorful dreams!"},"Tiếng Việt":{"CH0304_MemorialLobby_1_1":".....Em vẫn nhớ ngày đầu tiên, mình bắt đầu vẽ tranh.","CH0304_MemorialLobby_1_2":"Lúc đó.. Em đối diện với khuôn canvas... \nTheo cách chân thành và thuần khiết nhất.","CH0304_MemorialLobby_2_1":"Còn em bây giờ... khác nhiều rồi.","CH0304_MemorialLobby_2_2":"Khi cầm cọ lên, em không biết nên vẽ gì nữa. \nEm mất tự tin về chính bản thân mình.","CH0304_MemorialLobby_3_1":"Và chính khi ấy, \nMaster lại dạy cho em một bài học","CH0304_MemorialLobby_3_2":"“Về phép màu mang tên ''Giấc mơ''.. \nVẫn luôn trú ngụ trong trái tim chúng ta ấy.”","CH0304_MemorialLobby_4_1":"Miễn còn có Giấc mơ... Thì từ giờ trở đi... \nEm không phải lo mình lạc l4_MemorialLobby_4_2":"Master... Nếu người không ngại thì... Hãy cùng em đi chung một lối nhé?","Cối nữa.","CH030H0304_MemorialLobby_5":"Trên con đường ma thuật, Ngập tràn những giấc mơ muôn màu!"}}}`);
3842
}
3943
4044
const url = "./assets/index-CQUR_vLf.js";
@@ -48,7 +52,11 @@ const LogViewer = defineAsyncComponent(
4852
"--version",
4953
]).execute();
5054
51-
console.log(result, /* () => _cleaned */);
55+
*/
56+
57+
// console.log(result, /* () => _cleaned */);
58+
59+
/*
5260
5361
// const realm = new ShadowRealm;
5462
@@ -71,6 +79,7 @@ const LogViewer = defineAsyncComponent(
7179
7280
// window.Buffer = Buffer;
7381
82+
*/
7483
/*
7584
const _temporary: object = {};
7685
@@ -179,6 +188,7 @@ const LogViewer = defineAsyncComponent(
179188
"__options__": true,
180189
});
181190
*/
191+
/*
182192
const t2 = performance.now();
183193
184194
console.log("Action: Running the contained code");
@@ -189,9 +199,34 @@ const LogViewer = defineAsyncComponent(
189199
console.error("Error in the container:", error);
190200
}
191201
202+
log.debug("Initializing launcher");
203+
await initializeLauncher().catch((error: unknown) => {
204+
log.error("Failed to initialize launcher:", JSON.stringify(error));
205+
});
206+
192207
const t3 = performance.now();
193-
console.log("Locking down & hardening done in", t2 - t1, "ms\n", "Evaluation done in", t3 - t2, "ms");
208+
console.log("Locking down & hardening done in", t2 - t1, "ms\n", "Secure ECMAScript evaluation done in", t3 - t2, "ms");
209+
210+
// const __invoke = window.__TAURI_INTERNALS__.invoke.bind(window.__TAURI_INTERNALS__); // or `{}`?
211+
// console.log(window.__TAURI_INTERNALS__);
212+
213+
// window.__TAURI_INTERNALS__.invoke = (): void => {};
214+
215+
console.log("Evaluating...");
216+
log.debug("Evaluating...");
217+
(new Function(`
218+
console.log(window.__TAURI_INTERNALS__);
219+
window.__TAURI_INTERNALS__.invoke("plugin:log|log", {
220+
level: 4,
221+
message: 'Wow!',
222+
location: '',
223+
file: '',
224+
line: 1,
225+
keyValues: { "": "" }
226+
})
227+
`))();
194228
})();
229+
*/
195230
196231
const globalStates = shallowReactive<GlobalStatesType>({
197232
"customLayout": false,
@@ -275,7 +310,7 @@ window[ApplicationNamespace].functions.changeGlobalStates = changeGlobalState;
275310
<!-- Extensions-level error boundary -->
276311
<ErrorBoundary>
277312
<template #default>
278-
<ExtensionLoader />
313+
<ExtensionLoader v-if="false" />
279314
</template>
280315

281316
<!-- In case of an error, show this template -->

0 commit comments

Comments
 (0)