java - 打包和解包 *.obb 文件

标签 java android

美好的一天!

假设我有一个名为 test 的目录。它包含几个目录和文件。 (dir_1:file_1,file_2;dir_2:file_1,file_2;...;dir_5:file_1,file_2;)

我愿意 jobb -d ./test -k key -o data.obb -pn com.example.obbtest -pv 1

得到

Slop: 0   Directory Overhead: 0
Slop: 37185   Directory Overhead: 2880
Partial Sector [32] writing to sector: 199
Partial Sector [32] writing to sector: 199
Partial Sector [32] writing to sector: 199
Partial Sector [96] writing to sector: 231
Alignment off writing to sector: 231
Partial Sector [96] writing to sector: 231
Alignment off writing to sector: 231
Partial Sector [96] writing to sector: 199
Partial Sector [96] writing to sector: 235
Alignment off writing to sector: 235
Partial Sector [96] writing to sector: 235
Alignment off writing to sector: 235
Partial Sector [160] writing to sector: 231
Alignment off writing to sector: 231
Partial Sector [307] writing to sector: 8911
Partial Sector [176] writing to sector: 17075
Partial Sector [96] writing to sector: 17079
Alignment off writing to sector: 17079
Partial Sector [320] writing to sector: 235
Alignment off writing to sector: 235
Partial Sector [96] writing to sector: 17079
Alignment off writing to sector: 17079
Partial Sector [224] writing to sector: 231
Alignment off writing to sector: 231
Partial Sector [307] writing to sector: 25755
Partial Sector [191] writing to sector: 33919
Partial Sector [96] writing to sector: 33923
Alignment off writing to sector: 33923
Partial Sector [320] writing to sector: 235
Alignment off writing to sector: 235
Partial Sector [320] writing to sector: 17079
Alignment off writing to sector: 17079
//and so on

文件已准备就绪。 比,如

http://developer.android.com/tools/help/jobb.html

我愿意

jobb -d ./dotest/ -o data.obb -k key -pn com.example.obbtest -pv 1

并得到:

Slop: 0   Directory Overhead: 0
Slop: 0   Directory Overhead: 0
Java.io.IOException: boot sector says there are 0 sectors per FAT
at de.waldheinz.fs.fat.Fat.<init>(Fat.java:112)
at de.waldheinz.fs.fat.Fat.create(Fat.java:96)
at de.waldheinz.fs.fat.SuperFloppyFormatter.format(SuperFloppyFormatter.java:236)
at com.android.jobb.Main.main(Main.java:414)

我想这意味着我没有包装错误。 我该如何解决?

更新

我愿意 jobb -d ./test/-o my-app-assets.obb -pn com.examlpe.obbtest -pv 1 -k 11111111

很好

比 jobb -dump my-app-assets.obb -d ./undo/-k 11111111

然后我得到了我的文件。但是 - 它们都小于 1 mb。如果我添加大于 1 mb 的文件,我会得到

 Package Name: com.example.obbtest 
Package Version: 1
SALT: -5c0a03daa17137e2

6fbd61c113679c5258231a5439459dd5
LFN = file1 (3rd copy).jpg / SFN = ShortName [?

                                     |/ifl -- 12 3f b 16 18 7c 10 2f 69 66 6c ]
Partial read from sector: 179
Exception in thread "main" java.nio.BufferOverflowException
at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:189)
at java.nio.ByteBuffer.put(ByteBuffer.java:859)
at  com.android.jobb.EncryptedBlockFile$    
   EncryptedBlockFileChannel.readDecryptedSector(EncryptedBlockFile.java:292)
at com.android.jobb.EncryptedBlockFile$EncryptedBlockFileChannel. 
   read(EncryptedBlockFile.java:142)
at de.waldheinz.fs.util.FileDisk.read(FileDisk.java:118)
at de.waldheinz.fs.fat.ClusterChain.readData(ClusterChain.java:225)
at de.waldheinz.fs.fat.FatFile.read(FatFile.java:126)
at com.android.jobb.Main.dumpDirectory(Main.java:137)
at com.android.jobb.Main.main(Main.java:315)

最佳答案

我不能说出你所有的错误,但知道相对路径导致 boot sector says there are 0 sectors per FAT 对我来说。使用 C:\fullpath\dotest\ 有效。

关于java - 打包和解包 *.obb 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27638969/

相关文章:

javascript - 在脚本中使用 ZipFile java 类读取 zip 文件内容

android - 设置 Recycler View 可见行计数最多 3 个项目,即使它有更多项目

Android Facebook SDK 4.5.0 登录-注销问题无效 key 哈希错误,同时尝试再次登录

php - android 用户名密码通过json发送到php-->sql

java - 如何使用 android java 创建 facebook 相册并将照片上传到 facebook 相册?

java - 需要从 Struts2 迭代器内部访问我的操作类中的 HashMap

java - 对嵌套 JNA 结构对象进行单元测试时出现意外错误

java - 读取 Longs 和 Strings 格式的文件

android - 如何在 gradle 中启用弃用方法警告

java - 将对象转换为未知数据类型