Coder Social home page Coder Social logo

ark-unpacker's Introduction

Ark-Unpacker

ArkUnpacker icon

Arknights Assets Unpacker | 明日方舟游戏资源批量解包器
v3.1

GitHub Top Language GitHub License GitHub Actions

This project only supports Chinese docs. If you are an English user, feel free to contact us.

介绍 Intro

实现的功能

  1. 批量解包《明日方舟》Unity AssetBundle(AB) 文件中的游戏资源对象。
    1. 解包时可对基建小人、动态立绘和战斗小人的 Spine 模型文件进行区分;
    2. 解包时可以将文件按源 AB 文件的名称分目录存放。
  2. 批量合并 RGB 通道图和 Alpha 通道图。
  3. 批量解码 FlatBuffers 数据文件。
  4. 既提供交互式命令行界面进行操作,也支持直接通过命令行运行。

支持的类型

Unity类型 描述 导出格式
Sprite 精灵图 PNG图片
Texture2D 二维纹理图 PNG图片
AudioClip 音频剪辑 WAV音频
TextAsset 文本或字节数据 未指定

相关文档

使用方法 Usage

1.资源准备

无论您是想要使用我们的发行版本还是源代码来解包明日方舟的游戏资源,您都需要先获取到明日方舟的资源文件。明日方舟是基于Unity开发的游戏,它的游戏资源会全部打包到一种 AssetBundle文件(后缀名 .ab,下简称“AB文件”)中。

下面将以 Android 安卓系统 为例讲述如何获取到明日方舟的 AB 文件。明日方舟的游戏资源有 2 个部分

  • 一部分是通过安装包.apk)提供的,从明日方舟官网将其下载到本地后,使用压缩文件查看工具打开(后缀名改成 .zip 后打开),然后把里面的 assets\AB\Android 文件夹解压出来;
  • 另一部分是通过热更新提供的,首先确保您的安卓手机上的明日方舟更新到了最新版本,然后(推荐使用 USB 数据线)将手机存储的 Android\data\com.hypergryph.arknights\files\AB\Android 文件夹(一般情况下是这个路径)复制到电脑上(重命名为 Android(2))。至此,我们的目录结构大致如下:

你的目录
├─Android
└─Android(2)

最后,将 Android(2) 文件夹里的内容复制到 Android 中,并覆盖同名文件,就能得到完整的游戏资源。在这之后,您就可以使用我们的程序来解包其中的游戏资源了。

当然,您也可以将 Android 里的部分文件夹复制出来进行处理,以解包特定的资源。为了便于您找到特定资源的 AB 文件位置,我们整理并列出了各个子目录储存的资源的内容,浏览此文档以查看详情。

2.下载ArkUnpacker

为了方便一般用户使用,我们推出了适用于 Windows 64位操作系统(暂不支持其他操作系统)的可执行文件。

请进入 Releases 页面下载 exe 文件 ArkUnpacker-vx.x.x_x64.exe前往下载

3.必备知识

在正式地使用本程序前,您最好对以下内容有初步了解:

4.示例用法

首先,将需要解包的文件夹(可以是多个)放到与 exe 相同的目录下,至此,我们的目录结构大致如下:

你的目录
├─Android (解包整个目录需要很久)
├─charpack (可以选择解包部分文件夹)
└─ArkUnpacker.exe

然后运行 exe,弹出交互式命令行界面如下,依据其提示操作即可:

欢迎使用ArkUnpacker
模式选择:
1: 一键执行
2: 自定义资源解包
3: 自定义图片合并
4: FlatBuffers数据解码
5: ArkModels提取与分拣工具
0: 退出
输入序号后按回车即可,如果您不清楚以上功能的含义,强烈建议您先阅读使用手册(README)

各模式的功能概述如下:

  • “一键执行” 模式下,解包出的文件默认放置在 Unpacked_xxxx 文件夹中,合并完成的图片默认放置在 Combined_xxxx 文件夹中。
  • 若您选择 “自定义资源解包” 或 “自定义图片合并”,还可以自定义需要解包的文件类型和保存位置等内容。
  • 关于 “FlatBuffers数据解码”,请参阅此文档了解详情。
  • 关于 “ArkModels提取与分拣工具”,请参阅此文档了解详情。

此外,运行程序后,工作目录会生成配置文件 ArkUnpackerConfig.json 与日志文件 ArkUnpackerLogs.log。有关配置文件的字段说明,请参阅此文档了解详情。

5.命令行用法

除了上述示例用法展示的交互式命令行界面外,程序还支持直接通过命令行来运行,以便熟悉命令行调用的用户使用。相关参数如下:

usage: ArkUnpacker [-h] [-v] [-m {ab,cb,fb}] [-i INPUT] [-o OUTPUT] [-d] [--image] [--text] [--audio] [--spine] [-g] [-l {0,1,2,3,4}]
  
Arknights Assets Unpacker. Use no argument to run to enter the interactive CLI mode.

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show a version message and exit
  -m {ab,cb,fb}, --mode {ab,cb,fb}
                        working mode, ab=resolve-ab, cb=combine-image, fb=decode-flatbuffers
  -i INPUT, --input INPUT
                        source file or directory path
  -o OUTPUT, --output OUTPUT
                        destination directory path
  -d, -delete           delete the existed destination directory first
  --image               in resolve ab mode: export image files
  --text                in resolve ab mode: export text or binary files
  --audio               in resolve ab mode: export audio files
  --spine               in resolve ab mode: export spine asset files
  -g, --group           in resolve ab mode: group files into separate directories named by their source ab file
  -l {0,1,2,3,4}, --logging-level {0,1,2,3,4}
                        logging level, 0=none, 1=error, 2=warn, 3=info, 4=debug

运行 ArkUnpacker -h 命令可以显示此帮助信息。如果您使用的命令不带任何参数,那么程序会以交互式命令行界面的模式启动。

注意事项 Notice

  1. 使用一键执行模式时,不会解包直接位于程序所在目录中的 AB 文件,只会解包子文件夹里的 AB 文件。
  2. 程序会根据设备 CPU 核心数自动调整多线程策略,并且对设备性能(尤其是 CPU 和硬盘性能)有一定要求,配置过低的电脑在运行时可能会缓慢。
  3. Windows 命令行基本常识:
    1. 快捷键 Ctrl+C 用于强行终止程序,若想复制文本,请用鼠标选取文本后再按此快捷键。
    2. 左键单击小黑窗会进入“文本选取”模式,此时主程序会暂停执行。
    3. 右键单击小黑窗可以粘贴文本,也可用于退出“文本选取”模式。
    4. 拖放文件到小黑窗可以快速粘贴其路径。
  4. 如果您希望了解更多细节或参与贡献,请查看开发者指引

许可证 Licensing

本项目基于 BSD-3 开源协议。任何人都可以自由地使用和修改项目内的源代码,前提是要在源代码或版权声明中保留作者说明和原有协议,且不可以使用本项目名称或作者名称进行宣传推广。

ark-unpacker's People

Contributors

isharryh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ark-unpacker's Issues

[Question] 现版本无法处理敌人数据

于 2023年8月8日 使用明日方舟最新版本解包,无法在 battle 文件夹下找到正确的敌人Spine素材。
请问可以提供可执行解包的旧版APK,或者更新资源位置文档么?
如果可以的话感激不尽!

[Enhancement] Repack AB files from extracted files

Hello,

Thank you for your tool that allows me to get the AB files already extracted!

Do you think in the future also do the opposite? I mean be able to recreate the AB file from the extracted file?

Thanks in advance,
Best regards,
Nyantasan59

[Bug] Identical enemy model textures are combined incorrectly

In Arknights for whatever reason, some enemies have the same filenames for their spine images such as enemy_1027_mob and enemy_1027_mob_2. For your project, these images appear separately in the unpacked folder. But when the transparency is applied, the project seems to only use the first one. Could you make it so all the images are processed?

I cant read Python or Chinese very well, but my first guess would be that it's because the alpha image is named "enemy_1027_mob[alpha]_#0" instead of "enemy_1027_mob_#0[alpha]".

Example:
Unpacked folder (red shirt guy is here)
image
Combined folder (red shirt guy is missing)
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.