Giving permission not declared in AndroidManifest - General Questions and Answers

Hi! So Im creating a Theft Protection Profile for Tasker so you need only to download the script.
This entire profile is self-sufficient so after importing it will auto start. Most Android phones, MIUI in this example, has the ability to set the time for auto booting if in power off state, I managed to decompile the Settings app and used Java Function in Tasker for calling the system methods. I need to call setWakeUpTimeBoot() but I receive an error saying that the current app has no permission for "com.miui.permission.MANAGE_BOOT_TIME".
How can I add this permission to an app even if is not declared in his AndroidManifest?
Root (Magisk): Yes, Xposed: Yes, any ideas?

Related

[Q] Connecting to DBUS API on unrooted Android phone to connect an HID device

Hi everyone,
I'm trying to write an android program which will allow users to connect to an HID device. The device captures external pen strokes and I would like to retrieve this data and make a basic whiteboard app.
I've made some progress so far: if I use adb push to put the "hidd" daemon on a rooted phone and use hidd --connect, then I can open up hcidump and see the raw data appearing when the pen is used, so I know such a connection is possible.
I'm still a beginner at Android development, but I've learned that app communication with the bluetooth facilities is done via the dbus API. So, I wrote a simple test program using the NDK that tries to make a connection to the system dbus, based on some bluetooth-related code in mydroid/bin/frameworks/base/core/jni:
DBusConnection *conn = dbus_bus_get(DBUS_BUS_SYSTEM, &err);
On my non-rooted phone, this results in the error "VERBOSE/JNI1Activity_DEBUG(3226): Result: Could not get onto the system bus: Failed to connect to socket /dev/socket/dbus: Permission denied."
If I go ahead and do chmod 666 on /dev/socket/dbus on my rooted phone, then the connection can be made without error.
So, my question is this--first of all, am I going about this the right way? If so, is there some way that an application can get permission to talk to dbus on a non-rooted phone?
(If I can get this working, I think the next step would be to try and package/build in the needed parts of hidd to include with my app...)
Many thanks for any help,
Tom
Hi pyro777,
I was wondering if you received any replies on your query?
I also have a similar problem -- my android app accesses Dbus via a JNI, but I am getting the same permissions problem. I can use your workaround of explicitly setting the permissions on /dev/socket/dbus, but that solution can't be used for production code.
My Android java app as BLUETOOTH permissions, but this doesn't appear to be applied across the JNI boundary (as my experience indicates) into the JNI c++ library (*.so).
Does anyone have more info on this issue?
Thanks in advance,
robin
Hi evodevo,
No, no such luck so far if you figure it out I'd be happy to hear.
Strange, if this fails how does the normal Bluetooth java API it?
Perhaps certain permissions need to be set on your app? BLUETOOTH_ADMIN or so?
question 4 u: which libraries do you include when doing dbus stuff I get undefined references the whole time?

[Q] How to write to Settings.Secure?

I want my app (PerApp) to write to Settings.Secure on rooted devices, but without having the app to be installed in /system/app.
Any suggestions on how to do it?
One possibility is to launch a component of the app with root privileges via app_process, and then have the component with a static main() use reflection to access Settings.Secure. The latest version of my Force2SD does that successfully to access hidden functions of the packagemanager. However, the problem is that the standard API for Settings.Secure needs a Context, and I don't know how to gain a working Context for something that starts from the commandline with a static main().
I could include a sqlite3 binary, but I am concerned about the stability issued with writing directly to the settings database on the fly, and don't know if the OS will register the changes immediately. Moreover, loading a large binary like sqlite3 will slow things down.

How can I make an app to access and send whatsapp key?

Is it feasible to do an app that automatically accesses the whatsapp key file, that from my understanding is located in /data/data/com.whatsapp/key, and sends it to a listener ip location, or by email?
To access that file, one has to have su privileges. So, could the app use a su command and prompt the user for authorization? The ideal would be to do it without rooting, like with a custom APK that managed the whole thing. ADBing the app from within the phone?
I think one could do this (with rooting :S) with metasploit, but it is quite a questionable tool to use, as my intentions are completely benevolent and I would like to make the script as direct and transparent as possible.
How could I do this? Any guidelines are hugely welcome!

2 questions. Add a notification panel, Add a permission to an app

So I took a gamble on a cheap smartwatch (Yeah I know, you get what you pay for) which comes with full Android 5.1.
I've noticed two things that really make it hard to use. First of all, there is no notification panel. The built in launcher has a really whacky way to open and dismiss notifications but there's no way of accessing notifications once you changed the launcher since it's not a notification app that I could perhaps launch using a gesture.
The second weird thing is that google fit does not have the permission set to use the phone sensor. I can find apps that remove permissions for apps on a rooted phone, but not add one. Is there a way?
I've rooted the watch and have access to Magisk Manager. I can't get the phone into fastboot even with adb - this somewhat limits me on tinkering more.
Anyone have an advice or suggestions?
Sideburnt said:
The second weird thing is that google fit does not have the permission set to use the phone sensor. I can find apps that remove permissions for apps on a rooted phone, but not add one. Is there a way?
Click to expand...
Click to collapse
You only can grant/revoke permissions that are defined by app's developer in app's AndroidManifest.xml. You can try to add extra permissions of your choice to that file.
Example:
Code:
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
jwoegerbauer said:
You only can grant/revoke permissions that are defined by app's developer in app's AndroidManifest.xml. You can try to add extra permissions of your choice to that file.
Example:
Code:
<uses-permission android:name="android.permission.INTERNET" />
Click to expand...
Click to collapse
That's the strange thing, on my phone the app has BODY_SENSORS permission granted, on the watch it doesn't.
I'm not sure if that's a restriction of the OS implementation or Android 5.1.
Through ADB if I try and run
"adb shell pm grant com.google.android.apps.fitness android.permission.BODY_SENSORS".
I get the error "Operation not allowed: java.lang.SecurityException: Package com.google.android.apps.fitness has not requested permission android.permission.BODY_SENSORS".
So I can't seem to add it if it was never included in initial installation of the apk through google play. I can only enable USB debugging through developer options and have no access to turn off Disable permission monitoring.

Accessing Textfile from Xposed module

I trying to develop an Xposed module that would profile power and time consumption of apps on Method level so What I have for the user side is a simple list with check-boxes once and each list Item represents an App once an App is checked I get The dexfiles get all classes in the main package and get all methods as well all of this is then saved to a textile (tried using sharedprefrences but couldn't because of mode_world_readble throughing security issue ) what I want to do is to open the text file from the xposed class and read the save class names and method names to set hooks dynamically but I don't know where to place my code in xposed to make sure that the arraylist I've retrieved from the file is available i tried even leaving the code in "handleLoadPackage" without any conditions just to see what will happen some packages manged to read the file others failed not sure why I'm guessing it's something to do with permissions but not sure how to solve

Categories

Resources