Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Storage access framework corrupts files on save #17

Open
cyberb opened this issue Apr 17, 2022 · 23 comments
Open

Storage access framework corrupts files on save #17

cyberb opened this issue Apr 17, 2022 · 23 comments
Assignees

Comments

@cyberb
Copy link

cyberb commented Apr 17, 2022

I am using ViperEdit (and TurboEdit before) to edit files in Termux through Storage Access Framework.
Every time I remove lines from a file and save it saves some random lines to the end of it.

I am not sure if this is an issue with ViperEdit, SAF or Termux :( but it is super annoying to always go to Termix and delete garbage lines from the end using good old vim :)

I use Termux for git as mGit cannot handle any non-small git repos unfortunately.

@maks
Copy link
Owner

maks commented Apr 19, 2022

Thank you for reporting this. I'm not seeing this when editing files in ViperEdit from MGit via SAF, so I think this is Termux specific.
I don't normally use Termux, but I'll get it installed and see if I can find out what is happening here.

Does this happen with all files or only ones of a specific size or file type? If you could provide a set of steps that consistently reproduce the problem, that would be great.

@maks maks self-assigned this Apr 19, 2022
@maks maks added bug Something isn't working investigating and removed bug Something isn't working labels Apr 19, 2022
@cyberb
Copy link
Author

cyberb commented Apr 19, 2022

Just tested a simple file in the root of termux:

  1. test.txt
1
2
3
4
5
  1. Opened in ViperEdit and removed line 2
  2. Saved
  3. Reopen in ViperEdit or cat in Termux shows
1
3
4
5
5

@beroal
Copy link

beroal commented May 3, 2022

I can't reproduce this.

@cyberb
Copy link
Author

cyberb commented May 3, 2022

Interesting, what android/termux versions do you have?

Mine:
Redmi 9
Android 10
Termux 0.106

@cyberb
Copy link
Author

cyberb commented May 3, 2022

Another thing I am using Gboard keyboard, will try to test with somethig else.

@beroal
Copy link

beroal commented May 4, 2022

Interesting, what android/termux versions do you have?

Redmi Note 7; LineageOS 18.1-20220503-NIGHTLY-lavender (Android 11); Termux 0.118.0

@cyberb
Copy link
Author

cyberb commented May 6, 2022

Upgraded termux to 118, same issue.
Will try to test on android 11

@cyberb
Copy link
Author

cyberb commented May 6, 2022

Tested on termux 116 + fire os 7 (android 9) also work fine.
I will try to reinstall termux on my phone, who knows.

@cyberb
Copy link
Author

cyberb commented Dec 10, 2022

Still having this issue when editing files on my phone, this time I realized that editor adds few random chars at the end of the file right after opening it (before saving) as I can see vim on termux still shows correct content.

@cyberb
Copy link
Author

cyberb commented Dec 10, 2022

Sorry I am going mad, after seeing good content in vim and NOT saving bad one in Viper I did git add and still found bad content in git diff --cached.
Probably I need a new phone.

@SunDevil311
Copy link

Not sure if this project is still active, but I have the same issue when using Turbo Edit. Was going to try this program, as it's a fork, but it looks like it may have the same issue.

Samsung Galaxy S20 5G; OneUI 5.1; Android 13

@maks
Copy link
Owner

maks commented May 1, 2023

@SunDevil311 could you provide more details about the issue you are seeing when using Viper Edit?

@SunDevil311
Copy link

@maks Looks like I jumped the gun, not available in the Play Store for my device. I'd have to look into how to compile the program using gradle I guess, not something I typically do. I just turned off the Storage Access Framework toggle on Turbo Edit and it works fine for now...

@maks
Copy link
Owner

maks commented May 1, 2023

@SunDevil311 thanks for letting me know, the app is not available on Play because I hadn't yet provided some admin policy details to Google Play. I've done that now, so the app should be available for install again soon

@SunDevil311
Copy link

@maks Wanted to update you on this. I was not able to download Viper Edit via Google Play, as I'm still receiving a message that it's incompatible

I was able to acquire the installer via APKMirror and have not had any issues since installing. Overall, great app for what I'm looking for.

@SunDevil311
Copy link

I've not had any of the issue with SAF that have been reported. Thus far, Viper seems to be a faithful fork of Turbo Edit that doesn't share the same issues (namely, issues with SAF).

Also, this app is still not showing up in the Play Store. If F-Droid is an option, that'd be great too, or even a standalone APK.

I realize this project hasn't been updated for a while, but it's quite functional. Just be a shame if a small group of people is all that know of it.

@maks
Copy link
Owner

maks commented Aug 3, 2023

@SunDevil311 hmm thats unexpected, Viper Edit should be available on Google Play now that I've updated the required policy data and I see new installs happening regularly so I'm not sure why you are not able to see on Play.

@SunDevil311
Copy link

SunDevil311 commented Aug 3, 2023

@maks To be precise, Viper Edit does show up in the Play Store. However, it tells me that it's not compatible with my device. I'm using a Galaxy S20 (unrooted) on Android 13, I would think I should be able to run it (I do, from a manual APK install). One of my family member devices' is compatible, as I've shown in the screenshot.

You can't see the details of the SM-G981U (Galaxy S20), but it gives the same message as Chromecast.

screen

@fm-sys
Copy link
Contributor

fm-sys commented Aug 3, 2023

Probably you need to increase the target API version for Viper Edit. Google Play got quite restrictive in these terms recently...

@maks
Copy link
Owner

maks commented Aug 3, 2023

@SunDevil311 sorry Im not sure why this would be the case, you can see in the manifest there are basically no requirements on what the device needs to support.

@fm-sys No I don't think that is the case, as I've been able to install it on Pixel running Android 13 today without any issues.

@maks
Copy link
Owner

maks commented Aug 3, 2023

Infact to double check I just looked in Google Play console and it does report your device as being supported:

image

@fm-sys
Copy link
Contributor

fm-sys commented Aug 3, 2023

@fm-sys No I don't think that is the case, as I've been able to install it on Pixel running Android 13 today without any issues.

It's not about technical incompatibility but a Google Play requirement:

Apps with a target level of Android 10 (API level 29)** or lower have not been available to new users running the Android OS higher than apps’ target API after November 1, 2022.

https://support.google.com/googleplay/android-developer/answer/11926878

But maybe there are exceptions if you previously already had installed the app.

@maks
Copy link
Owner

maks commented Aug 3, 2023

Ah good point @fm-sys I missed the wording "...to new users" when I previously read that statement from Google.

I'll need to update the app to target a higher API level as currently it does indeed target 29, although that may take some time as previously I've run into other restrictions that are applied once an app targets newer API levels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants