Skip to content

Commit

Permalink
[Installer] Fix extracting OBB in Android 11
Browse files Browse the repository at this point in the history
Signed-off-by: Muntashir Al-Islam <[email protected]>
  • Loading branch information
MuntashirAkon committed May 30, 2021
1 parent ca24a7e commit ca2c61b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ protected void copyObb(@NonNull ApkFile apkFile) {
ProxyFile[] extDirs = ue.getExternalDirs();
ProxyFile writableExtDir = null;
for (ProxyFile extDir : extDirs) {
if (extDir.canWrite()) {
if (extDir.canWrite() || extDir.getAbsolutePath().startsWith("/storage/emulated")) {
writableExtDir = extDir;
break;
}
Expand All @@ -726,6 +726,7 @@ protected void copyObb(@NonNull ApkFile apkFile) {
apkFile.extractObb(writableObbDir);
UiThreadHandler.run(() -> UIUtils.displayLongToast(R.string.obb_files_extracted_successfully));
} catch (Exception e) {
Log.e(TAG, e);
UiThreadHandler.run(() -> UIUtils.displayLongToast(R.string.failed_to_extract_obb_files));
} finally {
if (installWatcher.getCount() != 0) {
Expand Down

0 comments on commit ca2c61b

Please sign in to comment.