How to enable flight mode with root android 7? - android

Interested in such a question. Everywhere I read that on android 7 it is programmatically impossible to turn off flight mode. And they write that if there is a root, then everything can be done. And I see that there are programs that allow you to programmatically enable flight mode (Tasker for example).
Question
How the root helps turn on flight mode. Do we have access to new features? Or there is editing files (adding scripts). Describe in the general process, if possible, at least a general idea.

With root, you get access to modify system files. It is usually due to this that many apps do not work if you have a root. Generally speaking, when you have the ability to modify these system files, you or any other app can make any change to your device.
I really suggest that you go visit xda. You will find a massive community that is super interested with this kind of stuff. The community there is very well versed with rooting and custom ROMs which I believe you may find interesting based on your question.

Related

Disable/Remove root access on Android

Is it possible to disable or remove the root access programmatically on Android? Thank you
A "user" (vs "userdebug" or "eng") build of official Android sources does not feature any sort of root access as a designed feature.
This is what you normally get on a production end-user device from a name brand vendor. In contrast, it is not uncommon for cheap devices of uncertain origin to ship with one of the other build varieties (though that is not necessarily a bad thing, as such half-finished builds often have flaws you need this capability to fix).
Of course nearly any software project has the potentially to be intentionally exploited, and someone's modified customization of Android could include anything under the sun, but those are different topics and far too broad for Stack Overflow where questions must be specific.
In terms of removing exploits or escalation toolkits installed as part of a custom ROM - to remove them, you would have to ask a question that was specific about what they were and how they worked. It is likely however that you would need to have the capability to make lasting changes to the system partition, something that can be as much about hardware locking and bootloader/recovery capabilities as it is about having root access after a complete boot (root can't make a lasting change if the flash is locked; conversely, if you can write to the flash without booting the normal system, root matters less).

How to record the activities of an android phone

I'm hoping to write a tweak to record all activities running on a rooted Android phone. For example, I want to record the information such as:
2012-07-31 15:03 app1:Activity01:onCreate()
2012-07-31 15:04 app1:Activity01:onStart()
...
2012-07-31 15:05 app1:Activity01:onPause()
2012-07-31 15:05 app2:Activity01:onResume()
Is is possible to do it? If so, please kindly tell me where to find the related information, books or domain knowledge I should study to accomplish this task. I'm new on Android programming but familiar with C++ and Java.
Thanks a lot!
Each Android app is executed in its own process running its own instance of the Dalvik VM. The VM normally does not provide the information you are looking for across process boundaries.
If you feel like really hacking your Android you could investigate into these two approaches:
Modify the Android API classes, basically building your own android.jar, where you can override and extend existing functionality.
Try to use the VM's debugging facility to gain access to its runtime state (see e.g. Dalvik VM debug monitor).
Bottomline: Rooting your phone is child's play compared to those hacks.
However, I would advise against trying to 'hook' into Android the way you described, both for performance and stability reasons.
So the answer was it ain't possible in a normal app, even on a rooted phone.
See comments :-)

How to programmatically create a new VPN interface with Android 4.0?

I'd like to know whether it's possible to create a VPN interface programmatically with the new VPN APIs in Android 4.0. I've looked through http://developer.android.com/resources/samples/ToyVpn but this is about creating a complete VPN client that handles the connections etc. I only want to add a new VPN configuration and possibly remove existing ones.
There are lots of questions like this but they all seem to be pre 4.0. I understand that previously this wasn't possible, but one would think that the new VPN APIs provided such functionality. So has anyone found a way to do this, or is it still not possible? If there is a way, please point me to the right direction.
It appears that this is handled internally via the com.android.settings.vpn2.VpnDialog (and related) classes, which basically do KeyStore.getInstance().put("VPN_[VPN ID]", [encoded VpnProfile object]>) -- which then causes files with names like "/data/misc/vpn/1000_VPN_[VPN ID]" to get created (where 1000 is apparently the system process ID).
Using reflection (or one of the hacks to access the hidden / internal APIs) you can do this yourself, but because your process will not be running as the system process, the system VPN browser won't see them.
However, according to this (http://code.google.com/p/android/issues/detail?id=8915), there is at least one app that does this without a rooted phone, but the source doesn't seem to be available...so perhaps there's some way to do this that I can't figure out -- I'd definitely be interested if there is.
P.S. - Here's another similar question (though it's specifically asking about using a rooted device): Create VPN profile on Android
Yes, there is a way. Use AndroidVpnService, it helps you create VPN interface on the device, there exist methods to configure that programmatically.

Is it possible to restart the phone with Android SDK or NDK?

Is it possible to programmatically restart the phone from a application (service) running on top of the Dalvik VM?
If the SDK does not provide this functionality, then how about using the NDK and calling some functions provided by the kernel? I know this option is not preferred (not stable enough libs), but if it's the only option, I'll have to consider that as well.
Hopefully not. :-)
If it were possible to restart the phone at will, a malicious app could quietly do it at random intervals and make your life unhappy.
The NDK does not provide you with any additional abilities here, because Android relies on process boundaries and Linux access rights for security, rather than a Java-language sandbox.
Why do you want to do this? Maybe there's some other way to accomplish what you're after.
powermanager.reboot is available since api level 8.
requires reboot permission
I found the correct system calls in Linux that would do the trick and after hours of fiddling around with the NDK/JNI paths, I finally managed to call the function. The result was that I need super-user permission for that. I kind of guessed that this would be the case.
Is there anyway to overcome this problem? Other than rooting the phone, which I'm still trying to avoid.
It's still possible to reboot the phone with adb. I guess that communicates with ddmd or some other daemon, so could it be possible to somehow use the same functionality?

Android - Adding to a ROM and upgrading - Questions

** Not sure if this is entirely relevant to SO, it is programming related in nature but if its more suitable to a different forum please let me know and I will remove it **
I have a couple of questions for any Rom developers/experts on here regarding things that can be done with Android ROM's.
1) Is a parser Rom upgrade possible? So is it possible to change a small part of a ROM and then allow users to upgrade their ROM easily?
So can I change a part of a ROM and then a customer can upgrade to the newer ROM without having to be technically savvy and needing to root and flash their devices?
2) Can a change be burnt into a ROM so that when a user selects "Restore Factory Settings" that it doesn't remove the upgrade to the ROM?
3) So essentially I want to know if its possible (with a device manufacturers permission) to add to a ROM some small additional parts and then give this new ROM version as a firmware upgrade to the device so that a user only has to "upgrade" and not go through the process of rooting and flashing there device?
I'm not sure, but I feel that likely what you ask makes no sense: the whole point of rooting is being able to change the ROM.
Maybe if you give more details about what you really mean to do, someone will have a workaround that will satisfy you anyway.

Categories

Resources