android-securityexception

Android M 6.0 - SecurityException Trying to remove accounts

六眼飞鱼酱① 提交于 2021-02-07 12:48:47
问题 I have an app that uses Android AccountManager (package name: com.mycompany.accounts), that adds accounts to the device and provides a login screen. I have another app (com.mycomp.actualapp), that uses the first app to add/remove accounts. I can successfully add and remove accounts on Pre Marshmallow devices, using the following permissions in the manifest: <uses-permission android:name="android.permission.GET_ACCOUNTS"/> <uses-permission android:name="android.permission.MANAGE_ACCOUNTS"/>

Android 10: Able to upload a Uri directly but fails with “Permission denial” exception when re-attempted later

妖精的绣舞 提交于 2020-06-29 04:54:05
问题 Using a FilePicker I am able to have the user choose a file to upload, pass it to an IntentService, and upload it immediately via that intentService if device has network. But if there is no network, I need to save the Uri and attempt upload later once the devices gets network. This re-attempt is failing. It throws "Permission denial" exception when I try to start the service during the re-attempt. Please let me know what might be wrong. Appreciate your help. FILEPICKER -----------

Caused by: java.security.NoSuchProviderException: no such provider: Crypto - Android N [duplicate]

我只是一个虾纸丫 提交于 2020-01-11 09:53:28
问题 This question already has answers here : SecureRandom provider “Crypto” unavailable in Android N for deterministially generating a key (3 answers) Closed 3 years ago . Seems like "Crypto" provider has been removed in Android N. My application crashing because of NoSuchProviderException. If I change the provider and Algorithm then it will affect user who are all using the app currently. Any one have a idea? KeyGenerator kGen = KeyGenerator.getInstance(KEY_GENERATOR_ALGORITHM); SecureRandom sr

Android API 26 SecurityException issue

◇◆丶佛笑我妖孽 提交于 2020-01-06 04:52:04
问题 In my app I have a fragment and an imageButton inside of this fragment. When I run the app in my device (Android 8 - API 26) and click imageButton, the app crashes and throws a runtime error which I didn't see before. E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.mustafa.diyetisyenadmin, PID: 26366 java.lang.SecurityException: Permission Denial: null asks to run as user 1 but is calling from user 0; this requires android.permission.INTERACT_ACROSS_USERS_FULL or android

Send email through Intent : SecurityException

旧时模样 提交于 2019-12-30 10:13:50
问题 Here is how I'm sending email through Gmail App. Intent emailIntent = new Intent(Intent.ACTION_SEND); emailIntent.setClassName("com.google.android.gm", "com.google.android.gm.ComposeActivityGmail"); emailIntent.setType("text/html"); emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Puzzle"); emailIntent.putExtra(Intent.EXTRA_TEXT, someTextHere)); emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(attachmentFile)); try { startActivityForResult(emailIntent, SHARE_PUZZLE_REQUEST_CODE); } catch

Programmatically setting genymotion gps during testing causes “SecurityException: invalid package name” when setting latitude

主宰稳场 提交于 2019-12-23 02:32:18
问题 When testing, I am setting the lat long via Genymotion like so: package com.mypackage.name; public class TestGps extends ActivityInstrumentationTestCase2<MyClass>{ ... //setup just calls super.setup(); public void testLocationButton(){ Gps gps = GenymotionManager.getGenymotionManager(getInstrumentation().getContext()).getGps(); gps.setStatus(Gps.Status.ENABLED); gps.setLatitude(40.7127); // the error happens here gps.setLongitude(74.0059); } } I get the following issue when run: java.lang

Android 9.0 NotificationManager.notify() throwing java.lang.SecurityException

纵然是瞬间 提交于 2019-12-21 17:01:46
问题 I have been unable to reproduce this problem myself, but so far 5 users have reported it. I did recently publish an app update that changed the target SDK from 27 to 28 which I sure plays a part in this. All 5 users are running some flavor Android 9 on some kind of Pixel device. As am I. The app responds to an alert situation by calling setting up a notification and calling NotificationManager.notify(). This notification references a notification channel that tries to play an audio file

java.lang.SecurityException: MODE_WORLD_READABLE no longer supported

时间秒杀一切 提交于 2019-12-17 19:08:05
问题 The exception only occurs in Android 7.0 Nougat (emulator) devices. java.lang.SecurityException: MODE_WORLD_READABLE no longer supported My code: public void SessionMaintainence(Context context) { this.context = context; preferences = context.getSharedPreferences(PREF_NAME, Context.MODE_WORLD_READABLE); editor = preferences.edit(); editor.commit(); } LogCat: > E/AndroidRuntime: FATAL EXCEPTION: main > Process: burpp.av.feedback, PID: 2796 > java.lang.RuntimeException: Unable to create

Permission Denial: writing android.support.v4.content.FileProvider uri

早过忘川 提交于 2019-12-12 18:54:42
问题 Good day.I have an weird issue to which none of examples in stack overflow has worked.I am opening an gallery,after which i am redirecting user to crop intent.Important to mention that this only happens on android N and not below devices.The issue is that this exception is thrown as soon as the crop is done..I dont know what causes this,but actually here is how i start crop intent. Intent cropIntent = new Intent("com.android.camera.action.CROP"); cropIntent.addFlags(Intent.FLAG_GRANT_WRITE