Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Cannot select xapk file in file explorer #125

Open
corentin-c opened this issue Jan 28, 2025 · 3 comments
Open

Cannot select xapk file in file explorer #125

corentin-c opened this issue Jan 28, 2025 · 3 comments

Comments

@corentin-c
Copy link

Hello,

Thank you for this cool app !
When I tried to select the .xapk file in the file explorer it was greyed out and I could not click on it. After renaming the file from .xapk to .zip it worked great, maybe allowing to choose the .xapk files directly in the file explorer could make things easier.

@AbdurazaaqMohammed
Copy link
Owner

It is supposed to be able to open XAPK files. The Android file picker actually doesn't allow specifying extensions to open, only MIME type which can be different to extension. APKCombo or whereever you get the XAPK from actually put no (empty) MIME type for the file. And the problem is that on older Android versions (at least Android 8, I'm not sure), the Android file picker doesn't like files with no MIME type (on newer versions, it will treat them as the default MIME type application/octet-stream). And whatever app you use to rename the file set the MIME type to ZIP when you renamed it.

Now if I set the file picker to allow selecting any file regardless of MIME type, we could select it but this is a bad idea (Since on newer file types the MIME type for XAPK will be octet-stream I have used this and already some people try to select wrong file types) and actually there will be an error after opening it because it tries to check MIME type again when opening the file. If storage permission is allowed that can be fixed, but then 2 bad things have to be combined.

@drogga
Copy link

drogga commented Jan 28, 2025

@corentin-c
IMO the problem is more with and in the DocumentsUI (the system Files app by google, used as a File Picker - com.android.documentsui.picker.PickActivity), which is actually terrible, along with the media scanner, so if you manually navigate to the directory/folder path where the files you want to select are, even if they are on the same place where it starts by default in, like Downloads, they won't be greyed-out then.

@corentin-c
Copy link
Author

Choosing the .xapk or .zip file manually via my file Explorer (Amaze) and opening it with this app creates this error :

java.lang.IllegalArgumentException: column '_data' does not exist. Available columns: []android.database.AbstractCursor.getColumnIndexOrThrow(AbstractCursor.java:358)
android.database.CursorWrapper.getColumnIndexOrThrow(CursorWrapper.java:91)
com.starry.FileUtils.getDataColumn(SourceFile:28)
com.starry.FileUtils.getPath(SourceFile:305)
com.reandroid.Merger.extractAndLoad(SourceFile:271)
com.reandroid.Merger.run(SourceFile:83)
com.abdurazaaqmohammed.AntiSplit.main.MainActivity.lambda$process$2(SourceFile:125)
com.abdurazaaqmohammed.AntiSplit.main.MainActivity.s(SourceFile:1)
y.c.call(SourceFile:1)
java.util.concurrent.FutureTask.run(FutureTask.java:264)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
java.lang.Thread.run(Thread.java:1012)

SDK 31
AntiSplit M 2.1.7
Storage permission granted: true
Searching apk files…
/storage_root/storage/emulated/0/Download/SwissID_5.2.9_APKPure.xapk

Thsi error doesn't happen when I choose the .zip file from the file picker inside the app.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants