Impossible de monter un fichier obb encrypté
Bonjour,
j'encrypte mon fichier obb avec jobb.bat du sdk Android
Citation:
C:\Android\android-sdk\tools\jobb -d C:\Users\user\Desktop\myApp\folder\ -o C:\Users\user\Desktop\myApp\main.34452.com.app.myApp.obb -k myKey234 -pn com.app.myApp -pv 34452
dans mon application j'utilise
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| String obbDir = Environment.getExternalStorageDirectory().getAbsolutePath()+"/Android/obb/"+getPackageName()+"/main.34452."+getPackageName()+".obb";
StorageManager storage = (StorageManager) getSystemService(STORAGE_SERVICE);
storage.mountObb(obbDir, "myKey234", new OnObbStateChangeListener() {
@Override
public void onObbStateChange(String path, int state) {
if (state == OnObbStateChangeListener.ERROR_ALREADY_MOUNTED) {
msg= "ERROR_ALREADY_MOUNTED!!!!";
}else if (state == OnObbStateChangeListener.ERROR_COULD_NOT_MOUNT) {
msg= "ERROR_COULD_NOT_MOUNT!!!!";
}
else if (state == OnObbStateChangeListener.ERROR_COULD_NOT_UNMOUNT) {
msg= "ERROR_COULD_NOT_UNMOUNT!!!!";
}
else if (state == OnObbStateChangeListener.ERROR_INTERNAL) {
msg= "ERROR_INTERNAL!!!!";
}
else if (state == OnObbStateChangeListener.ERROR_NOT_MOUNTED) {
msg= "ERROR_NOT_MOUNTED!!!!";
}
else if (state == OnObbStateChangeListener.ERROR_PERMISSION_DENIED) {
msg= "ERROR_PERMISSION_DENIED!!!!";
}
else if (state == OnObbStateChangeListener.MOUNTED) {
msg= "MOUNTED!!!!";
}
else if (state == OnObbStateChangeListener.UNMOUNTED) {
msg= "UNMOUNTED!!!!";
}
setContentView(getResourceId("layout.obb"));
TextView statusUnzip = (TextView) findViewById(getResourceId("id.obb_status"));
statusUnzip.setGravity(Gravity.CENTER);
statusUnzip.setText(msg);
}
}); |
quand je décrypte le fichier avec ma clé "storage.mountObb(obbDir, "myKey234", new OnObbStateChangeListener()" ça ne fonctionne pas il me retourne "ERROR_COULD_NOT_MOUNT!!!!", sans clé ça fonctionne il me retourne "MOUNTED!!!!" ?
merci de votre aide