Project Information
Repository: https://github.com/ScreamingHawk/phone-saver
Title: Saving files to folders which carry paths causes a fatal exception.
Expected behavior
I actually expected adding files to these folders with paths to be a successful operation, since adding the folders to the list didn't result in any issue.
Actual behavior
When files are shared and saved to these folders with paths, PhoneSaver crashes. I dont want to say it happens with any source, built in gallery and filemanager were the two apps I used for the test and the results were the same.
Ps: Folders with paths are Folders that display in this format (sdcard/sdcard0/bluetooth) when added to phone saver. Where bluetooth
is the main folder and the path is sdcard\sdcard0
In addition, the directory that provides folders with path vary with devices and versions.
On my v6.0 marshmallow device, folders of that nature came from internal storage.
However, on my v4.2 jellybean device they came from the S.d card.
Do put that into consideration when trying to replicate this issue.
How to reproduce
Launch Phonesaver and click on the floating (+) button to add a folder.
Pick a folder from the internal storage, as the folders with paths come from the internal storage on android v6.0
Exit phone saver and launch device gallery.
Locate a file within the gallery and share the file.
Choose phone saver as the destination.
( this action should launch phone saver)Now choose a folder with path from the list of folders.
Phone saver should crash and exit itself.
Browser/App version: v4.0.2
Operating system: Android v6.0 marshmallow.
Device: Itel p12
Recording Of The Bug
Proof of work done
Log
05-31 22:01:31.804 E/AndroidRuntime(19058): java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
05-31 22:01:31.804 E/AndroidRuntime(19058): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
05-31 22:01:31.804 E/AndroidRuntime(19058): at dalvik.system.NativeStart.main(Native Method)
05-31 22:01:31.804 E/AndroidRuntime(19058): Caused by: java.lang.reflect.InvocationTargetException
05-31 22:01:31.804 E/AndroidRuntime(19058): at java.lang.reflect.Method.invokeNative(Native Method)
05-31 22:01:31.804 E/AndroidRuntime(19058): at java.lang.reflect.Method.invoke(Method.java:525)
05-31 22:01:31.804 E/AndroidRuntime(19058): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
05-31 22:01:31.804 E/AndroidRuntime(19058): ... 2 more
05-31 22:01:31.804 E/AndroidRuntime(19058): Caused by: <a href="java.io">java.io</a></p>.IOException: open failed: ENOENT (No such file or directory)
05-31 22:01:31.804 E/AndroidRuntime(19058): at <a href="java.io">java.io</a></p>.File.createNewFile(File.java:948)
05-31 22:01:31.804 E/AndroidRuntime(19058): at link.standen.michael.phonesaver.activity.SaverActivity.saveUri(SaverActivity.kt:341)
05-31 22:01:31.804 E/AndroidRuntime(19058): at link.standen.michael.phonesaver.activity.SaverActivity.access$saveUri(SaverActivity.kt:31)
05-31 22:01:31.804 E/AndroidRuntime(19058): at link.standen.michael.phonesaver.activity.SaverActivity$handleSingle$$inlined$let$lambda$1.invoke(SaverActivity.kt:272)
05-31 22:01:31.804 E/AndroidRuntime(19058): at link.standen.michael.phonesaver.activity.SaverActivity$handleSingle$$inlined$let$lambda$1.invoke(SaverActivity.kt:31)
05-31 22:01:31.804 E/AndroidRuntime(19058): at link.standen.michael.phonesaver.activity.SaverActivity.getFilename(SaverActivity.kt:506)
05-31 22:01:31.804 E/AndroidRuntime(19058): at link.standen.michael.phonesaver.activity.SaverActivity.getFilename(SaverActivity.kt:399)
05-31 22:01:31.804 E/AndroidRuntime(19058): at link.standen.michael.phonesaver.activity.SaverActivity.handleSingle(SaverActivity.kt:271)
05-31 22:01:31.804 E/AndroidRuntime(19058): at link.standen.michael.phonesaver.activity.SaverActivity.useIntent(SaverActivity.kt:157)
05-31 22:01:31.804 E/AndroidRuntime(19058): at link.standen.michael.phonesaver.activity.SaverActivity.useIntent$default(SaverActivity.kt:147)
05-31 22:01:31.804 E/AndroidRuntime(19058): at link.standen.michael.phonesaver.activity.SaverActivity$loadList$$inlined$let$lambda$1$1.onItemClick(SaverActivity.kt:113)
05-31 22:01:31.804 E/AndroidRuntime(19058): at android.widget.AdapterView.performItemClick(AdapterView.java:298)
05-31 22:01:31.804 E/AndroidRuntime(19058): at android.widget.AbsListView.performItemClick(AbsListView.java:1139)
05-31 22:01:31.804 E/AndroidRuntime(19058): at android.widget.AbsListView$PerformClick.run(AbsListView.java:2856)
05-31 22:01:31.804 E/AndroidRuntime(19058): at android.widget.AbsListView$1.run(AbsListView.java:3619)
05-31 22:01:31.804 E/AndroidRuntime(19058): at android.os.Handler.handleCallback(Handler.java:800)
05-31 22:01:31.804 E/AndroidRuntime(19058): at android.os.Handler.dispatchMessage(Handler.java:100)
05-31 22:01:31.804 E/AndroidRuntime(19058): at android.os.Looper.loop(Looper.java:194)
05-31 22:01:31.804 E/AndroidRuntime(19058): at android.app.ActivityThread.main(ActivityThread.java:5370)
05-31 22:01:31.804 E/AndroidRuntime(19058): ... 5 more
05-31 22:01:31.804 E/AndroidRuntime(19058): Caused by: <a href="libcore.io">libcore.io</a></p>.ErrnoException: open failed: ENOENT (No such file or directory)
05-31 22:01:31.804 E/AndroidRuntime(19058): at <a href="libcore.io">libcore.io</a></p>.Posix.open(Native Method)
05-31 22:01:31.804 E/AndroidRuntime(19058): at <a href="libcore.io">libcore.io</a></p>.BlockGuardOs.open(BlockGuardOs.java:110)
05-31 22:01:31.804 E/AndroidRuntime(19058): at <a href="java.io">java.io</a></p>.File.createNewFile(File.java:941)
05-31 22:01:31.804 E/AndroidRuntime(19058): ... 23 more```
Thank you for contributing to Utopian!
I was able to reproduce the bug on my device.
I had to test this for 10 minutes to figure out that you meant that only paths on external storage are causing this bug. This detail, even though mentioned in some way in the post, I couldn't understand it for sure. This is reflected in your score.
Also, Vimeo got bad embed UI and I suggest you use youtube or GIFs in the future to help get you a better score.
Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.
To view those questions and the relevant answers related to your post, click here.
Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Its both ways, thats why I did mention that it varies with devices. On my device, its from the Internal storage (sdcrad/sdcard0) while on another device it was the external storage (sdcard/sdcard1). I tried to make it as simple as possible @achiron
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Hello @organik,
Here is the re-evaluation Questionnaire report.
Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.
To view those questions and the relevant answers related to your post, click here.
Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Hey @organik
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!
Contributing on Utopian
Learn how to contribute on our website or by watching this tutorial on Youtube.
Want to chat? Join us on Discord https://discord.gg/h52nFrV.
Vote for Utopian Witness!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit