rayshift / translatefgo

FGO Translation Project
MIT License
253 stars 14 forks source link

Unable to access necessary file folder (Android 14, Samsung S23 Ultra) #81

Closed JamellBattle closed 7 months ago

JamellBattle commented 7 months ago

I never had the file access issue before, for the Fate/SR event the app worked just fine. But yesterday or the day before, there was another software update and I'm not sure if it's because of the Android version, or my phone, or both, but now the issue has appeared. I tried the ADB workaround, but it actually uninstalled documentsUI as opposed to downgrading it, so that didn't work.

However, would it be possible for this app to use a file explorer other than the default Android one or ask which app to use like some others do? I have another file explorer that seems to be able to access those folders just fine ("Files" By Marc apps & software), but I can't use it with this app. If it works, maybe it could be a solution to the issue. It's available on the Google Play Store.

Looking at the other threads regarding this issue it seems like it's hard to replicate/fix and is also out of your control due to google updates just making things difficult, so hopefully this issue post isn't redundant. Thanks

neobenedict commented 7 months ago

It sounds like you have/had two versions of documentsUI installed, because it shouldn't completely uninstall it. What model of phone?

The "Files" by marc apps won't work, it doesn't have the system manage documents permission which is needed to grant the access, only the stock app has that.

JamellBattle commented 7 months ago

The phone is a Samsung Galaxy S23 Ultra. when I was in adb there actually were two documentsui: com.google.android.documentsui and com.google.android.overlay.modules.documentsui. I wasn't sure what the difference was, but I tried uninstalling both individually (keeping 1 installed) which made the File Explorer just stop working until I reinstalled. Should I try uninstalling both together?

neobenedict commented 7 months ago

You don't want to uninstall the overlay one.

Do you have an app called "com.android.documentsui"?

neobenedict commented 7 months ago

Could also try installing this: https://apk.rayshift.io/translatefgo/files-downgrade.apk

adb install -r -d files-downgrade.apk

JamellBattle commented 7 months ago

After checking again, there's no com.android.documentsui, only the other two I mentioned. I tried installing that apk you sent, but I'm getting a "downgrade detected" message which prevents it from installing, even after doing an uninstall of com.google.android.documentsui with adb first.

neobenedict commented 7 months ago

After checking again, there's no com.android.documentsui, only the other two I mentioned. I tried installing that apk you sent, but I'm getting a "downgrade detected" message which prevents it from installing, even after doing an uninstall of com.google.android.documentsui with adb first.

You're using the -r -d flags right? What's the exact error?

JamellBattle commented 7 months ago

Yeah, I made sure to include those. Here's the error message:

adb: failed to install files-downgrade.apk: Failure [INSTALL_FAILED_VERSION_DOWNGRADE: Downgrade detected: Update version code 310851020 is older than current 340819010]

neobenedict commented 7 months ago

Can you open another adb and look at the output of logcat right after you get that error? See if there's anything relevant?

JamellBattle commented 7 months ago

doing the logcat after getting the error, this is what appeared at the top:

02-13 14:11:08.978 17242 17242 E AndroidRuntime: FATAL EXCEPTION: main 02-13 14:11:08.978 17242 17242 E AndroidRuntime: Process: com.google.android.webview:sandboxed_process0:org.chromium.content.app.SandboxedProcessService0:0, PID: 17242 02-13 14:11:08.978 17242 17242 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Configuration android.content.res.Resources.getConfiguration()' on a null object reference

Is says there's a null object reference but I'm not sure what that would have to do with what I'm trying to do. the logcat command had a LOT of messages coming in really fast, but after this one it was just a bunch of messages that didn't seem to have anything to do with the error (or any error)

neobenedict commented 7 months ago

Yeah that's unrelated, the log scrolls quite fast so you should look through it for any mention of pm or apk etc

spiral6 commented 7 months ago
02-14 18:29:18.903 27996 27996 I abb     : StartCommandInProcess(73657474696e67730067657400656e61 settings.get.ena [truncated])
02-14 18:29:18.913 27996 27996 I abb     : StartCommandInProcess(7061636b61676500696e7374616c6c00 package.install. [truncated])
02-14 18:29:18.921  2753  2767 I PersonaServiceHelper: isCallerApprovedToInstall(uid:2000 userHandle:0)
02-14 18:29:18.921  2753  2767 I PersonaServiceHelper: DO is not enabled. no Knox app install enforcement
02-14 18:29:18.921  2753  2767 I PackageInstaller:  getting through the check android.content.pm.PackageInstaller$SessionParams@a150759 user id 0
02-14 18:29:18.921  2753  2767 I PackageInstaller: UserManager.DISALLOW_NON_MARKET_APP_BY_KNOX : false
02-14 18:29:19.163  2753  3153 W PackageManager: Downgrade detected: Update version code 310851020 is older than current 340819010
02-14 18:29:19.163  2753  3153 D PackageInstallerSession: Marking session 1016697478 as failed: INSTALL_FAILED_VERSION_DOWNGRADE: Downgrade detected: Update version code 310851020 is older than current 340819010
02-14 18:29:19.169  2753  3154 E PackageInstallerSession: Failed to verify session 1016697478
JamellBattle commented 7 months ago

I couldn't find anything for "pm" or "apk", so I tried filtering the logs with "packageInstaller" after seeing the above comment and found these:

02-15 10:28:25.101 2533 2921 E PackageInstallerSession: Failed to verify session 1964906847 02-15 10:35:12.622 2533 3746 I PackageInstaller: getting through the check android.content.pm.PackageInstaller$SessionParams@98b2673 user id 0 02-15 10:35:12.622 2533 3746 I PackageInstaller: UserManager.DISALLOW_NON_MARKET_APP_BY_KNOX : false 02-15 10:35:12.843 2533 2920 D PackageInstallerSession: Marking session 957300833 as failed: INSTALL_FAILED_VERSION_DOWNGRADE: Downgrade detected: Update version code 310851020 is older than current 340819010

The last line is referring to the file app I tried to install, so could that "disallow non market app by knox" message mean anything?

Segovia3047 commented 7 months ago

Another person here with Android 14 and a Samsung S23 that upgraded last night. Had zero issues prior to the upgrade. I get a very similar error trying to use ADB to do the files downgrade. I have not uninstalled anything.

Error message from the terminal below

PS C:\Users\S\Downloads\platform-tools_r34.0.5-windows\platform-tools> ./adb install -d -r "C:\Users\S\Downloads\files-downgrade.apk" Performing Streamed Install adb: failed to install C:\Users\S\Downloads\files-downgrade.apk: Failure [INSTALL_FAILED_VERSION_DOWNGRADE: Downgrade detected: Update version code 310851020 is older than current 341312010]

It still works on my Samsung A8 Tablet that uses Android 13 but also had an update last night.

neobenedict commented 7 months ago

Good news is I have got Shizuku working, will hopefully get a beta app to test out soon, which will fix this problem.

neobenedict commented 7 months ago

OK, here is a beta release: http://apk.rayshift.io/translatefgo/io.rayshift.translatefgo-22007_3.apk

About->Shizuku Setup or the use shizuku button on the popup

Could you test it and let me know your feedback, if it works or not, if you get any errors please screenshot them and post here.

There is no tutorial yet and there are no non-english app UI translations for this part, those will be added for the final release. However you can follow Shizuku's own tutorial to enable wireless debugging it's not too hard.

JamellBattle commented 7 months ago

Downloaded it and it works! I didn't get any errors during setup, once I got Shizuku setup it worked like normal. Thanks for looking into this!

Segovia3047 commented 7 months ago

Downloaded and it works for me. Completely new to Shizuku though. Do I have to leave wireless debugging enabled/re-enable it anytime I want to update the translation? Or is connecting once all I need?

neobenedict commented 7 months ago

Downloaded and it works for me. Completely new to Shizuku though. Do I have to leave wireless debugging enabled/re-enable it anytime I want to update the translation? Or is connecting once all I need?

You do yes which is a bit awkward.

neobenedict commented 7 months ago

Fixed with version 2.2.0.