Odoo-mobile / framework

Odoo Mobile Framework
https://play.google.com/store/apps/dev?id=8607973775002477408
Other
327 stars 374 forks source link

SecurityException because of addAccountExplicitly #318

Open 1Androider opened 7 years ago

1Androider commented 7 years ago

while executing this line accountManager.addAccountExplicitly(account, String.valueOf(user.getPassword()), user.getAsBundle())) getting error like Caused by: java.lang.SecurityException: uid 10328 cannot explicitly add accounts of type: com.odoo.auth at android.os.Parcel.readException(Parcel.java:1683) at android.os.Parcel.readException(Parcel.java:1636) at android.accounts.IAccountManager$Stub$Proxy.addAccountExplicitly(IAccountManager.java:995) at android.accounts.AccountManager.addAccountExplicitly(AccountManager.java:733) at com.odoo.core.auth.OdooAccountManager.createAccount(OdooAccountManager.java:111) at com.odoo.core.account.OdooLogin$AccountCreator.doInBackground(OdooLogin.java:441) at com.odoo.core.account.OdooLogin$AccountCreator.doInBackground(OdooLogin.java:428)

Thanks in advance

adam-nadar commented 7 years ago

y don u try job schedulers ?

flocsy commented 6 years ago

@kasim1011 what permission that would be? What's the line to be added to AndroidManifest.xml?

kasim1011 commented 6 years ago

@flocsy At authenticator.xml

<account-authenticator xmlns:android="http://schemas.android.com/apk/res/android"
    android:accountType="com.odoo.auth"
    android:icon="@drawable/ic_odoo"
    android:label="@string/label_accounts_settings"
    android:smallIcon="@drawable/ic_odoo">

</account-authenticator>

Change accounttype attribute to your.package.name.auth

At OdooAccountManager.java

public class OdooAccountManager {

    public static final String TAG = OdooAccountManager.class.getSimpleName();
    public static final String KEY_ACCOUNT_TYPE = "com.odoo.auth";
    public static final String KEY_USER_ACCOUNT_VERSION = "key_user_account_version";

    ...

Change KEY_ACCOUNT_TYPE variable to your.package.name.auth.

Make above changes than tell me whether app is running properly or not?

flocsy commented 6 years ago

so it has nothing to do with permissions does it?

kasim1011 commented 6 years ago

@flocsy The Error stack trace put by @1Androider has nothing to do with permissions.

Tell me, after doing above changes, app is working or not?