Monday, July 31, 2017

root access - What is the difference between: Rooting, Jailbreak, ROM, Mod, etc.?


What is the difference between:



  • Unlocking the bootloader (prerequisite for doing many, though not all, other things below)

  • Rooting

  • Jailbreaking

  • ROM

  • NAND and Nandroid

  • Operating System

  • Mod (e.g. CyanogenMod)


  • Recovery (ClockworkMod, Amon Ra)

  • Custom Kernel (e.g. LeshaK's kernel)

  • Firmware

  • Driver

  • Over The Air (OTA) update

  • Fastboot

  • SIM unlocking

  • Flashing

  • SPL (Second Program Loader)



(any other often-confused terms that I've missed?)




Saturday, July 29, 2017

privacy - How do I prep my rooted and moded phone for resale?



I have a rooted MyTouch 3G (HTC Magic) that I want to sell to help defray the cost of my new phone. I have been running CyanogenMod on the phone. My problem lies in the fact that I don't really want to stick somebody with the slightly buggy way the phone runs now. I could just slap the stock rom back on it but I don't hear very good things about it and I'm pretty sure the fact the phone is rooted will still prevent new updates to the phone from HTC.


So, what I'm asking is: What should I do to make this phone easily usable by whomever might end up with it? Is there a mod that is going to be super user friendly that won't require constant tweaking on the part of the user? Or is there a way for me to return the phone to vanilla stock?



Answer



I would keep the phone rooted, with the sale option of restoring to stock rom (if that's what the customer wants). Or you can give the phone back with a stock rom with root. Clockwork should let you do that.


Make sure you factory reset the phone before you give it to them (rooted or not) and format the SD card too.


Location of saved images from Facebook Messenger app


I don't use Facebook app (browsed on Google Chrome), but I use its Messenger app. Where can I find the saved images from Facebook Messenger app?




settings - Android 4.4: How to get the Easter Egg and unlock the Dessert Case daydream?


Similar to Android 4.2/4.3 easter eggs, does 4.4 KitKat have similar or other ones?



Answer



KitKat easter egg




  1. Open Settings

  2. Hit About phone at the bottom of the items list.


  3. Tap the entry Android version three times quickly. A big K will appear on your screen.


    enter image description here




  4. Hit it a few times or long-press to continue to a KitKat style Android logo.


    enter image description here







Dessert Case daydream:



  1. Go through steps 1-3 of the above.

  2. Long-press (1s) the big K.

  3. Long-press (1s) the Android logo.


  4. It will open a new daydream 'screensaver'.



    enter image description here




  5. From now on, you can select it as a daydream option in SettingsDisplayDaydream.


    enter image description here




How to create nested folders on home screen in Lollipop?



Example:



  • Assume that a folder F1 has ABC app icons (shortcuts) in it.

  • Another folder F2 has XYZ app icons in it.

  • The default launcher in COS12 doesn't allow inclusion of more than 16 icons in a single folder.

  • Neither it provides the option to include one folder (F2) into another one (F1) so that the included folder (F2) would show up as a normal icon in F1 amongst other ABC icons, but when touched, would show its XYZ icons, hence achieving the proper nesting.


How do I achieve this folder nesting in Lollipop?


I've found that Folder Organizer can do the job but it hasn't been ported to Lollipop's Material design. Result, your host folder looks in sync with rest of the UI (white background, smooth font) but the nested folder gives you a somewhat black background with not so smooth or crisp font. It also doesn't respect the current theme in place. Pretty much a weird combination in hand.


I believe Tasker's scenes can do this but I would like to have consistency between folders when it comes to their appearance.





I've a OnePlus One running rooted Cyanogen OS 12 with Xposed Framework installed.



Answer



I've created a Scene in Tasker, loaded it using a task and created a shortcut using Task Shortcut widget to launch the scene.



  • First image is showing a normal folder with some app shortcuts. See the folder icon titled "Nest". It is a task shortcut for the Scene.

  • Second image is the Scene created in Tasker which is launched from a shortcut .


(Click image to enlarge)


IMG: IMG:




  • To maintain consistency in appearance I took the background from Material Palette, cropped the color I wanted and loaded it into the Scene as background image.

  • All the app icons are loaded using Image element in the Scene.

  • Because it isn't a folder, so there is no drag and drop in it.


As for how to create this scene, you can see YoutTube videos or search Tasker sub-reddit or the numerous websites filled with cool tutorials. You may consider my answer here to get a rough idea of how to create a Scene in Tasker and how to use it then.


Transfer apps, data, and settings from Marshmallow to Lollipop


I've been using a Moto E 2nd generation that I bought in Europe, but I've now returned to the US and am replacing it with the US version (XT1527) of the same phone because the European one (XT1524) doesn't get LTE service with my carrier, AT&T.


The old phone is running Android 6.0, but the new one only has Android 5.1, and offered me no options whatsoever to transfer anything over when I set it up.


I'm no Android expert, so forgive me if the answer should be obvious, but…what's the best way for me to get my apps, app data, and settings transferred across to the new phone?


I sort of thought Android was supposed to offer to do this for me at setup, but maybe it doesn't work when moving to an older version of the OS?


Thanks so much!




Friday, July 28, 2017

lock screens - Marshmallow - disable unlock touch feedback


When phone is locked and I'm inputting the PIN, there's a visual feedback on each keytouch, some sort of ripple animation around the key.


Not very secure :)


How can I disable that?


Edit:
Device - Lenovo Moto X Play, not rooted
OS - Marshmallow 6.0.1


Apps tried:
Hi Locker - Your Lock Screen - Free version pop ads on unlock - unusable
GO Locker - theme & wallpaper - Slow

Locker Master- DIY Lock Screen - Buggy
ZUI Locker-Elegant Lock Screen - Doesn't solve the initial problem



Answer



Your concern from a security point of view is very valid for these two reasons:




  1. Password can possibly be guessed by somebody who repeatedly and closely watches you swipe pattern or key PIN by following the ripple pattern




  2. Smudge Attack Wikipedia entry says:






A smudge attack is a method to discern the password pattern of a touchscreen device such as a cell phone or tablet computer .... The smudge attack relies on detecting the oily smudges left behind by the user's fingers .... Under proper lighting and camera settings, the finger smudges can be easily detected, and the heaviest smudges can be used to infer the most frequent user input pattern (the password). The researchers were able to break the password up to 68% of the time under proper conditions.



(emphasis supplied)


Commonly advocated counter measures against smudge attack are




  • Wipe the screen after every unlock, (impractical as it may sound) ;





  • Use a high quality oleophobic screen protector to minimise smudges, in addition to wiping after every unlock




There are two ways of mitigating security risk-using apps for un-rooted devices and other means for rooted devices




  • Un-rooted Devices: Since Lockscreen mechanism is a part of the core security of Android devices , apps can't interfere or modify it's functioning . These apps take the approach of asking the user to set the lockscreen security to none and then impose a lockscreen design of their choice, in effect, a layer on top of disabled lockscreen. One such app is Hi Locker which is a lock screen app, offering a lot of features. Relevant to this question are





    1. Pattern Lock: This allows you invisible mode in security options. This mode hides the ripples. Which means the typical trailing lines joining the dots are not shown. However, this is a risk from smudge attack view, unless you change the pattern very frequently




    2. PIN Lock: This allows you to set a Random keyboard in security settings. With this the keyboard changes with every lock / unlock, and is recommended for security against prying eyes and smudge attack. Screen shots below show this on consecutive lock / unlock-note the randomized digit placement






enter image description here





  • Rooted Devices: This takes the approach of directly modifying the lockscreen functionality of Android, without using any apps. I am aware of one method and there may well be more. This is based on scrambling the key board while entering PIN. This requires Xposed framework to be installed and Gravity Box module to be installed. This module aside of tons of features offers means to PIN scramble (under Lock screen tweaks). This PIN scrambling feature is similar to the one shown in the above method as far as user interface is concerned.


    Since tag, cover related aspects, specifics to OPs device are not covered here. OP can study them and if need be ask a separate question




OP's device is not rooted but has indicated in comments that he is willing to root the device to meet his requirement . Rooting without fully understanding the risks could be a bigger risk. IMO, rooting the device and taking adequate precautions to safeguard against the risks is highly worth it. It is up to OP to decide which course but using app based method to start with could be a good start.


Edit: I just noticed your edit, which shows that the free version of app is unusable due to ads. Unfortunately, Free always comes with a price tag of ads as far as apps go ( There ain't no such thing as a free lunch at play !). So your options are limited to a) buying the pro or buying an ad blocker for unrooted devices b ) searching for other apps from the list at serial 1 on notes below c) Root your device and use Gravity box or flash a ROM that has this feature inbuilt (understand CM 11 , which is quite old has it - I am not aware of other ROMs)


There isn't much one can do about that, unfortunately


I have been searching and there appears to be no free without adds. Also searching for timepin throws up similar apps which modify PIN based on current time in various configurations. But all of them are ad supported.





Additional Information




  1. Where to find a PIN lock screen that scrambles the keypad on every use? a related question on scrambling PIN lists out some other apps as well, which have not been tried by me.




  2. There have been feature enhancement requests to Google to include this as a default feature in Android OS for long. Issue 10496: Randomize screen lock pin keypad option was opened in 2010 and closed in 2014 ; Issue 74338:Option for keypad number randomizer on lock screen settings to increase PIN entry security was opened in 2014 and closed in 2015 ; Issue 181566: Option for keypad number randomizer on lock screen settings to increase PIN entry security was opened in 2015 and thankfully is still open - head over there and star it to support or leave a helpful comment - I just did and there are less than 10 folks supporting- do your bit !





  3. Answer here to Touch Screen Password Guessing by Fingerprint Trace from Security SE , wiki on smudge attacks and other net searches reveal a product by Whispercore, which seems unavailable now




performance - Dialer app becoming too slow and less responsive



It takes almost more than 5-10 seconds to open the dialer application in my phone.


This has been happening for a while now and is especially critical since during incoming calls, when my phone snaps back from standby to show me who is calling, I actually have to wait sometimes more than 10 seconds to see the caller id and its like the phone is stuck during that time.


It has been the case before (stock) and after I've put a custom ROM in my phone. Though I noticed this became more severe after I installed a lot of apps etc.


Since I suspect that this is because of low free RAM (I have a low-end Android phone), I recently installed optimization apps, kept my homescreen free from widgets and running apps etc. and it did help to an extent. However, I feel like it still needs to be lightning fast and always accessible feature like in conventional handsets. How can I achieve this? How do I lock the dialer in my RAM or is there some super light dialer apps that can replace this stock dialer?


Also, could it be because I have around 150 Facebook and Google contacts synced in? (I don't think that is a big number)


How about finding a way to turn off the picture data in contacts? Will that reasonably reduce memory footprint?


Very same situation : Can I set it so the "Phone" on my phone takes priority over all other apps? (tried all the answers)


UPDATE: I found something called "FUSIONboost" on the FUSIONideos custom rom that seems to set the priority of apps or something. This seems to be exactly the solution, but I don't want to switch roms now and would really like if someone can tell me how I can get this..




usb peripherals - USB OTG "power consumtion error"


I use a USB OTG cable to connect USB devices such as pen drives, mice, key boards, etc. But when I connect some devices, (particularly some of the pen drives I have) it gives me following error message and prompts me to disconnect the device.


screencap


I contacted my OTG cable retailer and he suggested that I should use a USB hub with a power inlet, to connect the devices which give the above error as the said error generated due to heavy power drain from the connected devices (pen drives).


I want to know whether there is a possibility of bricking my phone if I use a USB hub with a power inlet.



Answer



The hub's power should only go to the hub's slave ports, not through the master port back to the phone


But even if the hub uses an odd design, the most it would do is feed the phone 5V and however much amperage it will accept, same as with any bog standard wall charger.



So in short, there's no risk to your phone.


Thursday, July 27, 2017

Galaxy S3 randomly booted into safe mode. Strange behavior


I was using my phone (Galaxy S3 SGH-T999), not doing anything intensive, just web browsing on Chrome, then all of a sudden my phone restarts into Safe Mode.


I opened the app drawer and noticed most (possibly all, not sure) of my downloaded apps were gone.
My notifications bar was informing me that some apps were being re-downloaded.


Not sure of the reason, I just restarted the phone and it booted back up normally.


However strange things have been happening, like:




  • Apps re-downloading or updating.

  • Facebook app authorization failing

  • All my contacts were gone. I use SmoothSync for Cloud Contacts. Opening the app asked me to enter my password. My contacts came back.

  • My iCloud calendar was gone, again because SmoothSync logged out. Logging back in was no problem.


Nothing really bad has happened, but it just seems strange and random to me.


Why would Safe mode be activated out of nowhere?




Is there a way to set app-specific volume?


I'm looking for a way to set the media volume depending on the app being used.


I generally keep my media volume down fairly low so as not to annoy my fellow humans overmuch; while playing Angry Birds, for instance.


When I go into Doggcatcher, though, I generally want to crank the media volume way up, because I'm listening through earbuds or my car speakers and need that volume way up.


Not such a big deal, but if later I go back to Angry Birds and I forgot to turn the volume back down it wakes up the whole house.


This is exacerbated by the fact that the media volume does not follow the "Sound off" setting (accessed by a long-press of the power button).



So, is there a way to do what I want?


(Android 4.0)




4.4 kitkat - Rooting the Micromax Canvas A1 Android One Phone (Micromax Canvas A1 AQ4501)


Can anyone share experiences rooting the Android One device Micromax Canvas A1 (Micromax Canvas A1 AQ4501)?


I am looking for a trustworthy way, as far as possible.
Please don't say rooting is inherently risky - I know that. I am still looking for relatively safe technique(s) and using third party software, if that's required, that is known to be generally reliable.


If any one has rooted this device, were you able to upgrade to the latest Android version after rooting? (It runs Kitkat 4.4.4 by default)


Thanks.




Wednesday, July 26, 2017

How can I use Flash Player now that it's no longer supported?


I know that Adobe Flash Player is discontinued for Android devices, but is there an alternative way to continue using Flash on an Android device?


I have the APK of Flash Player 10, but I would like to use the most recent version.



Answer




If the Play Store won't play ball, you can download the Flash Player APK from Adobe here.


Direct download links:



Warning: Those versions are pretty old (2013) and are no longer supported by Adobe. Therefore installing it may make your device vulnerable to attacks from the Internet.


Update from ADB option under recovery menu


How does one typically use the "Update from ADB" option in the Recovery menu? Do I have to connect the phone via a usb cable to my laptop & provide the necessary update files?


Where on the laptop do I keep the update files & where will I download these files from?


In case my phone model helps it is a Moto G 1st edition XT1033.




google account - Where exactly does Android get its contact suggestions from?


I have a phone right here (Evo 3D), it has no service (except my wifi) and I've only added an obligatory gmail account which has one contact.


No Facebook, no Google+, no Twitter, etc.


Yet I got a "matched contact suggestion" notification. What is that? Where did it come from?


My main phone (TMO G2) with all of the services never gets these things and I'm not familiar with that at all.


Insight appreciated.




samsung galaxy s 2 - Big battery usage


I have Galaxy s2 running android 4.1.2.



My phone can eat near to 25% battery in 6h – and during this time I spend only ~5minutes on Facebook. I downloaded Wakeuplock and it shows that Google+ is running for 30minutes and keeping my phone wake. Here's a screenshot screen:


Screenshot
Screenshot (click image for larger variant)


As you can see Activ parameter is over 20% ( so its bad as someone told me). Can you suggest me something how to improve batery life.


Phone is on the battery save mode all time.



Answer



As you state you don't even need "that app", here are two approaches to keep it from eating your battery:


Disabling the app



  1. Go to Settings → Apps, select the "All" tab


  2. Scroll to the app in question (in the current example, Google+)

  3. Tapp its entry to open the details

  4. Tapp the "Force Close" button to end all its processes

  5. Optionally, tapp the "Clear Cache" and "Delete Data" buttons to free some space on the device

  6. If you see a button labeled "Uninstall Updates"1, tapp it. The button will then rename itself to...

  7. Tapp the "Disable"1 button2


The app should no longer start itself now, and thus not eat any battery anymore. If you need it back at a later point in time, it's still listed in Settings→Apps (though it might have been moved to the very end of the list). Opening its entry should show a button labeled "Enable" now, which speaks for itself.


Keep the app from running when you don't need it


On the playstore, you will find an app named Greenify. This can be used to automatically "hibernate" an app when its not running in foreground. Though Greenify is delivering its full potential benefits only with "root powers", it can do many things already without. If its free version cannot deal with the app in question (Google+ here), you might need the Donation package (for ~USD 3), which has additional ways to force apps into "hibernation".



Greenify Start Screen Greenify App Analyzer
Greenify: Start screen, App Analyzer (Source: Google Play; click images for larger variants)




1 If you have none of the two buttons, but an "Uninstall" button, it's no system app: simply uninstall it.


2 Note that not all system apps permit this (button is grayed out then).


Tuesday, July 25, 2017

sync - Synchronisation of contacts and calendar suddenly stopped working



While working fine for almost a year now (since I've installed CyanogenMod on my device), a couple of days ago synchronisation stopped all of a sudden: Network indicators turned white (no longer green on Gingerbread / blue on ICS and up), which indicates the device is not "in-sync" with the Google servers.


First I thought it might be some Google Server outage (as all of us know them), I waited a couple of days. But it didn't solve up within a few days, so I decided to take a closer look. logcat then showed: Always when trying to sync, the network connection timed out.


Further side-effects: Google Playstore app did no longer open ("network timeout"), Google Talk insisted on a "username/password failure".


That's where I got stuck: What to do? Reboot didn't help, shutdown/restart didn't help either, nor did clearing cache/data from the contactssync app. I couldn't log off GTalk (which would be the next logical step), as GTalk immediately insisted on that username/password error.


Now what?



Answer



Analysis


Luckily, logcat gave the IP address along (in my case: 74.125.93.113). On my PC, I first checked with the browser ("https://74.125.93.113/") -- and in fact, connection timed out. Next I checked what's behind the IP:


host 74.125.93.113
113.93.125.74.in-addr.arpa domain name pointer qw-in-f113.1e100.net.


Didn't tell me anything. But checking with /etc/hosts on the Android device, I found the entry:


74.125.93.113 android.clients.google.com

A lookup of that host reveiled: The IP 74.125.93.113 no longer belongs to it -- which explains the trouble.


Solution


The solution requires root, unfortunately, as /etc/hosts is owned by root and read-only for everybody else. Furthermore, /etc is just a symbilic link to /system/etc, which means the entire file system is read only.


What you need



What to do



Open the terminal app, and follow these steps:


# make yourself root
su
# SuperUser/SuperSU may require approval at this point. Give it.

# check how /system is mounted:
mount | grep system

#output will look similar to this:
/dev/block/mmcblk1p21 on /system type ext3 (ro,relatime,barrier=1,data=ordered)


#remount /system read-write, using the values obtained:
mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system

#edit /etc/hosts
vi /etc/hosts
# put a comment-sign (#) in front of the line containing the bad IP, e.g.
# 74.125.93.113 android.clients.google.com
# save the file


# re-mount /system read-only (or simply reboot, that will do it as well)
mount -o ro,remount -t ext3 /dev/block/mmcblk1p21 /system

Now just wait a short time -- or simply call up Google Play to check. It shouldn't take long for the lights to turn green again.


voip - Is Skype available for all Android flavors or just Verizon?


I see that Skype offers an Android version, but it only works on Verizon? Fring used to connect to Skype, but now it looks like they don't. Is there no Skype client for Android?




Sunday, July 23, 2017

How to disable Heads Up notifications in Android Lollipop? (notification popup at top of the screen)


How can I disable the heads up for Android Lollipop, just like it was in KitKat and below?


If it is possible to disable heads up, is it also possible to enable it for certain apps only , like when I receive a call?



Answer



A non root option is now available. The HeadsOff app can disable all Lollipop Heads-up notifications on your phone. It can also disable Heads-up notifications only for selected apps. If you purchase the Pro key you can restore the ticker text in the status-bar to see a little notification preview.


Saturday, July 22, 2017

4.0 ice cream sandwich - unknown error code -24



I have Android 4.1.2 on Samsung galaxy S2


I install an app and get this error:


unknown error during appliaction install -24



googling this line should clearing Google play cache might help


but it didn't work for me. Any other solution?




printing - How to print to CUPS (running on another computer in the LAN)?


How to print from Android to CUPS (running on another computer in the LAN)?


(CUPS (Common Unix Printing System/Server) is of course already set up to accept requests over the LAN.)


Preferably, without relying on proprietary software.




2.2 froyo - Can I use the HTC Desire HD Wifi Hotspot feature to share a wireless network instead of mobile internet?




Possible Duplicate:
Can we use an Android phone as a Wi-Fi repeater?




I have my home router which for a variety of reasons I can not switch to WEP. However, I occasionally need to use my Nintendo DS to connect to Nintendo WFC, and it can only use a WEP connection. My current method is to use the Wi-Fi Hotspot feature of my HTC Desire HD to create a temporary WEP network and connect to that using my DS. This is fine, except it forces my phone to use my carrier's data connection instead of my home wireless network, bringing with it associated charges if I hadn't used the internet on my phone that day already.


Is there anyway to share a wireless network instead of the mobile network via the Wi-Fi Hotspot feature?



Answer



The Desire HD can not be a gateway that supports rebroadcasting wifi with a different encryption, at best you could add an encryption from an open point or broadcast it as open from a secure point.


You would also need two antennas, and the chip does not.


updates - How to upgrade an HTC Magic (32B DEV) from Android 1.5 to latest Android?


Last year I got a free Android phone at a Google event, and I would like to upgrade it to the latest Android version (probably with Cyanogen).


What is the quickest/safest way to do the upgrade?


It is a developer phone, so:




HTC Magic, Model Number GDDJ-09, Build CDB56, Android 1.5, details:


SAPPHIRE EVT1 32B DEV S-ON G
HBOOT-1.33.3005 (SAPP20000)
CPLD-10
RADIO-2.22.19.26I
May 29 2009,14:38:09

Answer



This section of the Cyanogen instructions seems to cover the developer Sapphire handsets


Friday, July 21, 2017

malware - Lan local ip address of Android phone is constantly changing?


I believe I am a victim of malware on my phone.



I have already flashed a new ROM and reset my Samsung Galaxy S3 phone many times. Using a network logging app and a "network connections" app shows me the live connections coming from my phone.


My local wireless LAN is 192.168.x.x but I see the IP address change to 10.0.8.1and then reverting back to my local WLAN IP address.


I do not even route that subnet in my network so how am I getting that address? Using network ping apps, I can ping that 10.0.8,1 address from my phone. It's even happening to my other android phone (Gamsung Galaxy Note 3). The S3 is rooted and the Note is not.




4.0 ice cream sandwich - Is there currently an easy way to root Sony Xperia S with stock ICS 4.0.4 ROM?


I'm looking for an easy way, which doesn't need Unlocking bootloader or flashing Roms, just like root solution for SE 2011 devices (one click). It's because I currently use my Xperia S for development purposes and can't afford bricking it! please tell me if there is a solution. Thanks!



Answer



Ok, at last, the mighty user of XDA, Bin4ary, has released a very nice and easy toolkit to root ICS JB roms of most sony phones, including Xperia S.


I used the tool and easily rooted my phone. Very fast and painless. No need to flash or unlock bootloader or anything.


If you are also interested, this is the page on XDA:


http://forum.xda-developers.com/showthread.php?t=1886460


Thursday, July 20, 2017

What is the difference between AOSP/vanilla and stock?




Possible Duplicate:
What's the difference between an AOSP ROM and a stock ROM?



When referring to Android ROMs or kernels (etc.), what is the difference between:



  • AOSP ("vanilla")

  • Stock





internal storage - Is it safe to Factory Reset my tablet to improve performance? Will I lose the uninstallable apps?



I'm going to reset my Android tab because its internal memory is low.


Is it safe to erase the system data of my android tablet (not rooted)? If I restore the factory setting of my Android, will the uninstallable apps be also removed or only those that can be uninstalled?



Answer




Is it safe to erase the system data of my android tablet (not rooted)?



Yes, it's safe to Factory Reset your tablet.



If I restore the factory setting of my Android, will the uninstallable apps be also removed or only those that can be uninstalled?




Only those that can be uninstalled will be removed. Doing a Factory Reset is like making your phone brand new. You will lose all your installed apps and all your data, but you will still have the stock / default apps that your phone came with.


Once the phone reboots after a Factory Reset, you start from scratch. You will log-in to your Google account, and have the option of restoring the apps you installed and bought before from Google Play.


Related questions:



Rooting Asus memo pad HD 7


Can any one show me a tutorial that how can I root my Asus memo pad hd7 ? Thanks in advance !



Answer



Please read the main How do I root my Android device from this site.


This is a blog on rooting the device and installing gApps on the device (if necessary).


This is the XDA thread on the root apk this should be a one click rooting process.


This is a recovery / ROM for the device


As always the disclaimer to this applies:



Rooting your phone may void your carrier and manufacturer warranty. You accept all responsibility if you brick your device. If you are ever in doubt STOP! This is not something to take lightly.




Read this also as it relates to the risk of rooting a device.


And once more I have to emphasise: ALWAYS backup everything, all the time. Then back it up again.


wi fi - Using ADB with usb debugging disabled, and no root


I have an Android Device running Android 2.3.7 . The device is locked due to exceeding pattern attempts. So now Android is prompting me to enter my gmail id and password. The problem is, the WiFi is turned off and the Data is turned off.


I have found using this thread that you it is possible to turn on wifi using ADB. But on my device, even usb debugging is not turned on. So, I cannot access the device using adb.


So, I figured may be you can access device using adb in recovery mode ( my phone is not rooted ). But so far, in recovery mode, running adb devices does not list my device.


Is it possible to access a device using adb if your usb debugging is turned off ( on a non rooted phone ) ? How about in recovery mode ?




Wednesday, July 19, 2017

4.3 jelly bean - Android 4.3: How to get the notification history


In the recent days, after the release of Android Jelly Bean 4.3, I've heard about a new feature: something like a notification history, which would be a screen showing not only the current notifications but also past ones. Is it true or is it just a rumor? If this actually exists, how can I get to such screen?



Answer



This is not a rumor: the notification history is a true feature from Android 4.3, although they don't make any mention of it in their What's New page.



The following steps will allow you to take advantage from the Notification History in a vanilla Android Jelly Bean 4.3:



  1. Go to your app drawer, then tap the Widgets tab. Scroll until you reach Settings shortcut (1x1) widget.

  2. Drag and drop this widget to your home screen.
    Step 1 Step 2

  3. You'll see a screen where you can select the type of settings this shortcut will open. Select Notifications.

  4. The shortcut Notifications will be in your home screen, tap it.

  5. The screen Notifications shows the notification history we are talking about. In this screen currently active notifications appear in full intensity, while dismissed ones are dimmed.
    Step 3 Step 4 Step 5

  6. Tapping in each notification from this screen will open the corresponding App info screen, where you'll be able to toggle the option Show notifications as you wish.


  7. Remember: if you turn off notifications for an app, its icon will disappear from the status bar, all its notifications will be dimmed in the Notification history screen, and you may miss important notifications about this app from now on. Only do this if you are completely sure.
    Step 6 Step 7


usb connection mode - Phone not mounting as a drive when "Connect USB storage" is clicked


I have a Samsung Galaxy S, using the default firmware (version 2.2). It is configured to select "Mass Storage" when plugged in via micro USB.


When I plug the phone into the cable, I receive the "Click here to connect via USB" button.


However, when I click it, the phone thinks for a bit and then tells me that it's connected; yet Windows makes no mention of it and the drives are not accessible from the computer. It has worked in the past, but has apparently decided I am no longer worthy or something.



I have rebooted both the phone and the computer with no change in behaviour.


What am I doing wrong? Is there something obvious I've missed?




adb - A way to get location coordinates from command line



I'm looking for a command line, or a series of commands that can dump or list the latitude and longitude on a rooted device.


I connect to a device using ADB shell. A way that will cause the coordinates to be logged to the command line is also good for me.



Answer



Looks like there is a way:



adb shell dumpsys location > dumpsys.txt



This will give you a file with all location service information. In this file search for 'Last Known Locations' and you should see something like:


passive: Location[network 92.915479,55.610965 acc=22 et=+1d4h10m34s255ms {Bundle[{noGPSLocation=Location[network 92.915479,55.610965 acc=22 et=+1d4h10m34s255ms {Bundle[{coarseLocation=Location[network 92.918919,55.603997 acc=2000 et=+1d4h10m34s255ms]}]}], networkLocationSource=cached, networkLocationType=wifi, travelState=stationary}]}]


network: Location[network 92.915479,55.610965 acc=22 et=+1d4h10m34s255ms {Bundle[{noGPSLocation=Location[network 92.915479,55.610965 acc=22 et=+1d4h10m34s255ms {Bundle[{coarseLocation=Location[network 92.918919,55.603997 acc=2000 et=+1d4h10m34s255ms]}]}], networkLocationSource=cached, networkLocationType=wifi, travelState=stationary}]}]

Of course, the list will include another entry if you have the GPS provider enabled on the device.


Going by android code, I tried to find out how apps get the location when they use LocationManager.getLastKnownLocation(). After a bit of following, I ended up in LocationManagerService here. which implements getLastLocation and also a dump function.


The coordinates are not stored in any file as far as I can tell. They are stored in memory in a hashmap and dumped for the dumpsys command. This also explains why a directory heirarchy search did not reveal any files with gps info.


If you want this info in a more standard format, you will need to take the app route and go with something like this. This app exports the info in a GPS or a KML file that you can feed into geo based apps.


PS: This works on non-rooted device just as well.


Help need a way to know how to do bulk updates across multiple devices


I manage a bunch of android devices and I was wondering if there is an easy way to do bulk updates when a new release comes out. Also would like to know if I can block certain devices from being updated at all?


Thank you



Answer



No, there's not. You have to manually accept evey software update from every device. Imagine how big of a security problem it would be if you could do that remotely.


Of course you can ignore updates. They'll ask you for confirmation to install them, so you can just say no and be done with it (recent versions will allow you to block the notification if you don't want to see it). Some ROMs even have the option to only check for updates manually, so you don't even need to know there's one available.


Tuesday, July 18, 2017

4.0 ice cream sandwich - Can I disable the camera sound in the new ICS camera app (in silent mode)?


Android got a brand new camera app with ICS. The old camera app from previous android versions didn't play a sound when the phone is in silent mode, the new one does. Obviously this can be somewhat anoying in some situations.


Can this sound be muted?


Note: I'm asking for an answer that doesn't require a rooted device. I'm aware that I can rename/delete the sound files from the system (as documented in this question), but I'd rather not root a device just for this.



Answer




Alright, I went through the sourcecode and the answer is surprisingly obvious:


Yes, this can often be muted by simply using the volume keys while using the app or adjusting the volume of the media audio channel in the preferences. The media volume is used, regardless if the device is in normal, silent or vibrate mode. But it depends on where you bought your device if this works (I guess), some devices enforce audio over a channel that can't be muted.


More (technical) details:
The camera app checks the device configuration (system property ro.camera.sound.forced) whether it should play the camera sounds over a system-enforced audio channel that can't be muted. If this setting is off, it uses the media and music channel instead.


In case that it uses the music channel, it ignores when the device is in silent mode though. This might be a bug/small oversight by the authors. This is why you have to adjust the channel volume instead.


I guess the property mentioned above is set depending on where you buy your device, since the sound is required by law in some places/countries as explained by eldarerathis in the comments.


adb - Clockwork: error: cannot load 'recovery-clockwork': No error


I am trying to flash a recovery-image file into my Nexus 7 but the flashing fails


know that I am working on windows and my image file is located in the same folder as adb and fastboot files are


here are the steps I am following:



  • start the tablet android system, and the device works fine

  • I restart the tablet into the bootloader using: adb reboot bootloader

  • browse to the Recovery Mode and then check if the adb sees the tablet: fastboot devices

  • adb is working fine and can detect the device and read its serial number



  • then when I flash: fastboot flash recovery recovery-clockwork.img: I get this error:


    error: cannot load 'recovery-clockwork': No error




what am I doing wrong ?



Answer



Most common errors (and solutions to them) are:



  • different file name: make sure the file is really named recovery-clockwork.img, in your example, or adjust your command according to the file name


  • wrong path, e.g. your file resides in C:\Downloads, but you're executing fastboot flash recovery recovery-clockwork.img from C:\: Either first change to the directory the .img file is located in, move the .img to where you want to execute your command, or try specifying the file with its full path (e.g. C:\Downloads\recovery-clockwork.img)

  • sometimes adb/fastboot behaves strangely when executed from "somewhere else". In those cases it helps to first changing to the directory where the resp. executable is located, and run your command from there.


How to stop "permission denied" app toasts after denying permissions?


I often like to deny app permissions that I think the app does not need but yet they keep requesting for the permissions even after Denying, resulting in lot of toasts [package name] has been denied [permission name] permission.



How do I permanently suppress these toasts?


I am using android Kitkat.




Monday, July 17, 2017

moto x - Why no consistent headset control?


I'm a recent convert to Android (I have a Moto X on AT&T) and I'm running into a problem that I never had with my iPhones: the button on my headset sometimes works; sometimes doesn't. It upsets me greatly, especially since I recently purchased a $300 set of Bose headphones (Quietcomfort 20) that are specifically made for Android devices. I've even tried three apps from the Google Play store that purport to make the inline control work—none of them do, however. Why is this happening and, more importantly, how can I fix this?


07/30/2014 EDIT:
So I've been using this Moto X plus QC20 headphones for several months now, using the recommended Klipsch Control app to allow the button on the QC20 to work better. Well, it only seems to work about 50% of the time.


I have yet to figure out what is causing the interference, but some days, the button works perfectly. Other days, it will work, but it may take anywhere from 0 to 15 seconds before a button press is actually registered by the Klipsch Control app. It just seems to be completely random. Still other days, the button doesn't work at all.



It might have something to do with either the time of day and/or when the headphones are plugged in / removed. For example, one morning, it'll work fine. Then I unplug the headphones and go to lunch. Returning from lunch, I plug the headphones back in and the button no longer works. Or the reverse could be true: The button doesn't work before lunch, but works great after.


Because of this odd behavior, I'm sure you can see why I am fearful of unplugging the headphones for the rest of the day once the button on them starts working. I know that if I unplug them and plug them back in later, I only have a 50% chance of the button working.


I hope this makes sense. More importantly, I hope someone can see some sort of pattern that I have yet to see in this behavior to identify the cause(s) of this problem. Any ideas?




hardware - How do RAM and processor speed affect overall performance on Android?


Since Android can be installed on wide range of devices, I'm wondering how important RAM and the CPU speed are to the performance of a device. There are always tradeoffs when something is increased and another one decreased!


Is more RAM or a faster processor better for general browsing and less mulititasking? What if I'm interested in gaming or doing lots of things at once? Will more RAM make up for a slower processor or vice-versa?



Answer



In the context of Android, more RAM means Android can keep more sleeping program in the RAM so they will be ready to be quickly resumed when you return back to the apps. More RAM means Android is going to spend less of its time killing and reloading apps from the internal memory/sd card, and instead spend more time doing actual work you care about. This means that more RAM usually give you better/faster task-switching. Also, more RAM means your homescreen is less likely to be killed; and you won't experience that 10-second-wait-that-feels-like-forever. Having more RAM also allows you to run complex apps that naturally requires a lot of memory, e.g. photo/video editor, complex games, etc.


A higher CPU is able to calculate things much faster, while this might look tempting at first, it is notable that most programs -- except for games and synthetic benchmark and possibly flash-heavy webpages -- are I/O-bound and not CPU-bound; in other word, most programs are waiting for network transmission, flash storage reads, DMA reads, touch event processing, etc to finish, instead of waiting for some calculations. In CPU-bound application, increasing CPU speed can mean less latency between touching the screen and the screen updating to reflect the touch event. However, up to a certain point, there will be no longer any noticeable benefit of adding even more CPU; beyond a certain point, the input turnaround will be much faster than our own brain's turnaround time (approx. 100-200ms) and we will not be able to perceive the benefit of adding even faster CPU. Also, note that input-to-output turnaround time depends on a large number of other factors, e.g. the latency of the cables, speed of the bus, etc. Second, having some extra CPU time to spare also means that Android can assign those spare CPU cycles to background processes, so background processes can run better.


Summary


More RAM:



  • better task-switching


  • can run more complicated apps or open larger/more complex files


More CPU:



  • faster turnaround between input and response (less lag) on CPU-bound apps

  • better background processing


In short, both are equally important; your own personal usage pattern will determine which is more valuable for you. If you generally stays in a single program and is sensitive to input-to-output latency then having faster CPU will be more valuable for you; if you constantly task switch between many different apps or if you need to run complex memory-hungry apps to open complex large files, then having extra RAM is going to be more valuable to you.


settings - What is the fastest way to turn the phone into silent mode?


The title kinda tells it all. Sometimes I need to turn silent for a meeting and the procedure is like:



  1. Unlock the phone


  2. Click on Menu

  3. Go to Settings

  4. Click on Sound

  5. Enable Silent mode


Apart from (1), which can't be shortened (can it?), I want to minimize the remaining 4 clicks.


EDIT: I have a Nexus S, but I'm more interested in things that are not specific to models. Also, please feel free to add model-specific answers, as other people may find it useful.



Answer



Personally, I think that the easiest way (apart from sliding right to left, but that's not available on all phones) to put the phone into silent mode is to hold down the power button for a short period of time, then select Silent mode.


applications - How can I store Android apps on my SD card?



I just got my 3rd Android phone, the problem is that I must reinstall all my applications every time I get a new phone. Is there any way to store the apps on the SD card so that I can insert the new card and all my apps are there?


I would prefer solutions that don't require rooting the phone.




Sunday, July 16, 2017

Activate Device Administrator via ADB


Is it possible to activate Device Administrator via ADB command instead of tapping


"Setting -> Security -> Device Administrators --> Select App --> Activate"



on handheld?


If it's possible, how?



Answer



It's not possible. The settings code is specifically written to prevent this. The closest you can come is to bring up the Device administration settings page in the Settings app. You can do this with:


adb shell am start -S "'com.android.settings/.Settings\$DeviceAdminSettingsActivity'"

2.1 eclair - "Converting to multimedia message" when forwarding large SMS


When I receive a large SMS and when I select "Forward" from options, it shows "Converting to multimedia message" and I'm getting charged more. Furthermore, if the person on receiving end doesn't have a multimedia phone he is not able to receive it.


I have un-rooted Samsung Galaxy 3 I5801


I don't want to convert it to Multimedia message.




Answer



This was fixed in Froyo. Anything over 3*160 (480 characters) will convert to an MMS prior to Froyo.


You do have a couple options.



  • Use a 3rd Party Messaging App, like Handcent, for example.

  • See if you are able to install this "Hack"

  • Root your phone and flash a Froyo Rom

  • Wait for a Froyo update from Samsung


Edit: Some additional information

Anything over 160 characters, technically, is no longer an SMS. The stock Messaging app, and others too, allow for "longer" messages but it is just splitting up the messages in to 160 characters. In Eclair (Android 2.1) a message will be converted to an MMS after it exceeds 480 characters. At that point, the default Messaging app will no longer split up the messages, instead it just sends it as one MMS. If you are using a 3rd party messaging application and find that you are still being charged the MMS rate, it may be that your carrier is grouping messages that come through "at the same time".


Saturday, July 15, 2017

lock screens - "Wrong Pattern" After Flashing Image


I wanted to update my OnePlus 3 to OxygenOS 4 using TWRP but that resulted in an error. I tried again, same error. I flashed the old image again, no error, phone was usable again, updated TWRP, flashed the new image again, different error. I then flashed the old image, again, no error.


However, my phone isn't usable right now because I can't unlock it. I definitely remember my pattern, I had it since I bought my the OnePlus 3 and I bought it right when it came out. I have to enter it every time I reboot so I entered it several times just today and there is just no way I remember it incorrectly. Furthermore, I have a second phone with the same pattern. I drew it on both phones simultaneously and only the other phone unlocked.


How can I log into my phone, again?



Answer



Note that @dan-brown seems to be right about the root cause of the issue - it looks like a corrupt install after flashing a new TWRP.


However there is a non-destructive fix, as documented here.



  1. Boot into recovery

  2. Navigate to /data/system


  3. Delete the following files:

    1. password.key

    2. pattern.key

    3. locksettings.db

    4. locksettings.db-shm

    5. locksettings.db-wal



  4. Reboot



wi fi - Which Android system file(s) should I change to connect only to specific Wi-Fi hotspots


I would like to make change in some file under the root so that Android on my device be able to connect only to specific Wi-Fi hotspots by their names and be disable to connect to all others hotspots. I mean to specify a list of the allowed hotspots in a file. I'm interested only in changing a file or files under the root and not in a program/app or changing of settings.


Which file should I change and how to?


If I make my device rooted, then add specific networks in data/misc/wifi/wpa_supplicant.conf and then switch update_config to 0, new networks are not added to the file, OK. But I still can connect to any network by typing its password manually. So how to disable this? Or how to change graphic interface to be disable to type the password manually?


ps. It's not a duplicate of Only connect to certain Wi-Fi networks




How does the Android OS estimate remaining battery time?


Is it known how the Android OS estimates time to failure / remaining battery charge? I am doing a school project about battery estimation on mobile devices but have not been able to find any information about which techniques are used in the industry.


Several people have written articles about how time to failure can be estimated on an Android device, but I have not been able to locate any official information about how it is actual done.


The optimal answer I would like is a link to a scientific article or tech-spec that describe it.





Is it possible to share a VPN connection over WiFi Hotspot?


I have an S8 And a Nintendo switch, The switch doesn't support VPNs. Is it possible to share the VPN Connection to my Nintendo switch over hotspot? My PC Can already do this but I want to play outside!




Friday, July 14, 2017

ROM flashing using Odin on Galaxy S4 interrupted. Odin is still running. Is there anything I can do?


I was re-flashing the firmware on a Samsung Galaxy S4 using Odin, and the USB cable was bumped, which made the update fail. I reconnected and attempted to flash again by clicking the Start button. It seemed to be progressing, but Odin's blue progress bar continued from where it had stopped instead of starting from the beginning. After a while I got the following warning message from Odin, in red text and repeated 19 times:



Invalid percent of drawing download progress bar!



followed by this at the end:




SECURE CHECK FAIL : system



I attempted to start the process again (by clicking Start in the Odin desktop app), but it failed multiple times. I also tried clicking Reset and starting again. It doesn't seem to be possible to do anything from within Odin on the phone. It doesn't respond to any buttons and doesn't react in any way when I try to start the process again from the computer (no more messages on the screen, and no movement in the progress bar, or anywhere else). This doesn't necessarily mean it's frozen, though, because I don't believe it's intended to be interactive. The blue progress bar on the phone is all the way to the end, where it has been since my second attempt to flash.


I have not restarted the phone, because I am afraid that if I do that after an incomplete flash, I will not be able to get back into Odin. It is still on, still in Odin, still showing all the errors. The desktop Odin app on the computer can detect when the phone is connected and removed (I get the "Added!" and "Removed!" messages).


Am I correct in my concern that I'm likely to brick the phone if I attempt to restart without flashing successfully? Is there anything I can do to restart the process? It would be an astounding design flaw if Odin really isn't capable of restarting a failed flash to allow for recovery if the process fails and the device has not yet been restarted and Odin is still in RAM.


I know for a fact that the ROM file I'm using is valid and that I'm doing this correctly, because I have gone through this process several times and never encountered a problem until this time when the connection was interrupted. I have no support available from either Samsung or the carrier (Verizon), because I bought this phone used on eBay specifically for experimenting with things like custom recoveries and ROM flashing.


FWIW, here's a screen shot of the Odin desktop app as it is now:


enter image description here




Thursday, July 13, 2017

In my Samsung Galaxy S under Settings - Status - Phone number is says 'unknown': Why?


Title says it all ( I think ), if I look under the 'Settings - Status - Phone number' on my Samsung Galaxy S mobile phone, it says 'unknown'.


What does that mean ? Do I have to enter the number some where ? And if so, do I need it, or why should I do that ?



Answer



This is just showing whether your phone number is saved to the phone number description property on your SIM card. Some networks always program this in for you, many don't. Some phones let you write to this property, some don't, some read it, some don't.


It has nothing to do with what actual phone number is attached to that SIM card by the phone company.


It is possible to put your phone number in there, and is easier than you might think:


Go into Contacts -> [Menu] -> More -> Settings -> Own numbers -> [Menu] -> Create and type your phone number into the Number field, now Save.



Then switch your phone off and on again, and it should show the correct number (or whatever number you entered) in the status now.


I lost all my contacts on Samsung Galaxy S GT-I9000


Yesterday I lost all the contacts on my GT-I9000. Nothing strange happened, there was no warning, suddenly they were just.. gone. This is the second time this happens. Is there any method to get the lost contacts back?




samsung galaxy s 4 - Sync 'droid with Outlook


I have seen many questions here about users trying other software than Kies for sync'ing data with Outlook and a handset, very mixed reviews with what's good/bad, but not very much mentioned recently on the versions I am using.


I have setup a Samsung GS4 with Kies on a Win7 PC running Outlook 2010, the previous user had a Blackberry and is used to sync'ing his device with his laptop. Email items are sync with a GMail account as we are not running Exchange.


The user has 400+ contacts and quite a lot of e-mail with hundreds of calendar items.



Kies Sync has worked (albeit slowly) for a week, now it stalls/halts (no errors, no timeouts) at 15%.


Any hints or troubleshooting I can do? Sync logs to look for?


If I cannot resolve this I will need a different product to use, so any suggestions are more than welcome!



Answer



There is a one-way Google-to-Outlook sync built into Outlook 2010 and 2013, where you generate a link to your calendar via Google Calendar website, and then add the URL to Outlook as an Internet calendar. This way any changes you make on Google side get synchronized to Outlook. Step-by-step walk-through instructions are here:





  1. Log into your Google account, click on the Apps launcher icon Apps launcher icon and select Calendar from the list of apps.





  2. Hover over the needed calendar in the calendar list and click Calendar settings. This will open the Calendar details page.




  3. Click the ICAL button and copy the calendar's URL.




  4. Open your Outlook and switch to Calendar -> Manage Calendars ribbon group.





  5. Click Open Calendar button and choose "From Internet..." from the drop down list.




  6. Paste your Google calendar's URL and click OK.





If you are looking to sync the other way, i.e. Outlook-to-Google, your options are much more limited. Microsoft tells you how to perform a one-time transfer by exporting your Outlook calendar and then importing the data into your Google account. However, this is not a permanent solution, as it requires you to do this every time you make changes in Outlook.


Google used to have a service called Google Sync which would perform a true two-way sync between your Google account and Outlook via a small application that you would install on your Windows machine. Unfortunately that service has been discontinued a while ago. It's still available for paid Google accounts such as Google Apps for Business, but not for free Google accounts.


In terms of 3rd-party applications, since you have already ruled out Kies as unreliable, gSyncit comes highly recommended, but it's not free. It is a MS Outlook add-in for your PC (no Android app required) that allows a true 2-way sync of e-mail, calendar, contacts and tasks between Outlook and a Google account.



Wednesday, July 12, 2017

How can I search the Google Calendar from the Android phone?


I would have thought that Calendars would be searchable, but opening up the Calendar, and clicking on the search button searches websites via Google web search, but does not search my Calendar.



This is on a Motorola Photon 4G Android version 2.3.4 (not rooted).


How do I do it on the phone (it is possible from a desktop browser).


I have installed the Google Search app, and tried to add Calendar to the list of applications it would search, but there is no entry for Calendar.




Tuesday, July 11, 2017

external sd - Should SD card be formatted before putting into new phone?


I got a new phone and want to put the SD card from my old one into it. Should anything be done to it, such as formatting or deleting files? There is a lot of funky stuff on the SD card, from TWRP and Titanium Backup etc. On the other hand I'd rather not delete just for the heck of it as there's a lot of stuff and some I do want to keep.




How to resume app restore after stopping it on first opening Google Play?


I've installed a fresh stock ROM from Google site on my Galaxy Nexus.


At the time I've opened the Google Play and started installing the 157 apps... the problem is that I needed to stop downloading in the middle as I needed to move to an area without wifi coverage, so I pressed stop.


Now I don't see any option to resume that installation.


Is it really a one shot? How could I have paused it to avoid downloading it on 3G?



Answer



Use bmgr from adb shell. See this answer for a complete explanation of backup sets.



Root access is not required.


shell@maguro:/ $ bmgr list sets
1234567890abcdef : droid48
34567890abcdef12 : galaxy49
...

shell@maguro:/ $ bmgr restore 1234567890abcdef
Scheduling restore: droid48
done


This triggered a full restore of all the previously installed apps on my device instantly.


rooting - SELinux and chroot system call



TL; DR: This is a question about the final step, in a portable, developer-oriented rooting process, that works across all Android machines. It is not based on any exploit - it is something that we are legally and morally allowed to do, as developers, to our own machines. If I get an answer and manage to chroot inside my Debian, I will make a concise blog post detailing all the steps of this process for all the fellow developers that want root access to their tablets - and don't want to trust dubious-origin "one-click-roots" that do God-knows-what to their machines (botnet members?)... The only dependencies will be the machine's kernel sources (which the manufacturer is legally obligated to provide) and the boot partition image (boot.img), which is 99% of the times inside the manufacturer-provided Over-the-air updates, or individually downloadable as a standalone flash-able image.


So, a week passed where I spent all my free time on my new Android tablet.


And I have almost completely succeeded - in creating a portable, developer-oriented process, for achieving root in my Android 5.0.2 tablet.


But there's one thing missing yet - I can't do a chroot (which I need to run my debootstrap-ed Debian!)


What I did so far



  1. First, I did a minor patch in my tablet's (manufacturer-provided) kernel sources, and then compiled my own kernel - where I disabled the checks for changing SELINUX enforcing mode. Specifically...


In security/selinux/selinuxfs.c:


...

if (new_value != selinux_enforcing) {
/* Commented out by ttsiodras.
length = task_has_security(current, SECURITY__SETENFORCE);
if (length)
goto out;
*/
audit_log(current->audit_context, GFP_KERNEL, AUDIT_MAC_STATUS,
"enforcing=%d old_enforcing=%d auid=%u ses=%u",
new_value, selinux_enforcing,




  1. I then changed my initrd image's /default.prop to contain: ro.secure=0 and ro.debuggable=1




  2. Since my manufacturer's initrd.img was missing it, I also compiled su.c from https://android.googlesource.com/platform/system/extras/+/master/su/ and placed the resulting binary under /sbin/su, making sure it is set to SUID root (chmod 04755 /sbin/su).




After that, I packaged the new kernel and the new initrd, as I explained in Episode 2 of my previous post - and booted from my own image:


adb reboot boot-loader ; fastboot boot myboot.img


So, are you root?


Yes, it initially appeared to be successful:


$ adb shell

shell@K01E_2:/ $ id

uid=2000(shell) gid=2000(shell) groups=1004(input),1007(log),1011(adb),
1015(sdcard_rw),1028(sdcard_r),3001(net_bt_admin),3002(net_bt),
3003(inet),3006(net_bw_stats)

context=u:r:shell:s0

shell@K01E_2:/ $ ls -l /sbin/su /sbin/_su
-rwxr-xr-x root root 131 2015-10-03 10:44 su
-rwsr-xr-x root root 9420 2015-10-03 01:31 _su

(the _su is the binary I compiled, set to SUID root, and "su" is
a script I wrote to tell "su" to add me to all these groups...)

shell@K01E_2:/ $ cat /sbin/su


#!/system/bin/sh
export PATH=/system/bin:$PATH
exec /sbin/_su 0,0,1000,1028,2000,2001,1004,1007,1011,1015,\
1028,3001,3002,3003,3006

And I have now achieved root:


shell@K01E_2:/ $ su

root@K01E_2:/ # id


uid=0(root) gid=0(root)
groups=1000(system),1004(input),1007(log),1011(adb),
1015(sdcard_rw),1028(sdcard_r),1028(sdcard_r),2000(shell),2001(cache),
3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats)
context=u:r:shell:s0

I am 100% sure I am root - not only because id says so, but because I can also do things that normal processes definitely can't:


root@K01E_2:/ # ls -l /dev/block/platform/msm_sdcc.1/by-name/boot
lrwxrwxrwx root root 2015-10-03 10:47 boot -> /dev/block/mmcblk0p16


root@K01E_2:/ # dd if=/dev/block/mmcblk0p16 of=/dev/null bs=1M
16+0 records in
16+0 records out
16777216 bytes transferred in 0.569 secs (29485441 bytes/sec)

Lo and behold - I can finally read raw partitions out of my tablet!


And SELinux is indeed in "down, dog" mode:


root@K01E_2:/ # getenforce                                                     
Permissive


But... there are still things I can't do:


root@K01E_2:/ # mkdir /my_mnt

root@K01E_2:/ # mount -t ext4 /dev/block/mmcblk1p2 /my_mnt
mount: Operation not permitted

That is, I can't mount my EXT4-fs formatted 2nd partition of my external SD card.


I also can't chroot to my lovely debootstrap-ed Debian:


root@K01E_2:/ # chroot /data/debian/ /bin/bash                             

chroot() fail
Operation not permitted

Is it because of SELinux?


I don't know - I am new (very new - one week old) to SELinux. I thought that when you put it to sleep (getenforce reporting "Permissive") it no longer interferes...


Apparently, I was wrong. Down the rabbit hole we go again...


Could it be because of my process context?


Remember that id returned... "uid=0(root) gid=0(root)... context=u:r:shell:s0"


Can I change that context? Being root and all, can I move away from shell? And if so, move to what?


The answer to the first question is runcon:



shell@K01E_2:/ $ runcon u:r:debuggerd:s0 /sbin/su

root@K01E_2:/ # id
uid=0(root) gid=0(root)... context=u:r:debuggerd:s0

Good. But what context will allow me to mount and chroot?


Reading some more about SELinux, back in my main machine, I parse the /sepolicy file on the root of the initrd.img:


linuxbox$ $ sesearch -A sepolicy | grep chroot
allow init_shell init_shell : capability { chown sys_chroot ...
allow init init : capability { chown dac_read_search sys_chroot ...

allow kernel kernel : capability { chown dac_override sys_chroot ...
allow asus-dbug-d asus-dbug-d : capability { chown sys_chroot ...
...

OK, a number of possibilities! Especially that kernel one seems promising:


shell@K01E_2:/ $ runcon u:r:kernel:s0 /sbin/su

root@K01E_2:/ # id
uid=0(root) gid=0(root)... context=u:r:kernel:s0


root@K01E_2:/ # chroot /data/debian/ /bin/bash
chroot() fail
Operation not permitted

Darn.


Who the heck is blocking me from chrooting?


Any advice most welcome...



Answer



Who the heck is blocking me from chrooting?


It wasn't SELinux - that was a wild goose chase (getenforce returning "Permissive" means that SELinux is indeed no longer in the picture).



The culprit - after adding quite a number of printk in the kernel's source to trace the failures of both chroot and mount - turned out to be capabilities. More specifically, Android's "capability bounding set" - you can read all about them via your man (man 7 capabilities) and I confess I have never before bothered looking into them - my everyday UNIX tasks depended on them and I had no idea... try this in your linux box to see for yourself:


$ getfattr -d -m - /sbin/ping
getfattr: Removing leading '/' from absolute path names
# file: sbin/ping
security.capability=0s......

See? Ping is no longer SUID root - it uses information stored in the filesystem's extended attributes to know that it has access to the raw sockets layer (so it can do it's ICMP thing - at the IP level that is).


Anyway, I digress - the surgery point in my kernel where I stopped the "drop my capabilities set" - in an arguably disgusting, "let them all march in" manner - was this (security/commoncap.c):


static long cap_prctl_drop(struct cred *new, unsigned long cap)
{

if (!capable(CAP_SETPCAP))
return -EPERM;
if (!cap_valid(cap))
return -EINVAL;

// ttsiodras: come in, everyone, the water's fine!
//cap_lower(new->cap_bset, cap);
return 0;
}


This means that capabilities are NEVER dropped - a very secure configuration, indeed :-)


$ adb shell

shell@K01E_2:/ $ su

root@K01E_2:/ # chroot /data/debian/ /bin/bash

root@localhost:/# export PATH=/bin:/sbin:/usr/bin:/usr/sbin:\
/usr/local/bin:$PATH


root@localhost:/# cat /etc/issue
Debian GNU/Linux 8 \n \l

Hello, my sweet Debian :-)


Oh, and "Root checker" works, too - I snipped "su.c", so everyone in my tablet can become root:


int main(int argc, char **argv)
{
struct passwd *pw;
uid_t uid, myuid;
gid_t gid, gids[50];


/* Until we have something better, only root and shell can use su. */
myuid = getuid();
//
// ttsiodras - Oh no, you don't :-)
//
//if (myuid != AID_ROOT && myuid != AID_SHELL) {
// fprintf(stderr,"su: uid %d not allowed to su\n", myuid);
// return 1;
//}


Now that it works, I must make it work properly - i.e. allow only my termux and Terminal Emulator users to invoke su and chroot, and not let everyone and their grandmother in :-)


audio - How can I make silent mode affect media volume too?



Silent mode is simple to toggle quickly and easily, but it only effects ringtone volume. I want it to work for media volume too, so I can use it to quickly toggle off game audio in public places. Is this possible? Or is there another simple solution? I have a Google Experience phone, so manufacturer-custom UI elements are no help.



Answer



RealSilent may do the trick for you:


Battery-friendly background service that will automatically mute
the media volume on your phone when you change the ringer to silent.

Features:
- Ability to mute on silent mode, as well as vibrate.
- Ability to restore media volume to what it was before going to silent/vibrate.


There's a bug report for this issue, but it hasn't been acknowledged by Google.


4.1 jelly bean - Slide unlock till pattern lock gets activated after interval


Using Jelly Bean, 4.1.1, on a Galaxy Nexus, I want this: You lock the phone. For the first 5 minutes, if you try to unlock, you can just slide and unlock it; after that, you have to enter a pattern.



I don't know how to get the slide to unlock to be activated for the 5 minutes in the middle. I have it set up right now so that it unlocks right away in the first 5 minutes, and asks for the pattern after that. Is this even possible?



Answer



I was able to set up what you want with one caveat: You have to use a PIN or a password, not a pattern. My solution depends on the apps Tasker (trial version here) and Secure Settings. Secure Settings requires root for some of its features. I don't know if this is one of them. If you aren't rooted, you can try it and see if it works.


Posting a complete how-to on Tasker is beyond the scope of my answer. Instead, here's the official documentation and links to user-created guides. My solution involves setting up two Tasker profiles. The first one sets the PIN or password after a timeout. The second one clears the PIN/password once the screen is unlocked.


Here are my profiles:


Profile: Screen Locked (98)
Event: Display Off
Enter: Anon (106)
A1: Wait [ MS:0 Seconds:0 Minutes:5 Hours:0 Days:0 ]
A2: If [ %SCREEN ~ off ]

A3: Secure Settings [ Configuration:Set Pin Package:com.intangibleobject.securesettings.plugin Name:Secure Settings ]
A4: End If

Profile: Screen Unlocked (107)
Event: Display Unlocked
Enter: Anon (108)
A1: Secure Settings [ Configuration:Clear Password Package:com.intangibleobject.securesettings.plugin Name:Secure Settings ]

Once you've got Tasker configured, go to your phone settings and set slide unlock (and set he timeout to be whatever you find to be an appropriate amount of time for the slide lock to come up) . Note that when the password/PIN is enabled, you'll first have to slide unlock, and then enter your PIN/password.


How does Google Contacts sync works?


I want to know the process of syncing contacts between Android Contacts and Google Contacts. The direction of sync, effect of updating contacts etc.




Answer



The way Google syncs contacts between Android devices and Google Contacts is through their Contact APIs.


Changing a contact within Google Contacts will push the change (when an account sync occurs) to the Device.


The same happens when you change or delete a contact on the device. It will trigger a sync with the Google Contacts and update, or delete the contact.


The contacts are tied to your account, so if you have multiple accounts on the device, and you sync Account A and Account B with Contacts, changes to a contact on Account A will only affect the contact tied to Account A. If you have the same contact in Account B, that contact will remained unchanged. So if you change the phone number in Account A, that contact will now have 2 phone numbers. The number from Account A, and the number from Account B.


You can also have contacts on the device that are not tied to a Google Account. These are usually saved directly on the device, or on the SIM card. They are not sync'd to Google Contacts. Changes made in Google Contacts will not affect these contacts, nor will changing the contact on the device affect Google Contact information.


Rooting & Flashing Huawei Ascend Y330



I have Huawei Ascend Y330 with Android 4.2.2. I was wondering what is the best approach to root my device and what is the best way to flash custom ROM with higher Android version (4.4 or even 5.0 if possible)?


I saw a lot of links on the internet, but all of them are not about Huawei Ascend Y330. I saw even strange guide how to flash my device to Android 5.0, but I don't think it's possible.




samsung galaxy tab - Can I disable MTP mode and just have a regular USB connection?


I have a Galaxy Tab 10.1, and it's been rooted.


Whenever I try to connect it by USB, it goes into MTP mode, which isn't working for me when connecting to my Ubuntu Linux computer.


I'd really rather not have to deal with some software to make transfers. I'd rather just have it show up as a USB exernal drive like my phone does.


Is there a way I can disable MTP and make my tablet just show up as a USB external drive?



Answer



I'm not 100% sure. But IIRC, the problem with normal USB storage is Android has to partition your phone for internal storage and USB storage. Your computer can then umount the USB storage from phone and mount it in your computer. So in many phones without MTP, even though the internal storage had capacity like 16GB, only 1 or 2 GB was available for app installation. While some phone gave up to 8GB for app, that space was wasted for people who didn't need that much for app but needed space for music and photos.


With MTP mode, there isn't separate partition but a whole single partition. So if you have 16GB internal storage in your phone, you can use whole 16GB for apps, music and photos.


MTP mode is available from Honeycomb and I don't think it's an optional component. I mean I don't think you can say I don't want MTP mode, I want USB storage mode.



Monday, July 10, 2017

2.3 gingerbread - Slide to unlock appears even when pattern lock is activated. How can I get straight to pattern lock mode after screen is turned on?


I thought the whole idea of pattern lock is to replace the 'slide to unlock' thing with something safe. Well I don't know if this is a bug or not but I have to 'slide to unlock' first before I can use my set pattern to unlock the phone (the epitome of redundancy). How do I get straight to pattern unlock after turning on the screen?.


By the way I own an Xperia Neo V running Sony's skin, Timescape UI




Sunday, July 9, 2017

wi fi - How can I easily copy files from an Android device to a computer wirelessly via command line?


I need to copy jpegs from an Android phone's sdcard to a computer, ideally through command line (/storage/sdcard1/*.jpg to a remote location)


I've tried Izzy's solution from this post like so:


scp -p -P 2222 root@192.168.1.19:/storage/sdcard1/*.jpg ~/Desktop/pull/

but got this error:


sh: scp: not found

The scp and ftp commands are missing on the device, so is there a way to get this working ?


I've also looked at busybox and had some success doing so:



cd /storage/sdcard1 && for jpg in *.jpg; do ftpput -u user -p pass 192.168.1.33 ./Desktop/pull/$jpg $jpg;done

Another thing that worked is this ls solution but for single files and I'm not experienced enough with bash scripting for this to work on multiple files.


I'm looking for the simplest solution (with fewest install/setup steps). What is the easiest way to do this ?




4.0 ice cream sandwich - How does ICS deal with Menus on devices with physical buttons?



ICS removed the need for the Menu key with always visible action bars, but also has support for phones which come with hard keys. Traditionally the menu button brought up a context menu.


I've got a device with hard keys, if I upgrade to ICS will the Action bar always be visible, standard ICS style, or will it be hidden under the Menu key? What will the menu key do in ICS?




samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...