marunjar / anewjkuapp

GNU General Public License v3.0
16 stars 4 forks source link

Login is not stored on phone #125

Closed pointhi closed 6 years ago

pointhi commented 6 years ago

Login with wrong student number/password returns an error as expected. When I enter the correct data, I come to the normal screen. But it's not possible to view any data at all. Furthermore the header says: "please login", like no login was added.

With adb logcat *:D I found some interesting line:

03-01 17:11:02.631 21829 21829 I KusssAuthenticatorActivity: finish login to 15*****
03-01 17:11:02.637  2264  3165 W AccountManagerService: insertAccountIntoDatabase: Account {name=15*****, type=org.voidsink.anewjkuapp.account}, skipping since the account already exists

But when I looked into the account section of the Settings, JKU App does not show any accounts added for this app. And the app itself also does not find any accounts to use because the login window is showed at the start.

System informations

Device: Xperia Z Android-Version: 7.1.2 LineageOS-Version: 14.1-20190224-NIGHTLY-yuga LineageOS API-Level: Guava (7) Current Status of security updates: 5. February 2018 Kernel Version: 3.4.113 SELinux: Strict Encryption: Yes

pointhi commented 6 years ago

I reported on lineageos as well: https://jira.lineageos.org/browse/BUGBASH-1606

daedroza commented 6 years ago

You need to delete all the existing accounts on first run as done on NextCloud. Here is the original PR: https://github.com/nextcloud/android/pull/949

pointhi commented 6 years ago

Workaround:

  1. Connect to root shell on phone
    adb root
    adb shell
  2. Open sqllite database
    cd /data/system_ce/0/
    sqlite3 accounts_ce.db
  3. Remove login entries from database
    DELETE FROM accounts WHERE type='org.voidsink.anewjkuapp.account';

let's see if this workaround is permanent, or if the login will be forgotten after reboot/system update. At least the accounts window in android shows the added account now.

pointhi commented 6 years ago

Ok, found the actual issue: https://jira.lineageos.org/browse/BUGBASH-1611

It seems to only appear when the app is stored on an encrypted SD-card. Moving the app to the internal storage and cleaning up the SQLite database fixes the issue.