AVC open denied - Android Q&A, Help & Troubleshooting

I have 2 devices, a LGG4 and a Xiaomi Mi 8, both rooted.
I'm modifying a .db of an App and everything works fine on the LGG4.
But on the Xiaomi, when I launch the App after changes, I get this error:
Code:
avc: denied { open } for path="/data/data/com.app.app/databases/database.db" dev="sda21" ino=2761689 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:app_data_file:s0 tclass=file permissive=0
(I'm correctly setting permissions)
I already tried to search similar questions here and on google, but I can't find a valid solution.
Thanks!

Related

Grant Permissions

I'm trying to grant myself a system permission in lollipop. However, I can't find the "android" package (I never see "Hooking Permissions" in my log) so my code is never called. What am I doing wrong?
Code:
@Override
public void handleLoadPackage(LoadPackageParam lpparam) throws Throwable {
if (lpparam.packageName.equals("android")) {
Log.d(TAG, "Hooking Permissions");
hookPermissionCode(lpparam);
}
}
Use XposedBridge.log() for debug logs.
pyler said:
Use XposedBridge.log() for debug logs.
Click to expand...
Click to collapse
Thankyou
I added a line in my code to use XposedBridge.log()
I still am not finding the package "android"
Is this package available in xposed for lollipop? Is there something else that could block handleLoadPackage from seeing it?

[Solved] Google Maps Navigation can't fix position and poor GPS reception

Hello everyone. I've got a problem with Google Maps Navigation. I think it's an app bug because its' very strange.
GPS Data, Here Maps and Google Maps can fix position.
But when I switch to Navigation mode in Google Map, the app loose satellites and can not fix.
As soon as I exit Navigation mode to come back to Maps mode, the fixed satellites increase.
Please does someone have the same bug?
I've cleaned every caches, restored ROM backup and now I'm on a clean installation of CM 12.1 (2016-02-03) and the position bug is still there.
I think I will go crazy. I've installed Waze and it works! Reception is not very good but he can guide me. Only Google Navigation does not work anymore. :crying:
So, that seems to be a hardware problem. And Google Navigation is the app that has most trouble with it ...
hey, i also got the same problem on cm13, but can't believe its a hardware-bug.
did you already find a solution/workaround?
for me i got good signals in AutoMate (there is a map integrated) and GPS-Test, but i always get a on-off signal in GoogleMaps and(!) Waze.
Did you already tried stock-rom? i wonder if it is the same there, but im afraid of the difficult flash process to go back to stock.
Which radio/baseband do you have?
Typhoon_Master said:
hey, i also got the same problem on cm13, but can't believe its a hardware-bug.
did you already find a solution/workaround?
for me i got good signals in AutoMate (there is a map integrated) and GPS-Test, but i always get a on-off signal in GoogleMaps and(!) Waze.
Did you already tried stock-rom? i wonder if it is the same there, but im afraid of the difficult flash process to go back to stock.
Which radio/baseband do you have?
Click to expand...
Click to collapse
My baseband : XXLS8
Yes I flashed Stock 4.1 Rom yesterday and I have seen the same behavior: poor GPS fix.
Now I come back to CM12.1 but it's getting worse! My phone can not find his position, even with applications that worked before.
For me it's a Google Services or a hardware problem.
Note: I've got a Samsung Tab A with Android 6.0 and Google Services (9.2.56) and GPS works good ...
So I made the ultimate test. I restored a backup I've made early May 2016. At android start I activate Plane mode in order to prevent Google play services to auto update. I checked the version, it's 8.7.03, excellent.
I start GPS Data to test position and the bug is still there. My phone can't fix 0 on 4~5 satellites.
So my GPS is dying
For the last test I made a dangerous action. I rewrite nv_data files from a EFS backup i've made two year ago. (It was Epic, I lost my IMEI, then I get it back, Phew!)
Unfortunately it didn't fix my poor GPS reception.
Here's what I have:
- GPS Data : 5-6 satellites fixed and no drop
- Waze : 3-4 satellites fixed and many drops
- Google Maps : 3-4 satellites fixed and many drops
- Google Navigation : 0 satellite fixed
Whereas few months ago I could get up to 11 satellites!
I tried everything, I have no idea ...
Some news. I've seen that sometimes phone thinks that Position is disabled !?!
In GPS Data app sometimes it display "OFF" instead of "Wait" in the top bar. But the compass screen display 0/8 satellites fixed!
So he sees satellites but thinks GPS is disabled.
I have to disable and enable Position in order to hook satellites.
Maybe this is why I get 0 satellites in Google Navigation. Is it a RIL bug ???
I looked at log files in order to find error. There are many denials but there are these related to GPS:
modem.log
07-26 13:42:35.227 E/use-Rlog/RLOG-RIL(20022): requestOEMHookRaw
07-26 13:42:35.227 E/use-Rlog/RLOG-RIL(20022): Logging Oem Func ID : 14
07-26 13:42:35.227 E/use-Rlog/RLOG-RIL(20022): Logging Oem Sub Func ID : 55
07-26 13:42:35.227 E/use-Rlog/RLOG-RIL(20022): requestOemGps: gps_status 0 sub_id 0x37 len 1
07-26 13:42:35.227 E/use-Rlog/RLOG-RIL(20022): requestFrequencyAiding: state 1
07-26 13:42:35.227 E/use-Rlog/RLOG-RIL(20022): GR err: 0x8000
07-26 13:42:35.227 E/use-Rlog/RLOG-RIL(20022): GPS_onRequestComplete: sub_id 55 error 13 param 0xb657ccf4 plen 1
07-26 13:42:35.227 E/use-Rlog/RLOG-RIL(20022): RIL_onRequestComplete: tok(0xb8790120)
logcal.log
07-26 12:08:21.046 D/WifiService( 4559): acquireWifiLockLocked: WifiLock{NlpWifiLock type=2 [email protected]}
07-26 12:08:21.163 I/GoogleLocationS(16130): type=1400 audit(0.0:1886): avc: denied { setattr } for name="nlp_devices" dev="mmcblk0p10" ino=124272 scontext=u:r:untrusted_app:s0 tcontext=ubject_r:unlabeled:s0 tclass=file permissive=1
07-26 12:08:21.183 D/WifiService( 4559): releaseWifiLockLocked: WifiLock{NlpWifiLock type=2 [email protected]}
07-26 13:35:30.707 I/WAZE [ ConnEventReceiver ](28264): Received event: android.net.conn.CONNECTIVITY_CHANGE. Connectivity: true. Type: WIFI ( 1 ). State: CONNECTED. Connected: true
07-26 13:35:30.707 I/WAZE (28264): getConfig - callback
07-26 13:35:30.707 D/WAZE (28264): Got ShareConfig values: FB: true
07-26 13:35:30.720 D/WAZE (28264): onStatusChanged
07-26 13:35:30.734 D/WAZE (28264): getFacebookSettings - event
07-26 13:35:30.770 E/NowAuthenticator(28264): Token recevied
07-26 13:35:30.788 E/GpsLocationProvider( 4559): native_start failed in startNavigating()
07-26 13:35:30.878 D/WAZE (28264): SpeedometerView: Not shown. (speed == -1 && !mSpeedometerShownOnce=false ) || !mSpeedometerEnabled=true
event.log
07-26 11:01:37.074 I/auditd (16130): type=1400 audit(0.0:1761): avc: denied { getattr } for comm="GoogleLocationS" path="/data/data/com.google.android.gms/files/nlp_clts" dev="mmcblk0p10" ino=124822 scontext=u:r:untrusted_app:s0 tcontext=ubject_r:unlabeled:s0 tclass=file permissive=1
07-26 11:01:37.078 I/auditd (16130): type=1400 audit(0.0:1762): avc: denied { setattr } for comm="GoogleLocationS" name="nlp_clts" dev="mmcblk0p10" ino=124822 scontext=u:r:untrusted_app:s0 tcontext=ubject_r:unlabeled:s0 tclass=file permissive=1
07-26 11:01:37.081 I/auditd (16130): type=1400 audit(0.0:1763): avc: denied { write } for comm="GoogleLocationS" name="nlp_clts" dev="mmcblk0p10" ino=124822 scontext=u:r:untrusted_app:s0 tcontext=ubject_r:unlabeled:s0 tclass=file permissive=1
07-26 11:01:37.081 I/auditd (16130): type=1400 audit(0.0:1764): avc: denied { open } for comm="GoogleLocationS" path="/data/data/com.google.android.gms/files/nlp_clts" dev="mmcblk0p10" ino=124822 scontext=u:r:untrusted_app:s0 tcontext=ubject_r:unlabeled:s0 tclass=file permissive=1
07-26 12:08:21.163 I/auditd (16130): type=1400 audit(0.0:1886): avc: denied { setattr } for comm="GoogleLocationS" name="nlp_devices" dev="mmcblk0p10" ino=124272 scontext=u:r:untrusted_app:s0 tcontext=ubject_r:unlabeled:s0 tclass=file permissive=1
07-26 13:36:23.505 I/auditd (32613): type=1400 audit(0.0:1993): avc: denied { execute } for comm="rtcross.gpstest" path="/data/data/com.google.android.gms/app_chimera/m/00000006/arm/DynamiteModulesA_GmsCore_prodlmp_hdpi_release.odex" dev="mmcblk0p10" ino=123381 scontext=u:r:untrusted_app:s0 tcontext=ubject_r:unlabeled:s0 tclass=file permissive=1
Click to expand...
Click to collapse
Some news:
- First I found why sometimes all apps can't fix any satellites. The problem is the app I use to test gps! I've installed GPS Data on another phone (Wiko Cink Five) in order to compare gps signal strength. And then position has been broken! So do not use GPS Data app. I think it's a A-GPS database update bug. I've installed GPS Test which works much better.
- As I noted that I have better reception in GPS test app and not in Navigation apps, I tried an app that force GPS activation. I found GPS Connected. I launch it at the same time I start navigation. It's better. Now Google Navigation can see satellites. but signal strength is still poor and can not guide me because of GPS drop and bad accuracy.
I can't believe it! I've resolved my GPS problem. It was a hardware problem. My antenna started poorly receive the satellite signal, for an unknown reason.
I found by chance a discussion in a French forum about enhance antenna signal helped by an aluminum sheet. I've have done the trick and it worked!
Now my S2 can fix satellites during navigation. It works nearly good as before. I have no more signal drop and Google Navigation and Waze can guide me.
I change this discussion to Resolved.
Hello there! Wow, 6 months passed.
I come back to tell you that my GPS still working good. This aluminum trick saved my phone.

BT Pan Android

Hey guys,
Let me start by introducing myself. I am Alcanzer, a small time, new to the game, android developer. I'm working on a project that requires Bluetooth Pan to access the internet from a raspberry pi. I tried a few code snippets from Stack Overflow but I keep running into exceptions regarding tethering permissions. I set the permissions in manifest but I think I need to request them programmatically. Does anyone know how to request tethering permissions programmatically?(I would've posted my StackOverflow link here, but I'm not sure about the XDA rules regarding outgoing links).
I'm happy to provide any other information regarding this problem of mine.
Thank you!
Tethering
Since Android 6.0 (API 23) users grant permissions to apps while the app is running, not when they install the app.
You need at least two permissions:
CHANGE_NETWORK_STATE
WRITE_SETTINGS
Example code to ask permissions:
Code:
ActivityCompat.requestPermissions(new String[]{Manifest.permission.WRITE_SETTINGS}, MY_PERMISSIONS_REQUEST_WRITE_SETTINGS);
// override onRequestPermissionResult method in your activity
@Override
public void onRequestPermissionsResult(int requestCode,
String permissions[], int[] grantResults) {
switch (requestCode) {
case MY_PERMISSIONS_REQUEST_WRITE_SETTINGS: {
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
// permission granted
} else {
// permission denied
}
}
}
}
FSP Dev said:
Since Android 6.0 (API 23) users grant permissions to apps while the app is running, not when they install the app.
You need at least two permissions:
CHANGE_NETWORK_STATE
WRITE_SETTINGS
Example code to ask permissions:
Code:
ActivityCompat.requestPermissions(new String[]{Manifest.permission.WRITE_SETTINGS}, MY_PERMISSIONS_REQUEST_WRITE_SETTINGS);
// override onRequestPermissionResult method in your activity
@Override
public void onRequestPermissionsResult(int requestCode,
String permissions[], int[] grantResults) {
switch (requestCode) {
case MY_PERMISSIONS_REQUEST_WRITE_SETTINGS: {
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
// permission granted
} else {
// permission denied
}
}
}
}
Click to expand...
Click to collapse
Thanks for your fast reply, and sorry for my late one.
Just one question, would these 2 permissions enable me to use the Bluetooth pan/tethering? Forgive my naivety but camera has permission.camera, internet has permission.internet and so on.
Thank you!
Bump!

Reading from Serial port in Android

Hi, I was following this tutorial to read from Serial ports in Android which is based on this google api. I don't want to read from USB because it was having some issues.
But it seems from android latest versions (after 4.4 and onwards) you can't have access to serial ports without rooting :
Code:
2021-07-15 10:37:47.975 7507-7507/com.example.serialjni D/serial_port: init native Opening device!
2021-07-15 10:37:47.975 7507-7507/com.example.serialjni D/serial_port: Opening serial port /dev/ttyMT1
2021-07-15 10:37:47.972 7507-7507/com.example.serialjni I/ample.serialjni: type=1400 audit(0.0:645): avc: denied { read write } for name="ttyMT1" dev="tmpfs" ino=7393 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:ttyMT_device:s0 tclass=chr_file permissive=1
2021-07-15 10:37:47.972 7507-7507/com.example.serialjni I/ample.serialjni: type=1400 audit(0.0:646): avc: denied { open } for path="/dev/ttyMT1" dev="tmpfs" ino=7393 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:ttyMT_device:s0 tclass=chr_file permissive=1
In other questions I have found that enabling SELinux mode might work. But the app I tried with SELinuxModeChanger doesn't work (it shows both button as grayed out). My understanding is that the android device needs to be rooted. But it's a chinese car autoradio and it might become unusable as there are many custom things. Is there any other way to read serial without going root ?
Thanks for your help in advance.

Unable to give permission

java.lang.SecurityException:
Permission Denial: starting Intent {dat-package:com.jami.tool.hiddensetting cmp=com.android.settings/.Settings $AodRealmeSettingsActivity (has
extras) mCallingUid=10243 ) from ProcessRecord(7b8b86b 22058:com.jami. tool.hiddensetting:shy.luo.process.sub/ u0a243} (pid-22058, uid-10243) requires oppo.permission.settings.LAUNCH FOR_EXPORT
my pc is showing this error while giving permission

Categories

Resources