jerdog · Nov 7, 2012 at 08:30 am

Chainfire Drops Some Superuser Knowledge

When you say “superuser” some might make the mental jump to an image of Superman flying around with a computer strapped to his back and a keyboard in hand to ward off the hacking attempts of mere mortals; others might jump to an image of Wonder Dog helping Wendy and Marvin fight the super villains; and still others will wonder if you’re referring to the latest culinary creation down at the corner of 8th & Sixth in NYC. Regardless, it evokes imagery that requires context to decipher what it is you’re discussing.

In the context of Android, Superuser has become synonymous with the Superuser app created by XDA Recognized Developer ChainsDD that grants you (and applications) root privileges by allowing you to accept the request or not. His app and process for obtaining root were the only options on the block for a long time, until XDA Elite Recognized Developer Chainfire sought a different solution to requesting and granting root privilege requests. The result of that endeavor was SuperSU, which has increasingly become a mainstay and is being included in more and more new custom ROM development these days.

Back in July Chainfire started a discussion on Google+ about his investigations on how developers were using root privileges, and had this to say about what he had begun to find:

Since I started writing SuperSU, I have investigated and reverse engineered a large number of apps that had problems with SuperSU, Superuser, or both. Aside from a few bugs in SuperSU (yes, they do happen), by far most problems were one of these two:

(1) Improper code calling “su”. I’ve seen a lot of weird Java code to execute commands as root – some you would not believe!
(2) Calling “su” from the main UI thread. “su” can be a blocking call. There is no excuse to run it from your main thread. EVER.

Even though #1 is not insignificant, #2 here is by far the most likely reason of crashes of a rooted app !

He then promised that he would have more to share after his holiday, and the Big Android BBQ is where he first teased us with his findings. He presented information about the correct (and incorrect) ways for an application to request root privileges and then promised that he would release his full article along with sample code. Now, he has. You can visit the original thread for more information or read the article on his website.


_________
Want something on the XDA Portal? Send us a tip!

jerdog

jerdog is an editor on XDA-Developers, the largest community for Android users. Jeremy has been an XDA member since 2007, and has been involved in technology in one way or another, dating back to when he was 8 years old and was given his first PC in 1984 - which promptly got formatted. It was a match made in the stars, and he never looked back. He has owned, to date, over 60 mobile devices over the last 15 years and mobile technology just clicks with him. In addition to being a News Editor and OEM Relations Manager, he is a Senior Moderator and member of the Developer and Moderator Committees at XDA. View jerdog's posts and articles here.
Mathew Brack · May 28, 2015 at 09:59 pm · 3 comments

I/O Summary: How Android M Handles Power And Charging

In the spirit of improving the core Android experience, Google is changing Android M to be smarter about managing power. Their new Doze feature comprises of two primary roles which allow Android to use motion detection in order to predict activity, and go into deep sleep at the right time based on accelerometer readings.   In order to extend your screen off battery life, Android M will now monitor your activity levels and if it detects that your device has...

XDA NEWS
Mario Tomás Serrafero · May 28, 2015 at 09:51 pm · 3 comments

I/O Summary: Google Photos App

At I/O 2015, Google tackled the information problem in mobile once more, this time through pictures: “how incredible is it that we all have a camera in our pockets at any moment? (...) These moments tell your story (...)[but] taking more pictures and videos makes it harder to relieve memories due to the sheer volume”. This is why they are revamping Google Photos and centering it around 3 big ideas:   Creating a home for all photos and videos that is...

XDA NEWS
Mario Tomás Serrafero · May 28, 2015 at 09:26 pm · 3 comments

I/O Summary: Development, Play Store, The Next Billion

VP of Engineering Jen Fitzpatrick began talking about what Google is doing to help “the next billion” come online. More and more people are getting their first smartphone, and for many people this first phone will be their first computer.   The majority of the next billion will be Android users and they “want to remove the barriers of smartphone adoption”. While there are huge displays of phones on sale, not all are able to run the latest and greatest...

XDA NEWS
Share This