aricneto / TwistyTimer

Twisty Timer is a material design twisty puzzle timer for Android. It uses the TNoodle library to generate scramble sequences for all current official speedsolving puzzles.
GNU General Public License v3.0
238 stars 52 forks source link

Export/Import Doesn't work #177

Closed ReinIsNOTaDev closed 1 year ago

ReinIsNOTaDev commented 1 year ago

When you click the Export/Import Button, Nothing happens.

Phone Used: Realme 9 Pro, Android 13 Does work in my Oppo F5 (Android 7)

aricneto commented 1 year ago

Thanks, this is due to the API changes starting on Android 11 that restrict storage access for apps. Export/Import must be rewritten to accommodate these changes while offering legacy support for older versions.

Flo082002 commented 1 year ago

Downgrading worked for me.

Samsung Galaxy S21 FE 5G Android 13

  1. Download the apk
  2. open terminal in downloads folder
  3. connect the phone with usb to the computer, install adb on the computer, enable adb on the phone
  4. downgrade the app via adb adb install -r -d twisty-timer-v4.6.4.apk
jonnykl commented 1 year ago

I have a similar problem. When clicking on Import or Export the file chooser dialog opens but shows no files. I'm running Android 10 on a Xiaomi Mi 8.

Adding android:requestLegacyExternalStorage="true" to the application tag in AndroidManifest.xml solved this issue for me. This could be a temporary fix until the import/export functions will be rewritten.

Downgrading worked for me.

Also worked for me. Thanks!

Domalar commented 1 year ago

Same here on MIUI 13.0.2 (Android 12) => Message that export is not possible

Same on MIUI 12.5.18.0 (Android 11) => nothing happens

Will try the downgrade to 4.6.4

Sarreos commented 1 year ago

Downgrading worked for me.

Samsung Galaxy S21 FE 5G Android 13

  1. Download the apk
  2. open terminal in downloads folder
  3. connect the phone with usb to the computer, install adb on the computer, enable adb on the phone
  4. downgrade the app via adb adb install -r -d twisty-timer-v4.6.4.apk

Is the downgrade completely safe? I would prefer to keep my 7k solves.

Domalar commented 1 year ago

Is the downgrade completely safe? I would prefer to keep my 7k solves.

I did it on My Redmi with MIUI 13 / Android 12 some minutes ago and it worked. If this process is safe for you? Don't know. I did it. You have to decide it for yourself

Complete Steps on the phone:

Steps on Windows:

Last Step: Developer menu and switch the slider for USB Debugging to OFF and the slider for the complete developer menu also => The developer menu disappears.

So worked for me...

Domalar commented 1 year ago

@aricneto Maybe this help...

I added this quick hack in "onExportSolveTImes":

    if (!Environment.isExternalStorageManager()) {
        Intent intent = new Intent(ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION, Uri.parse("package:" + BuildConfig.APPLICATION_ID));
        startActivityForResult(intent, APP_STORAGE_ACCESS_REQUEST_CODE);
    }

and the constant was defined

final static int APP_STORAGE_ACCESS_REQUEST_CODE = 501; // Any value

501? => see stack overflow

In a Debug on my device I got a new permission dialog with "access to all files" and after I that the export did work.

robiningelbrecht commented 1 year ago

Any news on a fix?

Sarreos commented 1 year ago

I used the workaround mentioned above - downgrading to 4.6.4

robiningelbrecht commented 1 year ago

For TwistyTimer to be able to export solves to CSV, it must have some internal storage right? Does anybody know if this internal storage can be accessed from your phone/laptop if developer mode is enabled?

This way I could manage my exports manually for now without downgrading...

jonnykl commented 1 year ago

Does anybody know if this internal storage can be accessed from your phone/laptop if developer mode is enabled?

adb backup should work.

aricneto commented 1 year ago

I'll be working on that this weekend, now that I got some free time. I'll update this issue once it's been pushed to production and fixed. Thanks @Domalar for the suggestions and pull requests, also thanks everyone else for notifying this issue.

robiningelbrecht commented 1 year ago

@aricneto I do not want to pressure you, but any update on this? 🙏

aricneto commented 1 year ago

Issue has been fixed in 2fcd6f7d2697a0810f37245ac033f1da12448382. All thanks go to @hato-ya who fixed it in their fork.

APK has been published on the Play Store and is awaiting Google's review. In the meantime, you can update it directly by installing this (signed) apk: Twisty Timer v4.7.0

ReinIsNOTaDev commented 1 year ago

I feel upset that I reinstalled Twisty Timer now. Oh well...