[discussion] what does it really mean to root a smartphone ? - Magisk

am struggling to understand what is the real meaning of a root
in the electronic meaning
like for example i want to access the camera chip , i want to see the data of 01 01 01 going on in some file when i capture a photo , i couldn't find this in my files even with root or whatever
i want for example to access radio , i need some kind of file that will ho me exactlly whats going on with my radio , with 01 binarry ,(not exactly but u guys got it)
so does the root of the device really means i have my phone working in some way that i can modify , for example i can make a program that will keep enabling and disabling my bluetooth chip every milisecond , its possible but there is no such thing in kernel i guess
so rooting your device is not actually what u want when u root a device

In short, no. hardware and the implemented RTOS is proprietary, it isn't controlled by android at all. you can just let android "talk" to hardware, but you can't modify the closed source firmware of a smartphone.
If you want to access radio, this has nothing to do with linux. here is example for the Samsung Galaxy S II
[A][SGS2][Serial] How to talk to the Modem with AT commands
This is a LIVE guide to communicating with your phones modem by AT commands. The information contained here is collected on a continuous basis from various places after having some trouble finding all relevant information in one place. Now this...
forum.xda-developers.com

Rooting a device doesn't really have any electrical meaning, and as alecxs mentioned, won't give you hardware level access, as peripherals, such as the bluetooth chip are not controlled directly by the main application processor, as this would result in very low power efficiency and your Android OS would run slow with high CPU usage.
To learn what what rooting DOES do, you have to learn about privilege in computing. A long time ago, we realised it's not a great idea to give every user & application they run full access to the system, so, systems for managing different user accounts, to isolate Joe's applications & data from Emily's. Privilege can be enforced by the CPU at a low level (see: cpu rings, memory access control), which works with the system to ensure that the OS' security mechanisms aren't being bypassed.
On Linux and other UNIX like systems, there's a user called 'root', which bypasses almost all privilege checks & security mechanisms.
On an Android phone, you do not have access to this root user, your apps and your ADB console run as a user with very little privilege, and a lot of everything you or an app wants to do (i.e. put something on the screen, access hardware devices), has to go through an Android API call, which runs at a higher privilege level, and checks who's running this API call, and if they're allowed to do it (prevents the camera app from accessing your bank details!).
What rooting a device does is install a sort of backdoor (usually called 'su') that allows you, the user, and any applications to request root privilege (this is the "Superuser request" dialog that comes from Magisk/SuperSU). You still don't get full privilege as a lot of features are never exposed outside of the kernel

Related

[Q] Android development capabilities

Hey guys,
I'm in the very very early stages of my masters work and I was toying around with the idea of using an Android tablet for part of it. I want to ask you devs what can be done when modifying the Android OS itself specifically in terms of a few things.
1. Logins - I would like to implement a classic user/password combination with levels of access for user, administrator, and some sort of superuser.
2. Restriction of User account - I would like to lock the user into one particular application. It must be relaunched when the device is booted and if the application crashes (hopefully not!) it must be restarted. Additionally, no market access, web access, etc.
3. Remote management if possible
4. Data encryption if possible
5. Prevent anything from being introduced from USB ports, SD slot, etc if unwanted.
I guess this brings me around to - is Android even the most suitable platform for such an endeavor. I'm not sure, to be honest, but I would love to get into development myself and this seems like a great way to learn. This is all just one part of a much larger project that I don't want to discuss just yet so sorry for being lax on details.
Thanks guys!
Android runs a virtual machine system called dalvik, in which each application gets it's own insuranceof the machine. It's implemented in such a way that each application gets assigned a user id, which unfortunately for you means each app is a different user, at least to the system. That's going to be a major wrench in the multi user plans. taking that into consideration, to have the same level of control over your tablet you'd have to give even the most basic user level "root" access or else the apps will start crapping their collective pants. As far as unwanted usb, there are a few apps that implement this functionality freely available through the market. Same with remote management. What I haven't seen yet is total encryption and I don't know enough about it to say it's possible or not. Seems feasible though.
My advice: write a custom login screen widget and then bake all these features into a pretty rom.

[REF]Android terminology for newcomers

I got useful information From thread posted by ThC23. Credit goes to him
ThC23 said:
Decided to post this for anyone that is curious and wants to know the terminology used in these roms.
I take NO CREDIT for this, just wanted to share my findings. Source below. Let me know if I missed any.
http://wiki.cyanogenmod.com/index.php/Terminology
http://www.addictivetips.com/mobile/what-is-odex-and-deodex-in-android-complete-guide/
TERMINOLOGY -
*CWR aka ClockworkMod Recovery-
A custom recovery for Android phones and tablets that allows you to perform several advanced recovery, restoration, installation and maintenance operations on your Android device that aren’t possible with the stock recovery.
*Superuser-
A progam which gives unlimited access privileges to perform any or all operations on the operating system.
*KIES mini-
Kies Mini is an official application from Samsung that is used to update the software on your phone. It should not be confused with the full Kies application, which has a lot more functionality and is not officially supported in the USA. Therefore, abbreviating "Kies Mini" as just "Kies" can cause confusion.
*ODIN-
Odin is the Samsung software used to update Samsung phones. It does not work with any other devices other than official Samsung phones.
*OTA or FOTA-
(F)OTA stands for (Firmware) Over The Air and is the process by which required updates and enhancements to your phone's basic operating system can be sent to you through the cellular network. The Galaxy S II software update will be sent via FOTA and is available through Samsung Kies mini.0
*ODEX-
In Android file system, applications come in packages with the extension .apk. These application packages, or APKs contain certain .odex files whose supposed function is to save space. These ‘odex’ files are actually collections of parts of an application that are optimized before booting. Doing so speeds up the boot process, as it preloads part of an application. On the other hand, it also makes hacking those applications difficult because a part of the coding has already been extracted to another location before execution.
*DEODEX-
Deodexing is basically repackaging of these APKs in a certain way, such that they are reassembled into classes.dex files. By doing that, all pieces of an application package are put together back in one place, thus eliminating the worry of a modified APK conflicting with some separate odexed parts.
In summary, Deodexed ROMs (or APKs) have all their application packages put back together in one place, allowing for easy modification such as theming. Since no pieces of code are coming from any external location, custom ROMs or APKs are always deodexed to ensure integrity.
*Busybox-
A set of Unix tools / commands that has been compiled for use on your phone. These are not usually full-featured versions of the Unix commands found on the larger platforms counterparts, but they are pretty close and useful nonetheless.
*3G/4G-
3G/4G is the term generally used to describe 3rd/4rth Generation mobile telecommunications, specifically allowing for greater throughput of data over cellular networks.
*Baseband/Modem-
Baseband refers to the original frequency range of a transmission signal before it is converted, or modulated, to a different frequency range.
*Bloatware-
Software or 'apps' that you don't need, but come preinstalled to a device's /system partition, meaning that you cannot remove them unless the device has been rooted. Usually, these are apps are sponsored by a company and included by a carrier for profit. For example, the Photobucket app included on the G2 by TMobile.
*CDMA-
Code division multiple access (CDMA) is a channel access method used by various radio communication technologies. It should not be confused with the mobile phone standards called cdmaOne and CDMA2000 (which are often referred to as simply CDMA), which use CDMA as an underlying channel access method.
*Firmware-
Programs stored in the ROM, EPROM, or flash memory that usually control various internal electronic devices (Hard Drives, Keyboards, Displays, etc). Firmware is typically 'fixed' software that is not updated in consumer devices, however it is often updated (or 'flashed') by advanced users to fix bugs or add features to the device. Flashing firmware designed for one device onto a different device, or not following a specific procedure while flashing will often render the device unusable.
*Flash-
Non-volatile computer storage that can be electrically erased and reprogrammed (similar to EPROM). No power is needed to maintain the information stored in the chip. This technology is primarily used in memory cards and USB flash drives for general storage and transfer of data between computers and other digital products. Because of its ease of use, speed, ability to be updated (see flashing), this technology is often used in mobile devices, PDAs, digital media players.
*Kernel-
The central or core software component of most operating systems. Its responsibilities include managing the system's resources (the communication between hardware and software components) and can provide the lowest-level abstraction layer for resources (especially memory, processors, and I/O devices).
*IMEI-
The International Mobile Equipment Identity is a number unique to every GSM, WCDMA, and iDEN mobile device, as well as some satellite devices. The IMEI number is used by the GSM network to identify valid devices and therefore can be used to stop a stolen device from accessing the network. For example, if a mobile device is stolen, the owner can call their network provider and instruct them to "ban" the device using its IMEI number. This renders the device useless, whether or not the device's SIM is changed. The IMEI can be displayed by dialing *#06#.
*IRC-
Internet Relay Chat. Basically a chatroom, or a cross between Instant Messaging and a forum.
*Open-source-
Open-source is software that anyone is allowed to see the 'source' code. In the context of Android, Open-source refers to the approach to the design, development, and distribution of software. This offers accessibility to a software's source code for modification, improvement, bug-fixing, and security-enhancement. CyanogenMod is based on this principle.
*ASOP-
Android Open Source Project
*Radio-
The cellular radio on the device which needs control software called firmware to control it.
*ROM-
Read Only Memory. In the context of an Android device, ROM is the internal flash memory where the core operating system resides. It can also refer to a specific version firmware that can be applied to a device through a process usually referred to as flashing. An improperly flashed ROM can often brick the device, rendering it unusable.
*SDK-
Software Development Kit. You can find the Android SDK at http://developer.android.com/sdk.
*Vanilla-
A clean, unmodified version of something. In the context of Android ROMs, vanilla refers to the stock ROM that came pre-installed on the device.
*Widget-
An application that lives (in other words, is always running) on the homescreen instead of being 'run' like a regular app. Common examples are calenders and weather widgets.
Android Specific Definitions
*ADB-
Android Development Bridge. Command line tool used to communicate with & control the device over a USB link from a computer. The ADB command is found in the Android SDK.
*Android-
Unveiled on 5 November 2007, Android is a mobile operating system running on the Linux kernel developed by Google.
*Apps2SD-
Move applications from the internal NAND memory on the device to a removable SD Card.
*CyanogenMod Updater-
An updater written by Cyanogen that allows you to receive OTA (Over-The-Air) updates to CyanogenMod.
*Dalvik-Cache-
The dalvik-cache directory holds all of the pre-compiled .dex files created from installed apps. These files are static and do not change unless the app is updated.
*Fastboot-
Fastboot is protocol used to directly update the flash filesystem in Android devices from a host over USB. It allows flashing of unsigned partition images. It is disabled almost all production devices since USB support is disabled in the bootloader.
*GApps-
See Google Apps.
*Google Apps-
An add-on for Google's applications (Market, GMail etc.), packaged separately to avoid copyright issues
*Logcat-
A debugging tool built into Android devices that displays system logs as they occur. See Logcat.
*NANDroid-
A set of tools that will enable anyone who has root on their Android device to make FULL system backups, in case something goes wrong or you want to try out that new experimental ROM/theme. NANDroid will backup (and restore) /system, /data, /cache, and /boot partitions.
*Recovery Mode-
A special environment that you can boot into for troubleshooting and upgrading purposes.
*Tethering-
Using a wireless device (e.g. an Android phone) to share it's wireless data connection to another device (e.g. laptop). With an Android device, the wireless data connection can usually be shared via WiFi, Bluetooth or USB connection.
*Wipe-
Usually refers to wiping data and cache partitions of the device.
*Zipalign-
Reduces the amount of RAM consumed when running the application by allowing data to be mmap'd in; which causes all uncompressed data within the .apk, such as images or raw files, to be aligned on 4-byte boundaries.
Hacking Definitions
*Aftermarket-
Aftermarket generally refers to any product or service applied or requisitioned by end-users to add usability or functionality to the original product. Many aftermarket modifications can void the manufacturer's warranty. From a manufacturer's perspective, the after-market is any goods or services offered by the manufacturer directly to end-users of a given product or service. After-market services include support for warranties, contracts, and parts and accessories sales.
*Brick-
a device that no longer functions, generally caused by a failed firmware or SPL update. Since the device no longer works as intended, it is often referred to as a "brick" or "paper-weight", since that is all it is good for.
*Flashing-
The process of applying a firmware image (or ROM) to a device. It generally entails a very specific order of steps. Failing to complete any one of these steps properly may result in bricking the device.
*Kang-
The process of creating a code based of someone else's code or reapplying code that someone else created into your own code (e.g. git cherry-pick)
*Rooting-
Obtaining root ("administrator", or "full") access to the device. This means you can mount its internal memory partition as read/write, which lets you do various things: have USB or Wi-Fi tethering, uninstall applications you otherwise can't uninstall (e.g. the Amazon MP3 store), install applications that need root access (such as AdFree), disable the camera shutter sound (simply by deleting the shutter sound file), overclock or underclock the CPU, install and boot Debian, and so on. Installing CyanogenMod roots the device in the process. The "Superuser" app controls what applications may gain root privileges.
*Unlock-
Most GSM devices are locked to only work with the sim cards of a particular carrier. Obtaining root access (e.g. installing CyanogenMod) on the device usually does nothing to the sim-lock. The usual way to unlock the device to all SIM cards is to obtain a subsidy unlock code from a carrier.
Click to expand...
Click to collapse
For beginners it would be something:]
Yeah it's very helpful ^-^

Thinking of switching, but I'm looking for 2 specific apps

I have been using Android since the G1 launched, I took one break from it about a year ago to give the Nokia N9 a try (great phone, poor battery life). I am considering switching to Windows Phone 8 (Lumia 920) after it launches. There are two apps that are really important before I make the switch though.
- LBE Security Equivalent. This is a 'firewall', but for application permissions. You can have it prompt you that application 'x' is trying to read from contact data, for instance. If something this exact isn't readily available, is there at least a network based permission firewall? Some applications are fine to use, but I don't necessarily want them to connect to the internet.
- Tasker. This is the bigger of the two that I need to have. If you're unfamiliar with it, Tasker lets you change any device settings, based on any other condition. E.g., if it's between 8am-5pm and I can see the wireless network, "Work", then put the phone on silent... if it doesn't meet those conditions put it back on loud. Very basic example, but I need something like this because it makes my life a lot easier.
I searched around and couldn't find anyone really talking about either of these options too much, can anyone help me out?
Neither one of them is possible with the current SDK, maybe when wp8 pops up.
Windows Phone does not allow any Apps to interfere with System Settings or other Apps. All Apps are sandboxed with only certain interaction points to exchange data or embed themselves into the Hubs. Having looked through the leaked SDK this is not changing with WP8, although there are additional interaction possibilities other Apps functioning as well as system settings are still off limits.
You can look at what permissions certain Apps request before installing them but the only thing youncan do then is to decode not to install them (aside from using background processing and using location data - those can be configured separately).

Accessing features in Windows phone 8(.1) development

When developing an application for desktop windows, there's always a way to access functionality - sometimes through back doors like the registry, etc... I'm developing an application for Windows Phone 8.1, but there are certain pieces of functionality that aren't exposed in the PRT APIset that is available to me. For example, we want to ensure that the user has password protection on the lock screen when using the application. There doesn't seem to be any associated APIs to readily use. So my question is, are there back door ways to do such things? How? Is there a way to access ALL system settings - like a registry or something of the like?
proch said:
When developing an application for desktop windows, there's always a way to access functionality - sometimes through back doors like the registry, etc... I'm developing an application for Windows Phone 8.1, but there are certain pieces of functionality that aren't exposed in the PRT APIset that is available to me. For example, we want to ensure that the user has password protection on the lock screen when using the application. There doesn't seem to be any associated APIs to readily use. So my question is, are there back door ways to do such things? How? Is there a way to access ALL system settings - like a registry or something of the like?
Click to expand...
Click to collapse
Another question would be - if something like intune can enforce lock screen password policies, shouldn't I be able to do it the same way that intune does it? If so, how? If not - why not?
It's not possible to check if user enabled lock screen password or not as far as I know
but if you want to made your app secure (because it may include important data)
you can create a password for your own application !
I did it in a little notepad app my password page allow user to set a password with all English and Persian Characters , numbers and special Chars like [email protected]#$ and etc.
Sent from my RM-994_eu_poland_1183 using Tapatalk
It's pretty easy to check, using the registry, but at least in 8.0 that's not allowed at all for store apps (your app would get rejected). I don't know if the rules changed for 8.1. There are ways to sneak past the store checks, but they could pull your app from the store if they ever found out. I know of at least three ways to access the registry APIs (4 in WP8.1) and two of them are pretty hard to detect unless somebody checks for them specifically... but they're the kind of technique that malware uses, so such checks may be in place.
I don't know what InTune is doing, specifically - I'd need to pull the app apart to see - but there are special application capabilities (not normally available to third-party developers) that can query and even set policies. Apps without those capabilities will get Access Denied if they try to use the same methods though, and normally you can't add those capabilities to your app.
GoodDayToDie said:
It's pretty easy to check, using the registry, but at least in 8.0 that's not allowed at all for store apps (your app would get rejected). I don't know if the rules changed for 8.1. There are ways to sneak past the store checks, but they could pull your app from the store if they ever found out. I know of at least three ways to access the registry APIs (4 in WP8.1) and two of them are pretty hard to detect unless somebody checks for them specifically... but they're the kind of technique that malware uses, so such checks may be in place.
I don't know what InTune is doing, specifically - I'd need to pull the app apart to see - but there are special application capabilities (not normally available to third-party developers) that can query and even set policies. Apps without those capabilities will get Access Denied if they try to use the same methods though, and normally you can't add those capabilities to your app.
Click to expand...
Click to collapse
Thanks for this great and detailed information. See, that's exactly what I'd do if I were developing a desktop app - since i know that intune does it, I'd figure out how intune does it and voila. I'm finally getting over the idea that the same methodologies apply to windows phone development.
For my own educational purposes (since I want to understand this platform better), I would really like to know specifically how you go about accessing the registry APIs (for example). If there's any way for you to describe any number of these methods, I'd greatly appreciate it. Thanks again!
My NativeAccess libraries (check my signature, or search on the forum or on Codeplex) contain an example of one way to access the registry. The code is open-source; you may use the libraries as-is (don't expect to get them into the store, though I won't stop you from trying), use the source code as a reference, or modify/build them yourself; the license is very liberal (MS Permissive). The functions I use are generally documented on MSDN, in the desktop APIs section; the phone has the same functions, although the DLL names are changed and the header files hide them.

Windows phone security- is there one and if so, how does it work?

Hi,
So, Android has a permission system which albeit somewhat flawed (malware can gain permissions not intended for it) and not very suitable for laymen (non rooted phones have to either accept all permissions or be denied from the app. In many programs people don't have the luxury of not using them) theoretically has merit. IOS has...well actually I'm not sure how it works security wise but I pressume it creates sandboxes for each app, layman wise it is reasonable since you (theoretically) can deny access for all programs to certain components (no need to jailbreak).
How does WP works?
Thank you.
Security is different, apps can't do as much as on android. But iOS is better in this, because capabilities are like in Android: you can see what the apps want prior to installing them, but blocking some of them isn't possible.
I am very saddened to hear this.
Is there an ability in place similar to Androids rooting?
Also, what do you mean by "apps can't do as much as on android"?
Thank you!
@th0mas96's post is technically *mostly* accurate but very confusing and doesn't actually answer your question at all.
The short version is that WP apps use a capability-and-sandbox system much like iOS and Android, with each app getting a sandbox that gives it read-only access to the app-specific install directory and the global system directory, read/write access to the app-specific data directory, and access to whatever other stuff is specified in the capabilities. Capabilities are currently all-or-nothing; you can't reject or disable any capability except by just not installing the app.
I could go into the technical implementation of the system a bit, but the short version is that WP8 apps use fairly standard NT (as in the NT kernel that is at the core of PC Windows versions) security features: each app has a unique token (rather than inheriting the token of the process that crated it, the way it normally works on PC but very much like how Windows Store apps work on Win8) which contains the app-specific Security IDentifier (SID) that gives access to the app directories, plus the SIDs of the various capabilities that the app has.
What @th0mas96 was talking about is that WP capabilities usable by third-party developers are much more restrictive than they are on Android. For example, Android allows an app have full read-write access to your contacts or to send SMS directly. WP8 doesn't allow that unless you use capabilities that are normally neither allowed on the store nor allowed in sideloaded apps (Microsoft's code can have them, of course - that's how the built-in SMS app works - but not Joe Random Dev). The downside of this is obvious; some app behaviors (like a full replacement for the SMS app or phone dialer) are not possible. The upside is that apps are *way* more limited in how malicious they can be; the most common way that Android malware makes money (remember, the vast majority of malware is for profit) is by sending SMS to "premium" numbers. On WP8, an app could *compose* such a message, but it couldn't *send* it for you (unless it had a capability that third-party apps normally can't have) so you'd have a chance to see what the app was doing and decide not to send that message after all.
This means that the ability to disable capabilities is much less important on WP8 than on Android.
Oh, then those restrictions are actually good news.
Aside from from your typical run-of-the-mill malware my main concern was actually privacy. I have a huge displeasure from apps like Whatsapp which on android takes a whole plethora of liberties and was hoping that perhaps some other system may contain their user data voracity and their ability to control the divice their on.
Is there any link in which I could see the full list of those restrictions?
I'm still downhearted from not having a more fine grained control of the system but maybe it still has it uses in some scenarios...
Also, thank you very much for your comprehensive explanation!
i found a tiny file stored inside some of the unbranded htc accord RUUs. its call disablewriteprotect.test. the only thing the file contains is a sentence stating write protection will be disabled until this file is removed. followed by a music note and some other symbol. so there you go thats how you make your entire htc 8x read and write. one file less than 1kb in size. ROOT!
but how can we flash this file. im still working on it. this file is located within the efi partition which also houses the ffuloader.efi, and severl other efi executables. check this post http://forum.xda-developers.com/showthread.php?p=53687985#post53687985
you wont find that on google search.
Sent from my Galaxy Nexus using XDA Free mobile app
Window phone Security Issues
Your Windows Phone is secure by design. Many security features are turned on by default. For example, apps you download from the Windows Phone Store are tested by Microsoft and encrypted to make sure you don't accidentally install malicious software on your Windows phone.
Set a password
Setting up Kid's Corner
If you've ever handed your smartphone to a child, you know that they can quickly get into all sorts of apps and settings they shouldn't. No such worries with Kid's Corner, a place on your phone where your child can play with the games, apps, music and videos
Use the free Find My Phone service
Say yes to updates . check out more at Master Software Solutions - Windows Phone Update
grilledcheesesandwich said:
i found a tiny file stored inside some of the unbranded htc accord RUUs. its call disablewriteprotect.test. the only thing the file contains is a sentence stating write protection will be disabled until this file is removed. followed by a music note and some other symbol. so there you go thats how you make your entire htc 8x read and write. one file less than 1kb in size. ROOT!
but how can we flash this file. im still working on it. this file is located within the efi partition which also houses the ffuloader.efi, and severl other efi executables. check this post http://forum.xda-developers.com/showthread.php?p=53687985#post53687985
you wont find that on google search.
Sent from my Galaxy Nexus using XDA Free mobile app
Click to expand...
Click to collapse
Sounds interesting.
Not something I'd try )) but interesting.
Aman Raien said:
Your Windows Phone is secure by design. Many security features are turned on by default. For example, apps you download from the Windows Phone Store are tested by Microsoft and encrypted to make sure you don't accidentally install malicious software on your Windows phone.
Set a password
Setting up Kid's Corner
If you've ever handed your smartphone to a child, you know that they can quickly get into all sorts of apps and settings they shouldn't. No such worries with Kid's Corner, a place on your phone where your child can play with the games, apps, music and videos
Use the free Find My Phone service
Say yes to updates . check out more at Master Software Solutions - Windows Phone Update
Click to expand...
Click to collapse
I pressume this is an advert for Master Software Solutions, but nevertheless I did google the term you suggested and got nil results. I also browsed the main site of the company itself but haven't found anything related, nor did I find anything on their facebook page.
Regardless, I checked out this Kids corner thing, it's cute but not really security related...
Thx anyway.

Categories

Resources