Using jobb tool in Android

匆匆过客 提交于 2019-12-30 04:22:19

问题


I am running the following command to get my encrypted obb file for apk expansion.

jobb -d /home/manoj/Desktop/Test -o main.1.com.example.helloworld.obb -k "manoj" -pn com.example.helloworld -pv 1

I am getting following exception. Please tell what went wrong.

Slop: 0   Directory Overhead: 0
Slop: 1132   Directory Overhead: 768
Partial Sector [32] writing to sector: 15
Partial Sector [32] writing to sector: 15
Partial Sector [32] writing to sector: 15
Partial Sector [331] writing to sector: 223
Partial Sector [417] writing to sector: 400
Partial Sector [406] writing to sector: 577
Partial Sector [333] writing to sector: 754
Partial Sector [223] writing to sector: 931
java.io.IOException: FAT Full (1676, 1677)
at de.waldheinz.fs.fat.Fat.allocNew(Fat.java:298)
at de.waldheinz.fs.fat.Fat.allocAppend(Fat.java:376)
at de.waldheinz.fs.fat.Fat.allocNew(Fat.java:353)
at de.waldheinz.fs.fat.ClusterChain.setChainLength(ClusterChain.java:164)
at de.waldheinz.fs.fat.ClusterChain.setSize(ClusterChain.java:132)
at de.waldheinz.fs.fat.FatFile.setLength(FatFile.java:91)
at de.waldheinz.fs.fat.FatFile.write(FatFile.java:154)
at com.android.jobb.Main$1.processFile(Main.java:495)
at com.android.jobb.Main.processAllFiles(Main.java:604)
at com.android.jobb.Main.processAllFiles(Main.java:600)
at com.android.jobb.Main.main(Main.java:417)
Exception in thread "main" java.lang.RuntimeException: Error getting/writing file with           name: main.1.com.example.helloworld.obb
at com.android.jobb.Main$1.processFile(Main.java:501)
at com.android.jobb.Main.processAllFiles(Main.java:604)
at com.android.jobb.Main.processAllFiles(Main.java:600)
at com.android.jobb.Main.main(Main.java:417)

回答1:


You can also get following error with the jobb-Tool (at least in windows with the jobb.bat), if you have many many files.

de.waldheinz.fs.fat.Directory Full Exception: directory is full

This is, because the obb file format is saved in FAT16, whitch only allows 512 entries/files in the root directory

On Windows: if you have a folder "data" whith lost of pictures, and copied to the android sdk-tools directory

  • data/1.jpg
  • data/2.jpg
  • data/3.jpg
  • data/...
  • data/5000.jpg

and you use

console>>>jobb -pn my.package.name -pv VERSIONCODE -d ./data -k obb_password
-o main.VERSIONCODE.my.package.name.obb

you will get the mentioned error. Try to add one directory-hierarchy and make the "data"-directory to a subfolder

  • root/data/1.jpg
  • root/data/2.jpg
  • root/data/3.jpg
  • root/data/...
  • root/data/5000.jpg

use

console>>>jobb -pn my.package.name -pv VERSIONCODE -d ./root -k obb_password 
-o main.VERSIONCODE.my.package.name.obb

you have to keep in mind, that if you want to read from the obb later, that the pictures are now in a subfolder.




回答2:


In addition to what Ix222 said about FAT16 limiting the number of files in the root directory, there's also an issue in the jobb tool itself, and the FAT library it uses.

In the FAT library it is determining the maximum filesystem size for FAT12 to be 4 MB, FAT16 at 512 MB and using FAT32 for anything beyond that. In reality FAT12 allows up to 16 MB (32 MB in some implementations) and FAT16 allows up to 2 GB. This is the reason that if your OBB size using the current tool is limited to the range 4 MB <= OBB size < 512 MB.

The jobb tool is also wrongly relying on the FAT library to determine the filesystem, but it is only compatible with FAT16.

A quick fix is to build your own version of the jobb tool (I recommend backing up the existing JAR and replacing it with your own, the Windows Batch file should still be used to run it) with a modified version of the libfat32 library built in. Simply modifying the method that determines the filesystem to return FAT16 for anything up to 2 GB and FAT32 otherwise is sufficient to build valid OBB files up to 2 GB (which is the limit for OBB files anyway).

SuperFloppyFormatter returning FAT32 for anything over 512 MB?

https://code.google.com/p/android/issues/detail?id=60294




回答3:


I was getting the same behaviour but this was only in a test directory structure I was experimenting with. It had almost no content so maybe this is an issue with jobb at these small sizes. Or maybe some error conditions are met depending on the space taken up by the all the files. I've commented in more detail on the Google Code issue.

I wonder if adding a couple of redundant files might avoid this error behaviour for those that are experiencing it with non-trivial directory structures.




回答4:


Got the same problem and the workaround I found is to make an archive with a minimum size of 4mo. To add fake data to my small archive make it worked…

Issue : https://code.google.com/p/android/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars&groupby=&sort=&id=53878




回答5:


In my case, I solved the issue removing several hidden files...

My boss owns and works on MacOSX, me on Windows. So, when he passed it on and after opening the folder, I found several hidden files, such as .DS_Store and ._.DS_Store. Additionally, I found hidden temporary JPGs, for example if I had a file called image1.jpg I had another one .image1.jpg. So, eventually I deleted all of the hidden files.

And voilà!




回答6:


In my case, it solved running again the program, with the same parameters and the same content at the directory that I wanted to pack.

./jobb -d /media/assets/ -o my-app-assets.obb -k my_pass -pn package-name -pv your-version


来源:https://stackoverflow.com/questions/13562617/using-jobb-tool-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!