Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
MDPro3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
FSJK fsjk
MDPro3
Commits
b4ccb87f
Commit
b4ccb87f
authored
Apr 19, 2025
by
SherryChaos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iOS do not support WWW
parent
508547c4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
125 additions
and
44 deletions
+125
-44
Assets/Scripts/MDPro3/Boot.cs
Assets/Scripts/MDPro3/Boot.cs
+50
-44
Tools/Android2Linux.py
Tools/Android2Linux.py
+75
-0
No files found.
Assets/Scripts/MDPro3/Boot.cs
View file @
b4ccb87f
...
@@ -8,6 +8,7 @@ using System.Collections;
...
@@ -8,6 +8,7 @@ using System.Collections;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
UnityEngine.AddressableAssets
;
using
UnityEngine.AddressableAssets
;
using
UnityEngine.ResourceManagement.ResourceProviders
;
using
UnityEngine.ResourceManagement.ResourceProviders
;
using
UnityEngine.Networking
;
namespace
MDPro3
namespace
MDPro3
{
{
...
@@ -128,27 +129,34 @@ namespace MDPro3
...
@@ -128,27 +129,34 @@ namespace MDPro3
nowNum
=
0
;
nowNum
=
0
;
totalNum
=
0
;
totalNum
=
0
;
string
filePath
=
Application
.
streamingAssetsPath
+
Program
.
slash
+
type
+
".zip"
;
string
filePath
=
Path
.
Combine
(
"file://"
+
Application
.
streamingAssetsPath
,
type
+
".zip"
);
var
www
=
new
WWW
(
filePath
);
using
UnityWebRequest
request
=
UnityWebRequest
.
Get
(
filePath
);
while
(!
www
.
isDone
)
request
.
SendWebRequest
();
while
(!
request
.
isDone
)
{
{
float
progress
=
Mathf
.
Clamp01
(
www
.
p
rogress
/
0.9f
);
float
progress
=
Mathf
.
Clamp01
(
request
.
downloadP
rogress
/
0.9f
);
progressBar
.
value
=
progress
;
progressBar
.
value
=
progress
;
yield
return
null
;
yield
return
null
;
}
}
if
(
request
.
result
==
UnityWebRequest
.
Result
.
Success
)
{
byte
[]
bytes
=
request
.
downloadHandler
.
data
;
title
=
InterString
.
Get
(
"正在解压[?]"
,
type
+
".zip"
);
title
=
InterString
.
Get
(
"正在解压[?]"
,
type
+
".zip"
);
byte
[]
bytes
=
www
.
bytes
;
string
outPath
=
""
;
var
outPath
=
""
;
if
(
type
.
Contains
(
"_"
))
if
(
type
.
Contains
(
"_"
))
outPath
=
type
.
Split
(
'_'
)[
0
];
outPath
=
type
.
Split
(
'_'
)[
0
];
if
(
outPath
.
Length
>
0
&&
!
Directory
.
Exists
(
outPath
))
if
(
outPath
.
Length
>
0
&&
!
Directory
.
Exists
(
outPath
))
Directory
.
CreateDirectory
(
outPath
);
Directory
.
CreateDirectory
(
outPath
);
IEnumerator
enumerator
=
ExtractZipFile
(
bytes
,
outPath
);
StartCoroutine
(
enumerator
);
IEnumerator
extractEnumerator
=
ExtractZipFile
(
bytes
,
outPath
);
while
(
enumerator
.
MoveNext
())
while
(
extractEnumerator
.
MoveNext
())
{
yield
return
extractEnumerator
.
Current
;
yield
return
enumerator
.
Current
;
}
}
else
title
=
$"Decompression failed:
{
request
.
error
}
"
;
}
}
IEnumerator
LoadMainSceneAsync
()
IEnumerator
LoadMainSceneAsync
()
...
@@ -200,8 +208,7 @@ namespace MDPro3
...
@@ -200,8 +208,7 @@ namespace MDPro3
IEnumerator
ExtractZipFile
(
byte
[]
data
,
string
outFolder
)
IEnumerator
ExtractZipFile
(
byte
[]
data
,
string
outFolder
)
{
{
ZipFile
zf
=
null
;
ZipFile
zf
=
null
;
using
(
MemoryStream
mstrm
=
new
MemoryStream
(
data
))
using
MemoryStream
mstrm
=
new
(
data
);
{
zf
=
new
ZipFile
(
mstrm
);
zf
=
new
ZipFile
(
mstrm
);
int
count
=
0
;
int
count
=
0
;
foreach
(
ZipEntry
zipEntry
in
zf
)
foreach
(
ZipEntry
zipEntry
in
zf
)
...
@@ -235,7 +242,6 @@ namespace MDPro3
...
@@ -235,7 +242,6 @@ namespace MDPro3
zf
.
Close
();
zf
.
Close
();
}
}
}
}
}
bool
VersionCheck
()
bool
VersionCheck
()
{
{
...
...
Tools/Android2Linux.py
0 → 100644
View file @
b4ccb87f
import
os
def
process_files
(
input_folder
,
output_folder
):
# 定义目标字节序列 A 和替换规则
target_sequence
=
bytes
([
0x32
,
0x30
,
0x32
,
0x32
,
0x2E
,
0x33
,
0x2E
,
0x31
,
0x35
,
0x66
,
0x31
])
replacement_byte
=
0x18
# 创建 log 文件
log_file_path
=
os
.
path
.
join
(
output_folder
,
"log.txt"
)
with
open
(
log_file_path
,
"w"
)
as
log_file
:
log_file
.
write
(
"Files without target sequence or insufficient length:
\n
"
)
# 遍历输入文件夹中的所有文件
for
root
,
_
,
files
in
os
.
walk
(
input_folder
):
for
file
in
files
:
input_file_path
=
os
.
path
.
join
(
root
,
file
)
relative_path
=
os
.
path
.
relpath
(
input_file_path
,
input_folder
)
output_file_path
=
os
.
path
.
join
(
output_folder
,
relative_path
)
# 确保输出文件夹存在
os
.
makedirs
(
os
.
path
.
dirname
(
output_file_path
),
exist_ok
=
True
)
try
:
# 读取文件内容
with
open
(
input_file_path
,
"rb"
)
as
f
:
content
=
f
.
read
()
# 查找第一次和第二次出现的序列 A 的位置
first_index
=
content
.
find
(
target_sequence
)
if
first_index
!=
-
1
:
second_index
=
content
.
find
(
target_sequence
,
first_index
+
len
(
target_sequence
))
else
:
second_index
=
-
1
if
second_index
!=
-
1
:
# 计算需要修改的位置(第二次序列 A 后两个字节的第二个字节)
modify_position
=
second_index
+
len
(
target_sequence
)
+
1
# 跳过第一个字节
# 检查是否有足够的长度进行修改
if
modify_position
<
len
(
content
):
modified_content
=
bytearray
(
content
)
modified_content
[
modify_position
]
=
replacement_byte
# 替换第二个字节
# 写入修改后的内容到输出文件
with
open
(
output_file_path
,
"wb"
)
as
f
:
f
.
write
(
modified_content
)
else
:
# 如果文件长度不足,记录到日志中
with
open
(
log_file_path
,
"a"
)
as
log_file
:
log_file
.
write
(
f
"{input_file_path} (insufficient length after second sequence)
\n
"
)
else
:
# 如果未找到两次序列 A,记录到日志中
with
open
(
log_file_path
,
"a"
)
as
log_file
:
log_file
.
write
(
f
"{input_file_path}
\n
"
)
except
Exception
as
e
:
print
(
f
"Error processing file: {input_file_path} ({e})"
)
print
(
"Processing complete. Log of files without the target sequence written to:"
,
log_file_path
)
if
__name__
==
"__main__"
:
# 设置输入和输出文件夹路径
input_folder
=
input
(
"请输入输入文件夹路径: "
)
.
strip
()
output_folder
=
input
(
"请输入输出文件夹路径: "
)
.
strip
()
# 检查输入文件夹是否存在
if
not
os
.
path
.
isdir
(
input_folder
):
print
(
f
"输入文件夹不存在: {input_folder}"
)
else
:
# 创建输出文件夹(如果不存在)
os
.
makedirs
(
output_folder
,
exist_ok
=
True
)
# 开始处理文件
process_files
(
input_folder
,
output_folder
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment