Как создать файл.obb в качестве основного файла расширения apk с помощью инструмента jobb?
У меня есть apk 80Mb, и поэтому я не могу загрузить его в Google Play Store. Я много гуглил и обнаружил, что должен создать .obb
файл в качестве основного файла расширения.
Также я обнаружил, что могу создать .obb
файл с помощью инструмента Jobb, который находится внутри sdk > tools > jobb.bat
но, к сожалению, он закрывается сразу после начала.
Так я что-то упустил?
2 ответа
Я погуглил и обнаружил, что мы должны сделать.zip с 0% (No compression)
это упоминается в http://developer.android.com/google/play/expansion-files.html
Tip: If you're packaging media files into a ZIP, you can use media playback calls on the files with offset and length controls (such as MediaPlayer.setDataSource() and SoundPool.load()) without the need to unpack your ZIP. In order for this to work, you must not perform additional compression on the media files when creating the ZIP packages. For example, when using the zip tool, you should use the -n option to specify the file suffixes that should not be compressed:
zip -n .mp4;.ogg main_expansion media_files
ИЛИ Как сделать сжатие zip zip с помощью winrar?
здесь см метод сжатия
поэтому мы должны загрузить этот почтовый индекс в игровой магазин.
так что вам не нужно использовать ZipHelper.java
просто используйте
ZipResourceFile expansionFile=null;
try {
expansionFile = APKExpansionSupport.getAPKExpansionZipFile(getApplicationContext(),3,0);
AssetFileDescriptor fd = expansionFile.getAssetFileDescriptor("test.mp4");
MediaPlayer mPlayer = new MediaPlayer();
mPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
mPlayer.setDataSource(fd.getFileDescriptor(),fd.getStartOffset(),fd.getLength());
mPlayer.prepare();
mPlayer.start();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Попробуй это
$ jobb -d /temp/assets/ -o new-obb-file.obb -k секретный ключ -pn com.my.app.package -pv 11
куда
-d <directory> : Set the input directory for creating an OBB file.
-o <filename> : Specify the filename for the OBB file.
-k <key> : Specify a password for encrypting a new OBB file
-pn <package> : Specify the package name for the application that mounts the OBB file, which corresponds to the package value specified in your application's manifest.
-pv <version> : Set the minimum version for the application that can mount the OBB file, which corresponds to the android:versionCode value in your application's manifest.
Попробуйте эту команду.
проверьте следующую ссылку http://developer.android.com/tools/help/jobb.html
Мне удалось создать файл OBB с помощью команды ниже, НО проблема заключалась в том, что он не был извлечен в приложении и застрял в ZipInputStream zis zis.getNextEntry()
/Users/rohit/Library/Android/sdk/tools/bin/jobb -d /Users/rohit/Workspace/code/iam/repo/music' 'files -o main.33.com.aml.iatia.activity.obb -pn com.aml.iatia.activity -pv 33
В качестве решения я создал с помощью CLI в MAC с помощью приведенной ниже команды, и он работал очень хорошо.
zip -r main.33.com.aml.iatia.activity.obb music' 'files -x "*/\.*"