Monday, June 29, 2015

touchscreen - How can I record touches?


Is there an existing app I can install that will record my touch interactions in the background? I just saw this and it made me want to play around with my touch data to see what it looked like. Didn't turn up any likely candidates here or in the Market. Google seemed to indicate that it is certainly doable if you write your own foreground app (which I have no interest in doing because I want to record my touches in the entire system), and that it might be possible using a custom-developed background app, which might be a fun project but I'd rather install an existing app if possible.




wi fi - How can I stop Lollipop ignoring my wifi network?


Android 5.0 has a new "feature": If a wifi network has no connection to the internet, it will remain connected to it but route traffic over mobile data instead. A small exclamation mark shows in the status bar over the wifi symbol.


Unfortunately, for some reason Android has decided that my home wifi does not have a good internet connection - which is not true, as I'm using it to access Stackexchange at the moment - and is, instead, trying to send everything over GPRS.


With mobile data disabled, things work over wifi just fine, despite the exclamation mark - so it isn't a problem with the wifi not working, per se.


Is there any way to override this "smart" feature? The only way I have found to make things work at the moment is to disable mobile data while I am in my house - which is not a practical long-term solution.


EDITING to add that I have now solved this problem by buying a new router! I was using something very old... But, I'll leave the question here for the benefit of anybody else with the same difficulty.




Answer



Just disable captive portal detection. In the terminal, or in adb shell, issue the command


settings put global captive_portal_detection_enabled 0

and reboot.


Sunday, June 28, 2015

rooting - How do I root a ZTE Fury?


I've tried many methods (ZergRush, I get [-] Hellions with BLUE flames!).
SuperOneClick uses ZergRush which doesn't work.


I'm running Android 2.3.6.
Baseband Version is: N850B01 (first update after launch)

Anything else I'd be happy to tell.


I've tried flashing a ZTE Warp CW mod to it using some batch files, but it pauses at the "Waiting for device" when it's in recovery mode.


It has a way to "apply update from SD card" but it needs a signed .zip and the ZTE Warp's ROMs don't work because its signatures fail (I think that's why)..


If anyone out there could help me, I'd be more than happy to receive the help.


Even if that means you experiment with the phone somewhat.
(As long as it works at the end of the day.)




root access - ES File Explorer shows empty /data/ folder


I'm looking for the whatsapp key file on my phone (which should be stored in /data/data/com.whatsapp/files/key).


Therefore I:



  1. Rooted the phone Galaxy S5 (Android 4.4.2)

  2. Checked the root status with Root Checker (it's rooted!)

  3. Downloaded ES File Explorer


  4. Opened /data/ folder in order to find the key file with ES File Explorer...


but the folder is empty!


Is that folder really empty or am I missing something?



Answer



ES File Explorer does not show /data on any of my rooted devices.


Not on my S5, not on my Note 2, or HTC One M7. I've heard other people easily using ES with root, but it never asks me for root permissions, just shows blank folders, like you.


I use jrummy's Root Browser on my S5, but any "root file explorer" will do.


ES File Explorer just doesn't cut it.


Hope this solves the problem.



Unable to locate SDK when starting Droid Explorer


When I launch Droid Explorer I get an error message that states Unable to locate the android SDK tools, please reinstall the application.


Unable to locate android sdk tools


I installed the Android SDK tools from the SDK Download Page.



Note: I am the lead developer of Droid Explorer. I am posting this question as I get a lot of bug reports for this issue. I am trying out using Android Enthusiasts as some what of a support Q&A for Droid Explorer. I will monitor any question tagged with .



Answer



Droid Explorer, at its root, depends heavily on the Android SDK. It communicates with your devices via ADB.


When Droid Explorer launches, it does some system checks to make sure the tools that it needs are accessible. These mainly include adb and aapt. There are some other tools that it uses, but these are the main ones that it needs to communicate.


There are 2 types of errors that can happen with the SDK not found:




Registry Error


If you see the following error message:


Unable to locate the SDK Version in 'HKLM\HKEY_LOCAL_MACHINE\SOFTWARE\DroidExplorer\InstallPath'. Try reinstalling the application.


When you first install Droid Explorer, it will ask you for the location of your Android SDK. This value is stored in the Registry.



32bit:


HKEY_LOCAL_MACHINE\SOFTWARE\DroidExplorer\InstallPath

64bit:


HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\DroidExplorer\InstallPath

Under this location, you will see a value called SdkPath. This needs to be the location of the root of your Android SDK.



  • Make sure Droid Explorer is closed.

  • Open Registry Editor


    • WIN+R

    • Type regedit

    • Press Enter



  • Navigate to the location explained above

  • Set the value of SdkPath to be the path to your sdk: My location is d:\android\android-sdk\.

  • Close the Registry Editor.

  • Launch Droid Explorer



If you still are getting a registry SDK error after following these instructions, Ask a Question and add the tag.




File System Error


If you see the following error message:


Unable to locate the SDK tools. Try reinstalling the application.


This error usually happens when you install the Android SDK, but do not run the SDK Manager and add the required packages to the SDK.


As a rule of thumb, you should follow Step 1, at a minimum, for what packages should be added to the SDK.


Source




1. Get the latest SDK tools


As a minimum when setting up the Android SDK, you should download the latest tools and Android platform:




  • Open the Tools directory and select:



    • Android SDK Tools Android SDK

    • Platform-tools

    • Android SDK Build-tools (highest version)





  • Open the first Android X.X folder (the latest version) and select:



    • SDK Platform

    • A system image for the emulator, such as ARM EABI v7a System Image






Your SDK Manager should look something like this: SDK Manager


If you still are getting a file system SDK error after following these instructions, Ask a Question and add the tag.




Extra information about how Droid Explorer looks for these tools:


It will look in 3 places for each tool that it needs to use.



  • [SdkPath]/tools/

  • [SdkPath]/platform-tools/

  • [SdkPath]/build-tools/[latest-version]/



Older versions of Droid explorer looked in [SdkPath]/platforms/[latest-version]/tools/ but this path is no longer valid in the SDK.


htc desire - How accurate is the GPS in my Mobile Phone?


I was wondering how accurate is the GPS is in my HTC Desire Android compared to a dedicated hand held GPS unit or in car satnav?


The reason I ask is that I have read articles complaining that the iPhone's GPS is not very accurate and wondered if it applied to all mobiles.





Saturday, June 27, 2015

Enable and disable system apps via ADB


Is there any adb command to enable/disable a system app?


Thanks



Answer



Yes. The command is pm disable . You must be root in order to do this:


Open shell and get root:


PC> adb shell
shell@hammerhead:/ $ su

List all enabled apps, filter by "calculator":



root@hammerhead:/ # pm list packages -e | grep 'calculator'
package:com.android.calculator2

Disable app:


root@hammerhead:/ # pm disable com.android.calculator2
Package com.android.calculator2 new state: disabled

List all disabled apps:


root@hammerhead:/ # pm list packages -d
package:com.android.calculator2

package:com.google.android.apps.inputmethod.hindi
package:jp.co.omronsoft.iwnnime.ml
package:com.google.android.inputmethod.pinyin
package:com.google.android.inputmethod.korean
package:com.google.earth
root@hammerhead:/ #

Some other things worth noting:



  1. In my testing, apps disabled in this manner disappear completely from the Settings > Apps list. They do not even seem to be displayed in the "Disabled" tab


  2. You can re-enable apps with pm enable . In fact, this seems to be the only way to re-enable them, in my experience.


settings - How can I adjust my screen's color temperature?


Redshift is a Linux application similar to Windows' F.lux, which gives the screen a red tinge automatically at night. Supposedly, it reduces eye strain and helps prevent sleep problems.


Is there any way I can adjust my screen's color temperature to create the same effect on Android?



Answer



There are a fair few blue light filter apps on the Play Store that may suit your needs. The exact features will vary, but they all fit the general scheme of allowing you to adjust the color temperature of your screen.


Additionally, if your device is rooted, you can actually use f.lux nowadays.


How do I change the default SMS application on my HTC Hero?


I recently got completely fed up with the built in Messages (SMS) application and switched it out for Chomp (also looking at Handcent, haven't decided on one yet). I want to use the "Messages" icon though, as well as treat the new app as the default SMS program. I know about "Manage Applications" and clicking the "Clear Defaults" button for the app. But the "Clear Defaults" is disabled for the Messages app and it says that no defaults are set. I read on someone else's post that their AT&T provider had somehow hardcoded this as the default app and they couldn't change it. So...


Can they really do that? Is that why my HTC Hero doesn't let me clear the default? Is there a way around that?



Answer



One word. Root. I would suggest rooting as a solution to your problem. Here is documentation for how to root your CDMA Hero: http://forum.xda-developers.com/showthread.php?t=581577


networking - Does Android have support for IPv6?


I wonder if Android has support for IPv6? I have heard that the phone company I use has support for IPv6 and I have a IPv6 address if I visit http://ipv6.whatismyipv6.net.ipv4.sixxs.org/.


But I can not visit IPv6-only sites like http://ipv6.google.com, why is that? Does Android have support for IPv6?



Answer



As of Android 6.0, the majority of the IPv6 protocol seems to be supported with significant parts missing such as DHCPv6. Check this Google thread for more info, specifically the issues listed in this post.


rooting - Root HTC one V on Mac OS X


I'd like to root my HTC One V. Are there any tools specifically for this?


I'm trying to follow this guide but having trouble with step 6 in the HTCdev-Unlock Bootloader guide.


Currently, running Mac OS X 10.7.5.





Friday, June 26, 2015

video - Android Software or Device to present Application on Screen


Well this is something that came to my mind, Does anyone know if there is a Device or a cable that i can plug to a DataShow so it is possible to present an Android Application live and fullscreen, doing all the tap and swipe events?


If not at least is there is something that its able to record a Screencast of an android application for presentation purpose of course?



PD. BTW i did not found right tag for this question, so if someone can retag it it would be nice too :D



Answer



I happened to found that the best way to do this is with a project call androidscreenscast, which is really easy and great:



  • just plug your phone.

  • Downloads the jnl on the site

  • And enjoy your screen


I wrote a post about my experience Present your android application on a Datashow.


Wednesday, June 24, 2015

rooting - Rooted phone missing key features, help!


I have a new MetroPCS Lg Leon running lollypop 5.02. I rooted it with kingroot apk (bad idea) and I cannot get the menu bar or swipe gestures to work. I.e. swipe to search, there is no pull down menu.


I must have messed with some settings in root but I factory reset the phone multiple times and hot reset it if that is any different with the battery out. Not corrected.



The lg startup screen starts each time I boot it as well. Any suggestions?



Answer



Finally found an answer. I had to give the android system full root privledges and/or unroot. It updated as it should to a new version of lollypop in a few days time. Any better answer please post.


hardware - Enter fastboot commands from an Android phone


I want to do the following without a PC, just directly from an Android phone using a script / Android Terminal:



Reboot into bootloader, and then enter a few fastboot commands




Is this possible?




Tuesday, June 23, 2015

navigation - GPS app to follow a prepared itinerary


I am preparing a 1-week bicycle trip. We can't use high-traffic roads, so I am preparing a quite complex route on small country roads, using Google Maps.


With my phone saddled on my bicycle, is there a GPS app that will "guide" me using the itinerary I crafted? Turn-by-turn would be ideal, but just writing the itinerary as a map overlay would be better than nothing.


Note: My phone is WiFi only so I will need an application that can cache a lot of maps, like AndNav2 or Maverick. Also, I am stuck with Android 1.5



Answer



Here is what I ended up doing, it works well:





  1. On your computer's Firefox, install the GMapToGPX bookmarklet.




  2. Prepare your itinerary with Google Maps Itinerary.




  3. While still on the Google Maps page, click on the GMapToGPX bookmarklet. It opens a GPX conversion dialog.





  4. Click on the blue tab buttons to make them read like this: "Route Track Points About". It will not work otherwise.




  5. Copy-paste the XML text in a new file, for instance myitinerary.gpx




  6. On Android, install Maverick.





  7. Copy your GPX file to /sdcard/maverick/tracks




  8. In Maverick, select the track file




  9. Scroll your way along the route at appropriate zoom levels to store the tiles in the cache.




The free version of Maverick allows 3 tracks files.



samsung galaxy s - Can I make a full backup of my phone with Odin and without root?


As a follow up to this question, is it possible to use Odin (or Heimdall) to save a complete image of my phone without root?


Odin already allows me to completely overwrite pretty much everything on my phone without root. Can Odin be used to read the entire contents of the phone over USB without root? Ideally, I'd expect the output of such a read to be something I can write in the future with Odin.


While this question is somewhat general, I'm guessing that by asking about Odin and Heimdall I'm limiting it to Samsung phones (though I may be wrong).



Answer



Odin is Samsung-only, you're right. (And as far as I know it isn't for all Samsung phones either, though I could be wrong on that.) Since Heimdall is, as far as I know, just an unofficial port of Odin I would assume it's the same, but I've never used it.


Odin3 has a "Dump" function that I had never used. It seems to be disabled in v1.8x and v1.7, but not in v1.52.



I just tried it in v1.52 and it didn't work. You hit the Dump checkmark under Option, select an output file via the Dump button under File [Dump], then hit Start. Odin will say "OneNAND Dump Start" or similar as it backs up the device. It only backed up 1 KB of something before halting, though. Odin just sat there without giving an error message.


You might have different results with a different device (I have a Vibrant). I'm also wondering whether my Ext4 lagfix might be affecting this. Perhaps later I'll flash to stock 2.1 and try again. Edit: No change on stock 2.1 JFD.


Monday, June 22, 2015

time zones - What happens when a country changes its DST schedule?


What happens when a country changes its DST schedule? For example, Israel has just lengthened its Daylight Savings Time by a month. It seems like no firmware update was issued by Google for this. How does Android update its timezones and times?




Is it allowed to offer incentives for 5 star ratings on the Google Play app store?


I started using an Android app that is offering in-app incentives (unlocks) in return for 5 star ratings on the Google Play app store. Is this against Google Play's terms of service?



Answer




Highlighting one part of policy violation, related to what you say



Here are some examples of common violations:


Asking users to rate your app while offering an incentive




Edit:



4.0 ice cream sandwich - Clone and distribute Android 4 device with preloaded applications


This may be related to Clone Android Device but I don't think it fits my need. I'm looking to accomplish something similar to Sysprep for Windows, which would allow me to distribute Android devices with preloaded applications and settings, such as:



  1. Intitial data, settings, and connection information

  2. Preloaded applications, with proper licenses/keys for non-free applications

  3. addon / restriction for users


Is there a way to do this?





Sunday, June 21, 2015

rom flashing - Why is it that Android still can't be installed as regular OS?


Are there any technical or others reasons why Android is still a firmware and not an OS which can be just installed without a lot of hassle?



Why there is no universal image which could detect appropriate drivers (kernel modules), partition NAND in some standard way and configure boot loader to boot updated OS version?


What stops Google from making a real (less firmware-like) OS (an OS for small ARM, x86 etc. devices)?




Switch to another keyboard language using stock keyboard


I have an Xperia (SOL21).


How can I fast switch to another keyboard language, using the default keyboard?


I'm mostly typing in Japanese, but usually swiftly change to Swedish and English (on a non-Android device). How do I do it on Android?




gps - How do I set Google Latitude to auto-update with location regularly?


When I use Google Maps it sets my Google Latitude location, but once I turn Maps off it stops. I'd like it to update with my location on a regular basis. I don't want to drain the battery by always using the GPS, but it'd be nice if it updated, say, every half hour or so.



Answer



I found this from the Google Mobile Help forum after a little searching. It's from 8/15/09 so I actually see something a little different on my phone Settings > Location > Google Location Services. I haven't tested it but hope it helps.


Quoting the site:



Hi everyone, Apologies for not updating this thread specifically sooner. There is a new version available in Android Market (version 3.1.2). Just search for "Google Maps" if you have at least the 1.5 system update (Cupcake) and install this over your current version of Maps.


Please let me know if you experience background location updating issues with this version. As long as you have enabled automatic location detection in the Latitude privacy menu and have enabled location detection (Settings > Security & location > Use wireless networks), Latitude should update your location while your phone is on. This means your location should never appear older than ~1 hour to any of your friends.



Thank you all for your patience! Chris



performance - galaxy s2 cellphone problem; possible virus


I read that it is used on the computer.


It has been coming up on my Android Galaxy 2 s. It is on at least 3 times at once and up to 7 or 8 at once. They are called kworker/0:1 through kworker/0:4 and/or kworker/u:1 through kworker/u:4


Occasionally, it comes up as using about 80 % of the CPU. My phone also regularly crashes as of recently. Could kworker be the problem?


The virus I have also is kind of trojan-based and has popups when I restart my phone sometimes. Also, when my phone is asleep, and i turn it back on, it says kworker is using 100% of my CPU data.




Saturday, June 20, 2015

wi fi - How can I tell my device to ignore a public Wi-Fi network?


The city I live in has city-wide Wi-Fi available for a subscription, but the Wi-Fi access point is public.


This means that everywhere I go in the city I get a notice that there is public Wi-Fi available even though I can't use it because I don't have an account with the city-wide Wi-Fi service.


How can I tell my phone (Droid X, Android 2.2.1, not rooted) to ignore Wi-Fi named "CityWifi"?


I'd like to get notification for other Wi-Fi networks, just not "CityWifi"




root access - I've rooted my phone. Now what? What do I gain from rooting?


This is a common question by those who have just rooted their phones. What apps, ROMs, benefits, etc. do I get from rooting? What should I be doing now?




Answer




Root File Explorers


You can remount your /system/ directory read-write, which will allow you to remove carrier-shipped applications you don't like and so on. Root file explorers can allow you to view all folders on your phone, such as /data/ which is normally protected.



Patching Apps


With root access you can patch other apps to gain special access to functions, or removal of self-protection for some apps.



  • Freedom - Get iAP (in-App Purchase) for free! Buy diamonds, rubies and Pro unlocks without real money. Note: Legal restrictions may apply depending on your country/region.

  • Lucky Patcher - Patch apps so that they don't require Google Play Services / displays no more ads / automatically become Pro version / work at certain DPI... There's many you can do with Lucky Patcher and there's even a bunch of patches provided already.



Moving & Removing Apps


Access to /system also means you can move apps or updates to system apps from /data to /system (with caution!), if the partition has enough space.



  • Titanium Backup - Back up all of your applications and data. Also allows you to uninstall or freeze system apps, integrate updates into your ROM to save space, move apps to SD, and more.

  • apps2rom - does for free what the pro version of titanium backup does: lets you move apps to the system partition.

  • Bloatfreezer - Freeze or remove system apps

  • Link2SD - Move (system) applications to a second partition in SD card, liberating loads of free space in /system partition.


Note that moving apps to the sdcard has risks and cons, and should be undertaken only if space is needed. Most modern devices have enough memory for many apps (16GB+), providing that photos/videos/music are stored on an external sdcard.



Tethering


Some devices already have Wi-Fi tethering out-of-the-box, like the Samsung Galaxy S, so this isn't such a big deal on them unless the carrier charges for the feature.



Screenshots & screen recording


root is needed for screenshots before 4.0-Ice Cream Sandwich. Most pre-lollipop screen recorders also require root.



Backups



  • Titanium Backup - Back up all of your applications and data. Also allows you to uninstall system apps, integrate updates into your ROM to save space, and so on.

  • ClockworkMod Recovery (ROM Manager) - Usually requires root to install via ROM Manager. Allows you to backup the entire device, including your ROM, as well as flash new ROMs and other advanced tasks.



There are also many apps that claim to make a full nandroid backup.


Application/Network Control




  • AdFree - Removes ads by changing the hosts file (so both ads in apps and in browser)




  • Adaway - Also blocks in-app adds.





  • Droid Wall - Firewall application. Got an app that's using up all your data when you're not even using it? Block it with this!



  • Orbot - Tor app

  • Cache Mate - Clear cache of all apps

  • Droid VNC Server - Connect to your phone via VNC

  • LBE Security Master - Selectively revoke permissions from app

  • Button Savior - Helps to add on screen button to compensate a failure of a physical button.

  • ClockSync - to automatically sync the device's time with few predefined atomic clocks.



Xposed Framework


The Xposed framework allows apps with advanced tweaking functionality to be installed.



  • GravityBox (for Android 4.2 4.4 5.0 5.1 6.0) - An app that provides many system tweaks.

  • XInstaller - Various tweaks for Package Installer.

  • XHangouts - Improved version of google hangouts.

  • XWhatsApp - Mod for the popular whatsapp messenger.

  • XPrivacy - Finegrained app control.


CPU Control




  • SetCPU - Control the processor speed of the phone, can also setup profiles. It allows underclocking based on conditions, e.g. underclock to 125mhz when screen is turned off. It dramatically increases battery life without affecting performance (when you're actually using apps / the phone) or can improve performance via overclocking.

  • Overclock Widget - Similar to SetCPU but less functional


Enable swap file / partition



Advanced and Miscellaneous



  • ROM Manager - Facilitates installing new ROMs with ClockworkMod Recovery, and allows you to back up your entire device (ROM + apps + data) and other advanced tasks.

  • Quick Boot - Allows you to reboot into recovery or the bootloader / Download Mode.


  • LED Hack - Disable LED on phone (no longer available on Android Market)

  • Lag fixes - Various tweaks and filesystem changes to speed up your phone or prevent issues with your phone pausing / freezing temporarily. These are particularly useful on some Samsung phones that use an RFS filesystem. An Ext4 lagfix like Voodoo is recommended, but there are also Ext2 lagfixes like RyanZA's One Click Lag Fix which also allows you to change advanced memory, Wi-Fi, and disk scheduling options.

  • TRIM - Some older kernels do not have TRIM.

  • StickMount - Automatically mount USB flash drives, keyboards, mouse via USB OTG cable.

  • BusyBox - Makes terminal emulators feel more like linux.

  • Sideloading apps. Most carriers/phones allow this option but AT&T does not.


ROMs


Though root is not required for flashing new ROMs, many apps that make it easier do require root.


CyanogenMod is a very popular rom that many people put on their phones. It is also easy to install via the ROM Manager app. First install the Clockwork recovery. Then run a backup before you flash any roms.



Also check out "Where can I find stock or custom ROMs for my device" or the XDA forums for other custom roms. Most devices have a specific "Android Development" sub-forum where ROMs are posted.


Always do a nandroid backup before installing any rom or mod! You may also need to wipe all data and cache from your phone before installing or upgrading a ROM.


Custom Kernels

One popular set of kernels is those provided by ChevyNo1. You can also download them via the premium version of the ROM Manager. Make a nandroid (ClockworkMod) backup before using these kernels! You'll also want to get SetCPU to make the most out of these kernels.


Start with the low voltage kernels at the lowest speed and work your way up to the 1.2GHz. If your phone is stable up to the 1.2GHz range, then try some of the ultra low voltage kernels. If you start getting force closes, then switch back to a low voltage kernel.


Basically each phone (of the same phone brand/model) varies by which kernel it can handle due to the manufacturing differences between processors. So I may have a Motorola Droid that can run ultra low voltage kernels and yours may not be able to run them. These phones weren't necessarily designed to run like this.


adb - How to recover a deleted file from /data partition?


I factory reset my rooted Android M phone but now I realize that there was a file in the /data directory which I need.


Is it possible to create an image (.img or something similar) of the /data partition so that I could run some recovery software for ext4 on that image? I have a little knowledge about ADB.




Answer



First to clarify root and data:



  • Root directory / of Android devices is a read-only pseudo (temporary) filesystem (rootfs) that lives in RAM and is vanished when device is powered off. When device is powered on, it's again extracted from initramfs that lives in boot partition along with kernel.
    On newer devices with system-as-root, system partition is mounted at root /.

  • /data directory is a mountpoint, where largest partition, usually named userdata is mounted. This partition contains all user apps, their data (settings, databases, caches, temporary files etc.), system apps' data and all other configurations we make through Settings. /data/media/0 is the directory that we see as /sdcard or /storage/emulated/0 through emulation.



... there was a file in the /data directory which I need. Is it possible to create an image (.img or something similar) of the root directory ...




If a file is deleted from /data, you need to create a dump of data partition, not that of root directory.


You can do that in multiple ways described below. All require root access.




But first of all see this answer to make sure your data is recoverable.
In short, recovery is more or less possible only if (1):



  • Your deleted data hasn't been TRIMmed or discarded.

  • And you haven't done a factory reset on encrypted /data partition.


What you should do immediately:




  • Switch off phone to make sure the deleted dats isn't overwritten.

  • Don't install data recovery apps on device, it can do more harm than good.

  • Mount the filesystem (if required) in recovery mode (or on PC) only with ro,nodiscard options.




FINDING BLOCK DEVICE:


In order to access userdata partition, you need to find its block device. If you have root access, you can do so from mounted partitions:


~# mount | grep 'on /data'
/dev/block/mmcblk0p... on /data type f2fs (rw,nosuid,nodev,...)


On Qualcomm devices, it's located at /dev/block/bootdevice/by-name/userdata (symlink). For MediaTek (MTK) and other SoCs, the path is slightly different. You can find all block devices or by-name directory using find command:


~# find /dev -type b
~# find /dev -type d -name 'by-name'

Or by hit and trial:


~# ls -d /dev/*/by-name
~# ls -d /dev/*/*/by-name
~# ls -d /dev/*/*/*/by-name


Note:



  • If your /data partition has Full Disk Encryption (FDE) and you unencrypted it in recovery, DMCrypt will create block device at dev/block/dm-0. Use this instead of userdata.

  • To prevent any data loss, recommended is to create dump when partition is not mounted i.e. in recovery mode.


CREATING PARTITION DUMP:




  • DISK DUMP (dd)
    Once the block device is known, you can use dd command from:




    • ADB shell (OS or custom recovery)

    • A terminal emulator app like Termux


    Since the userdata partition is the largest partition (all other partitions hardly using 5GB out of total storage), you can't dump it to your internal memory. An external SD card with larger capacity is needed.


    To create dump:


    ~# dd if=/dev/block/bootdevice/by-name/userdata of=/path/to/ext_sdcard/data.img


  • ADB

    If you don't want to use external SD card, you can also dump the partition directly to PC. First you need a working adb setup, running as root. Then it can be used in multiple ways:


    ~$ adb exec-out dd if=/dev/block/bootdevice/by-name/userdata > data.img  

    * Make sure your adb binary (on Windows or Linux) supports exec-out.


    But you may end up with corrupted data when writing a whole large-sized partition to STDOUT of terminal because there are issues with line break types (CR LF). Also STDOUT or STDERR from the programs involved could possibly be added to file if not directed to /dev/null. Even a single wroge byte may render filesystem un-mountable. See this question for reference.
    To avoid unwanted characters, use stty raw and/or dos2unix:


    ~$ adb shell 'stty raw && dd if=/dev/block/bootdevice/by-name/userdata' > data.img

    But the most straightforward way is:


    ~$ adb pull /dev/block/bootdevice/by-name/userdata data.img


    See this answer for more details.




  • STREAM OVER TCP
    To avoid the terminal related complications described above or if for some reason adbd cannot be run as root, it's also possible to create a minimal TCP server for data transfer. Forward port from phone to PC and run netcat TCP server in listening mode:


    ~$ adb reverse tcp:1024 tcp:1024
    ~$ nc -v -l -p 1024 data.img

    On phone:



    ~# cat /dev/block/bootdevice/by-name/userdata | busybox nc 127.0.0.1 1024


  • USB TETHERING (RNDIS)
    To avoid using ADB at all, USB tethering can be used to provide network connectivity:


    ~# cd /sys/class/android_usb/android0
    ~# echo -n 0 >enable
    ~# echo -n rndis,adb >functions
    ~# echo -n 1 >enable


    * You may also change other files like {iSerial,iProduct,iManufacturer} and f_rndis/{ethaddr,manufacturer,wceis,rndis_transports,max_pkt_per_xfer} in above directory if required.


    Add IP address:


    ~# busybox ip rule add lookup main
    ~# busybox ip address add 192.168.1.1/30 dev rndis0
    ~# busybox ip link set rndis0 up

    On PC add IP manually (there's no DHCP server):


    ~$ sudo ip address add 192.168.1.2/30 dev usb0
    ~$ nc -v -l -p 1024 data.img


    On phone:


    ~# busybox nc 192.168.1.2 1024 

    In the same way it's also possible to use rclone rcat to transfer dump over WebDAV or FTP or SFTP. See How to stream an encrypted backup of the entire device to remote host?




  • USB MASS STORAGE (UMS)
    This method is useful if you don't want to create a dump of partition, instead access partition directly on PC.


    UMS is disabled by default on newer Android devices and only MTP is enabled. However you can enable that in custom recovery mode:


    ~# mountpoint /data && umount /data


    ~# echo '0' >/sys/class/android_usb/android0/enable
    ~# echo '/dev/block/bootdevice/by-name/userdata' >/sys/class/android_usb/android0/f_mass_storage/lun/file
    ~# echo 'mass_storage' >/sys/class/android_usb/android0/functions
    ~# echo '1' >/sys/class/android_usb/android0/enable

    * Kernel should be built with CONFIG_USB_F_MASS_STORAGE
    * Paths may vary depending on device


    Now userdata will appear as a partition on Linux PC just as we connect a USB drive. If /dev/sda is the hard disk drive, usually /dev/sdb will be the userdata partition. You can find that by using blkid command:


    ~# blkid | grep userdata

    /dev/sdb: PARTLABEL="userdata" PARTUUID="..."

    You can run recovery progam directly on block device or mount the filesystem (if needed) or may also create a dump.




HOW TO RECOVER DATA?


There are basically two ways to recover deleted data as mentioned in this answer: carving method and through filesystem.


Recovery tools mostly don't need mounting filesystems but if it's required, it needs to be done on Linux PC because Windows doesn't support ext4 or f2fs natively, hence the tools aren't easily available AFAIK.


If anyone has been able to successfully make block/journal level access to Linux/Android filesystem for data recovery on Windows through Ext3Fsd or any other driver, let me know so that I can update the answer.


On Linux you can use tools like extundelete to recover data using filesystem journal:



~# extundelete --restore-all data.img

Or to recover data directly with UMS:


~# extundelete --restore-all /dev/sdb

Since you have done a factory reset which erases filesystem, consider carving method using tools like testdisk or scalpel:


~# testdisk data.img

In the same way you can use any other data recovery tools. See ArchWiki File Recovery for more details.





RELATED:



Friday, June 19, 2015

nexus 5 - How to end do not disturb mode?


Not able to end the do not disturb mode. Tried clicking the 'end now' tab repeatedly, doesn't work. Neither there's anything in the settings nor in the slide down quick settings.


It's getting inconvenient to check the notifications, as the mode says 'priority only'. What are the solutions?




Thursday, June 18, 2015

I don't want my Whatsapp Media to restore (Google Drive BackUp)!


I recently uninstalled and installed whatsapp on my samsung galaxy s2; and it started to restore my chats. I'm fine with my chats but after being done with the chats, it automatically started to restore the old media too, which would cause my phone to download a data of 2 gb. I want to stop it, but i cant find how to stop it. (It used to restore only messages before having the google drive backup)!!!


Thanks for any answer.




2.2 froyo - Angry Birds Seasons "Installation Unsuccessful" -- Help?


I have tried several times to install Angry Birds Seasons from the marketplace. Every time, I get a notification saying "Installation unsuccessful" without anything more descriptive. Has anyone else run into problems installing it? Is there any way I can get a more detailed error message explaining what part of installation failed?



HTC Evo 4G


[Update] 7.15GB free on my SD card 196 MB free internally


[Update 2] I got this error again when attempting to update to the Valentine's day version of Angry Birds Seasons. Once again, unmounting the SD card and installing it seemed to work successfully. Further, my save data was still in tact after remounting.



Answer



I had a very similar issue on my HTC Incredible. Try unmounting the SD card (Menu->Settings->SD & phone storage->"Unmount SD card" on my Incredible) and then installing the app. After it finished installing, you can then remount your SD card.


Wednesday, June 17, 2015

internal storage - What is the difference between application cache and data?


Every app has data and cache.



In Android, what is the difference between the two?



Answer



App developers decide what information to be kept in "data" and what to be kept in "cache".


Usually, "data" is used for account info, settings, saved activity data, game scores, and whatever is need to be kept permanently. Clearing data will make your app "forget" everything like you have reinstalled it.


"Cache" holds all information and files that can be retrieved somehow (from the internet, or other way). For example social apps can cache all your feed data (photos, comments, and so on). Clearing cache may lead your app to reload all the lost (and necessary) data from it's original source. It shouldn't make your app behave bad.


app2sd - Move to SDCard option Disabled


I have a Samsung Galaxy Music Duos GT-S6012, which I got 2 days back. It has android 4.03.


The problem is I am not able to move my games and some apps to the SD card. The move to SD card button which is normally visible in the application manager is not visible in my phone. Please help me.



Is it default behavior on the phone, or is there a problem?


I even tried the move2sd app, but it did not work.




wi fi - How to use Android device as router without cellular connection?


I have an Android tablet that has no SIM card and no cellular connection. Is it possible to set it up as a discoverable WiFi access point? I know when you have a cellular connection you can set up tethering and have an id and password that can be discovered by other devices. Is it possible to do this without any cellular connection?


I don't actually need internet access at all. All I'm looking for is to set up a small WiFi LAN between an Android tablet and a small device running Debian Linux.




sms - Migrating SMSes from Windows Mobile to Android phone


I want to migrate all my SMSs from WinMo to Android.


I currently use PIM Backup to make a backup in case WinMo gets hard resetted, and it works fine. I have complete history of received and sent messages. I tried SMS Exporter but it looked like the XML file doesn't contain sent SMS (bad!!)


I tried Sprite Backup: it generates a good EXE file with possibly all the messages it in, but I couldn't restore it by copying the generated files into Android SD card and opening Sprite Backup for Android, since it listed no backup file available in SD.


I also read about Sprite Migrate from a 2010 blog post, but I see no more traces of it.


What can I do to migrate SMSs? Contacts are no problem: I'll use LocalSync for Windows



Answer



I guess this article was made for you: Import/Export/Move SMS Messages from Windows Mobile to Android. It mentions several tools to export your SMS from WinMo to an XML file, which then can be imported on your Android device without involving 3rd party tools. It also links to more useful articles on this topic.


EDIT:


As the OP commented, he was successfully using the Piemaster.NET guide mentioned on the page I originally linked. As suggested, I add it here in case the originally linked page is unreachable some day.



htc hero - Why can't I Sync Picasa Web Albums?


Device: T-Mobile G2 (UK) / HTC Hero OS: 2.1


I would like to Sync Picasa Web Albums, like on this video http://www.youtube.com/watch?v=PIfjt3pye5c. However, the option is not present - only contacts, Google Reader, Google Mail, calendar. I've tried visiting Picasa Web Albums site on my phone browser, and re-starting the phone, but it's not there. How can I enable it?


Edit (28th Jan) - I raised a ticket on support.htc.com about this a while ago. Here are their responses...





  • "Dave": "Do you have the Picasa option showing in the accounts and sync folder of Settings on your phone, please?"




  • "Dave": "Can you confirm you are running at least Android 2.1 on your handset?"




  • "Richard": "Christopher, your email has been passed to myself for further action as there has been no activity on it since the 22nd Jan. Picasa is a 3rd party application and you will need to install additional software from the Android Market to enable this functionality. (Picasa Album Sync is not pre-installed on your phone.) "





  • "Richard": "The picasa sync is not pre-installed on any of the HTC handsets running Android 2.x. I have checked several android phones running 2.1 and 2.2 that we have here and none of them have a Picasa sync option. I will pass on this information to the developers and inform them that a customer has asked for this function to be included on the phones. This may lead to it being implemented in a future update. In the meantime if you want that functionality then you will need to obtain 3rd party software which can provide it."




I'm not sure why Dave asked those questions, when Richard is adament that the functionality doesn't exist. Does anyone have any examples of Picasa working on HTC handsets running Android 2.x?




Tuesday, June 16, 2015

How to do USB tethering with an Android Froyo and a Mac OS X?


With Android Froyo (OS 2.2), how can I do USB tethering with a Mac OS X?




settings - My Samsung Galaxy Note 8 Doesn't Show an "Allow USB Debugging?" Prompt. Is there a fix?


Around this morning, I had the idea to transfer all my whatsapp chats(from android to ios)


Not so complicated, right?


Well, I was in for a rude awakening. Not only did I spend literally 7 hours trying to fix it... I couldn't fix it!



That's basically why I'm reaching out to you. My last hope. My knight in shining armor.


Here are the more technical details:



  • Before you say it, and I know you will, I'll tell you - I restarted my phone about 10 million times

  • I've enabled and disabled usb debugging around 10 million times minus 1.

  • I haven't played with adb so I don't screw with my android system. However if that's necessary, I'll do what must be done.

  • I'm specifically using my own samsung galaxy note 8 since I previously tried on another phone(LG v20) and it didn't work either.


So, I must ask you, are you up to this challenge? Can you fix what seems unfixable?


P.s. Here's a preview of what should be showing up on my own android device but is not:



enter image description here



Answer



It seems like the profile of the computer(perhaps the RSA key fingerprint) was automatically recognized by the android device and so it didn't ask for any permissions. From there, I'm still kind of trying to understand it. But basically, as soon as I reset(factory reset) my computer, it started prompting me for authorization again. I'm sure the factory reset was on the extreme end of options, but it worked in the end.


6.0 marshmallow - How to configure DNS properly while two LANs are running?


The device can't ping www.google.com but ping 8.8.8.8 is okay. My OS is Android 6.0.1, the kernel is 4.1.15


I've tried the resolv.conf and /etc/hosts. But these methods seem can not work on Android.


And I couldn't figure out what the exact problem is.


eth0      Link encap:Ethernet  HWaddr EE:DE:17:79:BB:42
inet addr:192.168.1.10 Bcast:192.168.1.255 Mask:255.255.255.0

inet6 addr: fe80::ecde:17ff:fe79:bb42/64 Scope: Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7 errors:0 dropped:0 overruns:0 frame:0
TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:600 TX bytes:1166

eth1 Link encap:Ethernet HWaddr 00:0E:C6:81:79:01
inet addr:192.168.120.57 Bcast:192.168.121.255 Mask:255.255.254.0
inet6 addr: fe80::20e:c6ff:fe81:7901/64 Scope: Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:41709 errors:0 dropped:0 overruns:0 frame:0
TX packets:113 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2738793 TX bytes:8354

I closed the netd service so that it is able to configure eth0 and eth1 respectively.


Here is my IP rule


0:      from all lookup local
9998: from all to 192.168.120.0/23 lookup 4

9999: from all to 192.168.1.0/24 lookup 3
10000: from all fwmark 0xc0000/0xd0000 lookup legacy_system
13000: from all fwmark 0x10063/0x1ffff lookup local_network
15000: from all fwmark 0x0/0x10000 lookup legacy_system
16000: from all fwmark 0x0/0x10000 lookup legacy_network
17000: from all fwmark 0x0/0x10000 lookup local_network
23000: from all fwmark 0x0/0xffff uidrange 0-0 lookup main
32000: from all unreachable

Here is a result of ping IP, you can see the response is fine.



root# ping 192.168.120.1
PING 192.168.120.1 (192.168.120.1) 56(84) bytes of data.
64 bytes from 192.168.120.1: icmp_seq=1 ttl=64 time=1.08 ms
64 bytes from 192.168.120.1: icmp_seq=2 ttl=64 time=0.986 ms
64 bytes from 192.168.120.1: icmp_seq=3 ttl=64 time=1.00 ms

root# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=255 time=0.718 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=255 time=0.420 ms

64 bytes from 192.168.1.1: icmp_seq=3 ttl=255 time=0.403 ms

But ping google always returns unknown.


ping: unknown host www.google.com

I expect I could ping IP and URL in my case.


BTW, the DNS from eth0 192.168.1.245 and the DNS from eth1 is 8.8.8.8




Monday, June 15, 2015

att - How do I change the home screen's Email icon to go to GMail instead of the default Email app on the Samsung Galaxy S?


On the bottom of the home screen there is an icon for EMail. I don't ever want to use the default Email app. I only use GMail and would rather use the Google GMail app. How do I change where the icon goes and how do I remove/disable the other app?


att captivate home screen


at&t Captivate (Galaxy S)



Android 2.1



Answer



click "applications", click menu button, click "edit". You should now be able to drag the email icon away. Then just replace it with the gmail icon by dragging it to its place.


The other way is to configure the mail application to connect to gmail with imap or pop, but I wouldn't recommend it since gmail app is much better.


Hope this helps!


Gmail notification sound only for new mail


I am using the Google Gmail app, which I've configured to play a notification sound for new mail.


However, it actually plays the notification sound when there is any change at all to the account while I use it on the computer -- reading messages, deleting messages, etc -- in addition to when new mail actually arrives.



It's driving me crazy! How can I configure this so it only makes a sound when a new message arrives in my inbox?




Sunday, June 14, 2015

security - Deny the installation of apps or add new accounts (kiosk mode)


I have a tablet that I want to give to people to go on the internet, but I don't want them to mess with it (install/unistall apps, add new accounts, change relevant options, etc).


Is there a way to lock the device so that it can only be used to go on the internet?



Answer



SureLock promises this amongst others, see its entry on Google Play.


With Android's rapid development, this is however a rather quick moving target.


I suggest you search also for 'android kiosk mode' on Google or of course in the Play Store.


Besides this: There's already a question for that on stackoverflow: Kiosk mode in Android


updates - A/B partitioning - which slot is really flashed?


I have a Moto Z3 Play with stock ROM and rooted it by Magisk. Phone is seamless updates and treble ready. Everything works fine. Yesterday system updater was trying to update to the newest version but it fails. I know, I changed boot partition so it can fail. I downloaded a full ROM zip file from Lenovo servers (PPWS29.131-27-1-15), unpack it and trying to flash the newest version by myself using fastboot.


The current slot was B, it contained PPWS29.131-27-1-11 version. So I changed to A and flashed all partitions from PPWS29.131-27-1-15 ZIP file on slot A.


Commands that I used to flash PPWS29.131-27-1-15:


fastboot getvar max-sparse-size
fastboot oem fb_mode_set

fastboot set_active a
fastboot flash partition gpt.bin
fastboot flash bootloader bootloader.img
fastboot flash modem NON-HLOS.bin
fastboot flash fsg fsg.mbn
fastboot erase modemst1
fastboot erase modemst2
fastboot flash bluetooth BTFM.bin
fastboot flash dsp dspso.bin
fastboot flash logo logo.bin

fastboot flash boot boot.img
fastboot flash system system.img_sparsechunk.0
fastboot flash system system.img_sparsechunk.1
fastboot flash system system.img_sparsechunk.2
fastboot flash system system.img_sparsechunk.3
fastboot flash system system.img_sparsechunk.4
fastboot flash system system.img_sparsechunk.5
fastboot flash vendor vendor.img_sparsechunk.0
fastboot flash vendor vendor.img_sparsechunk.1
fastboot flash oem oem.img

fastboot erase carrier
fastboot erase ddr
fastboot oem fb_mode_clear

Then I tried to boot from A slot but it fails. The phone got bootloop and lands in stock recovery. I assumed that something goes wrong so I rebooted to bootloader and changed slot to B to boot PPWS29.131-27-1-11 version which was working fine. And then comes mindf*ck - after system start from slot B, I noticed that system version is now PPWS29.131-27-1-15. But how? I flashed partitions on A slot, not B. Even fastboot logs showed that I was flashing A slot.


When I changed slot to A with fastboot command is it really flash A partitions? Or just change which partition should boot in the next reboot?




Saturday, June 13, 2015

How do I detect if I have a Super AMOLED or LCD Screen on my Nexus S?


Many sources are citing that the Nexus S is shipping with 2 different types of screen due to Super AMOLED shortages. As I am in the UK it is likely I will have the Super LCD, which I read somewhere is inferior compared to the Super AMOLED.


How can I tell which one I have? What are the main differences?


Update: Found the answer here: http://forum.xda-developers.com/showthread.php?t=1022216


Looking in 'Baseband version' under 'About Phone' reveals that a baseband beginning wth I9020 is the Super AMOLED or I9023 for Super LCD.



Answer




Look at something black (e.g. an image of only black) on your phone, and shut off the lights. If you've got an AMOLED screen, it should be pure black (virtually no light emanating). With an LCD it will be significantly brighter/greyish.


How to cancel a download on Android 4.4 KitKat



I (accidentally) started downloading a 350 MB file from Google Chrome and I can't find the option to stop it, the downloads app just shows the files that have already finished but not the downloads in progress. The notification on my top bar just opens the downloads app.



Answer



I just reproduced the steps needed to do this, last two steps may be the interesting ones:



  • Open Google Chrome (v39)

  • Start a large download (http://ipv4.download.thinkbroadband.com/1GB.zip)

  • Wait a moment (it took some seconds for a notification to appear)

  • Pull down the notification bar and click on the download entry

  • You are taken to the download manager

  • Long click on the corresponding entry


  • Choose the trash bin from the top action bar


In case this does not work for you: Please edit your answer with your exact device model, Chrome and Android version number. If you are doing a lot of downloads on your Android device consider installing a download manager like share downloader. It also supports pause and resume.


malware - Do I have a virus on my phone? A message from an Android app says so


I have just received a message from an Android app on my phone saying my phone has been infected with a virus and to click a link to fix the problem.


I'm not sure I trust this, is it possible to have a virus on Android?




2.3 gingerbread - Installing Android Market/Google Play on non-rooted Kindle Fire


Is there a way to install either the Android Market or Google Play on a Kindle Fire (Android 2.3 and Kindle version 6.3.1) without first rooting it? I have access to a Windows 7 computer with Admin privileges, but no USB cable (I do have ES File Explorer running an FTP server, so I can easily send and receive files via FileZilla on the computer).



Answer



You don't need to root your Kindle Fire for this -- as long as the following source is still valid: Install Android Marketplace and Google Apps on Amazon Kindle Fire. As that howto speaks about "Android Marketplace" (and not "Google Play"), it may not be up-to-date -- but I doubt the change of the name affected the procedure of installation.


A more up-to-date tutorial is Install Android Play Store on Amazon Kindle Fire - The Easiest Way, but that involves rooting the device. Maybe it has to do with the framework and a newer Android version, which makes rooting a necessary step.


EDIT: You may also want to take a look at these video tutorials: How To Install Google Music / Play On Your Kindle Fire! and GApps on Kindle Fire Without Rooting. Looks like you can still have Google Play installed this way without rooting.


data transfer - Switching contacts from Windows Phone to Android


I have been trying to figure how too switch my contacts over to my Galaxy S III. I had a Nokia Lumia 520 and I really don't want to manually put my contacts in, but I don't see where they were saved.




Google Now gives absurd times for arriving on time


Google Now gives me absurd times in its notifications when it think I should leave the house. Just now, at 9:05 pm, it told me that I have to leave at 6:20 am for an event at 10 pm. 9:20 pm would actually be realistic. What may be causing this?


I have enabled Automatic Date & Time as well as Automatic Time Zone. I'm in Central European Summer Time; the clock works perfectly fine.



Answer



Have you enabled Location Services? Google Now determines the time you may take to get to your appointments from your synced calendars and your current location. I am sure you have synced calendars because Google Now reports an appointment. Location Services maybe an issue. If you are using the stock ROM for your device, enable Location Services and sign into Latitude to set your current location. Setting your location manually may also solve your problem. If you are on a custom ROM, you can set the device up to use only the Internal GPS to report your current location to Google Now. Hope this helps. If you give this a shot, report back with results for others to help you or be helped.



P.S.: This may be useful.


App updation- Google Play Store wants to update an older version of app when latest version is already installed?


I manually update apps and on selective basis. Recently, I noticed that apps that have been manually updated continue to be shown in awaiting updates list, despite manually updating them



  • Example of Macrodroid. On the left is the Play Store showing an earlier version and on the right is app version , which is much later


enter image description here enter image description here




  • Few other apps show the same version - on the device and awaiting updating on play store.





  • Some apps get removed from Play Store once updated.




This inconsistent behaviour foxes me


Why does this happen and how to fix it?


Details: Android 6.0.1 on Moto X Play- Play Store 6.8.24. F- all 3085398



Answer



Isn't v3.14 newer than v3.13? It's quite common to have a {x}.{y}.{z} versioning system where a bug fix increments {z} and a new feature increments {y} or maybe {x}.


Also, the developer doesn't actually have to change the 'Version' number that shows in the Play Store, they only need to increment a build version (which is not visible anywhere in the Play Store) so the version that is shown may not change. This allows for quick fixes to be pushed out without incrementing the actual version number.



Although the information isn't visible in the Play Store it can be seen in the AndroidManifest.xml within the apk. I use Solid Explorer which can display this information without needing to extract the apk manually. In the screenshot below you can see the 'Version code' which is the build version that must be increased when uploading a new version of an apk to the Play Store.


Screenshot of app info


security - Razr Maxx HD, How to wipe data with broken screen


My screen is totally destroyed, it's black and unresponsive. The phone turns on just fine, though. I just got my new phone and I have to send this one back now.


I want to wipe the phone before I send it back, but I'm not sure how. I don't care too much about sending back a rooted phone, it seems Asurion doesn't really care about that from what I've read, but I don't want my personal data on the phone when I send it in.


What are my options to wipe the phone without a screen? I've already read a lot of threads on other forums and here on the subject, but everyone seems to say to wipe through ADB shell. Well, I can see the phone in ADB, but I am unable to enter SU through ADB shell. I assume it's because the screen is locked, and I have no way to unlock it. Others have also said to wipe through fastboot in ADB, but I am seeing conflicting recommendations and I'm not sure how to proceed. I'm not that proficient with ABD, so I want to make sure I don't mess this up. Any advice would be greatly appreciated.



Answer



You can obtain the adb and fastboot utilities as part of the Android Software Development Kit (or separately from third parties, but watch out for Trojan binaries). If you install the SDK, you will need to install the Platform Tools and (if using Windows) the USB Driver for Windows.


Once you have them, from whatever source, this is what you will do:





  • Reboot the phone to the bootloader (fastboot):


    adb reboot bootloader

    adb may not work if the phone hasn't previously been placed in USB Debugging mode. In this case, boot the phone to fastboot mode by first powering it off, then powering it on by holding all three of the Power, Volume Up and Volume Down keys at the same time for two seconds, then releasing all three keys, then touching Volume Down twice, then Volume Up once.




  • Check to see if the phone is in fastboot mode. If it doesn't show anything, wait a few seconds and try again:


    fastboot devices



  • Wipe the user data/cache:


    fastboot -w


Friday, June 12, 2015

Do widgets run if not on current home screen?


I have the EA daily deals widget installed on my second home screen. The widget is basically a rotating banner of deals in the Play store. Since it is constantly rotating the displayed banner I assume that it is draining more battery than a static widget (it also doesn't have any options for rotation or network updates).


My question is, are widgets suspended when they are not being displayed i.e. when I am on the first or third home screen? Or, does it depend on the implementation?


*Using the stock launcher on Android 4.2.




Install default Android keyboard


It seems as the default keyboard is removed from several Android devices. I have two, a Sony Xperia (4.0.4) and a Samsung Galaxy SIII (4.0.4) and neither of them has the default Android keyboard (or I'm missing something).



Is there an official way of installing the default keyboard? (And why would hardware makers disable the default keyboard?)


This is related to my other question Switch to another keyboard language using stock keyboard



Answer



There's no official way of installing the default keyboard if it's not installed by the manufacturer.


However, there may be unofficial ways using files stripped from other devices or compiled from AOSP. There are some keyboards on Google play, see for example Keyboard from Android 2.3, which claims to be like the default keyboard from Android 2.3.


Another way of getting the default keyboard may be installing another ROM.


I think hardware makers would install their own keyboards if they think that they are superior to the default one, for example because they better work on the screen size of a device.


How can I get Google's two-step verification to work?


On my Android phone, I can't seem to use my Google Account because I have the 2-step verification enabled. Can I log into Google without disabling the 2-step verification system?


Here is a link to Google's 2-step verification system: http://googleblog.blogspot.com/2011/02/advanced-sign-in-security-for-your.html


Logging into my Google account is not a problem using the 2-step verification on a standard PC/Laptop, i.e. on a Microsoft/Mac OS, I just can't seem to use the 2-step verification system on Android 2.2.2.



Answer



The answer is that you have to use a standard computer, log into your google account 2-step verified google account, go to authorise applications and sites, and set up your android device. Google have said that 2-step verification will not work yet on android, so they have provided this work around for now.


Here is the link where you create a password to authorize your device: https://accounts.google.com/IssuedAuthSubTokens


They will then give you a password which you can enter into your phone, allowing you to keep 2-step verification enabled.


Wednesday, June 10, 2015

Attempting to brute force Android security pattern through TWRP via adb


Yesterday I somehow forgot the Android security pattern on my phone. Due to muscle memory I sort of know what it was, but can't figure out the true pattern. Therefore I'm attempting to brute force it to allow me to unlock the phone again.


Decrypt with pattern
Since I've TWRP recovery installed, I'm able to use the twrp decrypt 'passphrase' command for decryption attempts. I'm using a 4x4 pattern (OnePlus5, LineageOS, Android 8.1, TWRP clockworkx 3.2.3-1) for which each dot in the grid translates to a different character, you should concatenate to build your passphrase. I believe the 4x4 grid looks like this:


1   2   3   4
5 6 7 8

9 : ; <
= > ? @

Having a line pattern from the top left to the bottom right would give a passphrase of 16;@, allowing you to decrypt your phone in TWRP using adb shell twrp decrypt '16;@'. (via)


Brute force attempt
Through this method I've attempted all possible patterns I believe could be it, but I didn't succeed decrypting it. The command always returns Attempting to decrypt data partition via command line. to stdout, and nothing else. I'm rapidly attempting each pattern one after the other with no delay, detecting whether any command output differs from the expected output (which hasn't happened yet).


Questions
Because I didn't succeed yet, I'm wondering if my implementation is correct. I don't have a phone to test with, so I have a few questions:



  1. Does the twrp decrypt command output something else when decryption succeeds?


  2. Does successfully decrypting create a block device at /dev/block/dm-0, which I can probe for?

  3. Should I wait a few seconds after each attempt before probing for success?

  4. Is there some sort of hidden timeout (required to wait 30 seconds after attempt)?

  5. Is there another method I can use to probe for success?


Brute force tool
I did build the following tool for this brute force attempt, if that's relevant for what implementation I've used: apbf


I don't understand what is wrong with this implementation. It does not seems to properly decrypt the phone, making me wonder if the key could be corrupted.


I'm currently rebooting recovery after reach attempt, but that takes a lot of time for 1400 possible patterns. I'd like to be sure the attempt isn't useless.





Since I do know the approximate pattern length, am certain only the two right columns are used, and know that the dots in the pattern never have a distance greater than 1, I can greatly reduce the pattern search space and limit the possibilities.


Encryption is enabled on the phone, I believe it's file-based. When in TWRP, the /data/data and /sdcard directory seems to list encrypted file names.



Answer



After a while I figured out what the problem was, with a freshly flashed phone. Here I'll be answering my own question.







  1. Does the twrp decrypt command output something else when decryption succeeds?




    Yes, it outputs something like:


    Attempting to decrypt data partition via command line.
    Data successfully decrypted
    Updating partition details...
    ...done



  2. Does successfully decrypting create a block device at /dev/block/dm-0, which I can probe for?




    No.





  3. Should I wait a few seconds after each attempt before probing for success?



    -






  4. Is there some sort of hidden timeout (required to wait 30 seconds after attempt)?



    Yes, very important! About 10 seconds. Consecutive attempts within that time frame fail with no warning whatsoever.





  5. Is there another method I can use to probe for success?



    -







So, consecutive attempts to invoke twrp decrypt must have at least 10 seconds between them or else they will fail. So, the only thing that was wrong with the developed tool, is that I didn't implement this timeout.


How can I backup the entire Gallery (photos and videos) to my desktop computer?


The Gallery on my Android device seems to show all the photos and videos, whatever the method to get them could had been (camera, whatsapp, bluetooth, and so on).


I would like to backup them all, but all I have found on the net refers to one nagging method, consisting of syncing it to some cloud (DropBox, for example) storage. This is painfully slow, and I prefer to store my multimedia on my desktop computer, for example by pluging the USB cable or transferring it via USB storage device, SD card... etc.


But the only way to backup the entire gallery to my computer I have found is just the manual method of copying each involved directory that could contain those files. This is like some sort of nightmare, due to:



  • There are multiple possible directories that I must (nearly) guess, depending of the program that got the photos/videos: camera seems to be at DCIM, WhatsApp at whatsapp, another directory for bluetooth ... etc.


  • There are two storage drives: the phone itself and the SD card. So the job must be done twice.

  • Some Windows system (my Windows 8.1 at least does, I don't know why) don't allow concurrent file transfers via USB cable, so I must seek&start the first transfer of files (say DCIM), wait until it finishes, start the second (say bluetooth) and so on.

  • Restoring such backup requires rebuilding the exact directory structure on the phone, but I could prefer to store all the photos and videos on the same folder on my desktop.


Isn't there a more simple way?
Both solutions involving Android's native or additional software (freeware preferred) are accepted.
If not possible, I could accept a solution involving to send the entire gallery to any cloud/internet and recovering it on the desktop.



Answer



I don't prefer cloud backup because of high priced internet plans in my country, and the answer by Lord Ralf Adolf didn't work for my device somehow. Ultimately, I had to find a solution which is supposed to be no pain only gain. Here we go with one mentioned below.


Notes:





  • The solution requires a USB cable, MTP enabled (available in Android 4.xx and 5.xx) in Android device, (devices with USB Storage Mode would work as well), and Windows 7/8 in PC.




  • If MTP somehow doesn't work in your PC, you've no access to USB cable, or your device doesn't have MTP feature, then you may very well host a server on your Android device, preferably a WebDAV server. See my answer here for know-how.




  • Tested the solution with Android 4.2.1 and Windows 7.







What this answer would achieve?




  • Works well with/without USB Storage and MTP support in Android device.




  • Backup multiple directories easily.





  • Can backup two or more storage drives by choosing the following solution only which would require repeating the instructions, or (following+linked) answer which would make it happen in one-go.




  • Fully automatic once final instruction is executed; no need to do manual copy for each file/directory.




  • Copies exact directory structure so that you don't have to worry during restoring the data.





  • Needs no Internet connection (other than to download some required software here).






A bit of explanation before going to the kernel


The problem with most of the media backup apps (I noticed) for Android is that they don't really preserve or care for the exact directory structure, which means you can mine images from anywhere in the Android but you can't really mirror the directory tree for saving the file in your destination storage, i.e. (analogy)


copy F:/DCIM/Camera/DSC11*.JPG C:\Users\Firelord\Desktop\Test\ 

is easily possible and available by many Android apps and Windows softwares, but not


copy F:\DCIM\Camera\DSC11*.JPG C:\Users\Firelord\Desktop\Test\DCIM\Camera\DSC11*.JPG


The same holds true for many Windows Explorer alternatives for Windows 7/8 including FreeCommander, Multi Commander, Explorer++, XYplorer and other tools like SmartCopy.


(Note that I tried the listed ones but could not find the desired functionality with ease (auto copy with tree). Let me know (to edit) if your experience differs.)




Anyhow, the trick was to find a software for Windows which allows to take media backup(not disk/media imaging) with synchronization feature. Three such candidates that I tested and found easy(GUI) are SyncToy, FreeFileSync and PureSync. (All are free for personal use.)


I recommend FreeFileSync and the instructions for its usage are mentioned below.





  1. Download FreeFileSync(free).





  2. This program might not create Start Menu entry. For a 64-bit Windows 7, the program's directory location is C:\Program Files\FreeFileSync and a relative one would be for 32-bit Windows 7. Execute the FreeFileSync.exe (right-click → Run as Administrator).




  3. (On my machine this program freeze out for few seconds during its startup but eventually stabilizes and doesn't behaves alike.) The default screen for v7.0 would look like:


    Default screen




  4. Connect your Android device into PC using USB cable, and choose MTP for data transfer.





  5. In FreeFileSync, you would see two fields with name Drag & Drop at the top of left and right pane. They hold the location for the source and destination storage. Edit them:




    • For left pane click BrowseMy Computer(left side) in the opened window → select your device (say HTC One; under Portable Devices) → choose either Internal or External SD card of Android device → Select Folder(at the bottom).




    • For right pane click BrowseMy Computer(left side) in the opened window → select the backup location (say D:\Backup) → Select Folder(at the bottom).





    Edited panes




  6. In FreeFileSync under the Menu bar, go to Actions → Filter settings. Here you can include the filetypes and exclude the folders from mining or backup. E.g. If I want to backup only .jpg and .png image files from my Android but I want to avoid those in the Android, Data, any .folder or folders that were created by some apps and includes irrelevant files with such extensions, then my filer would be:


    Do not imitate but understand the logic Note that the filter is not complete in the picture as opposed to text in the answer


    Tweak as much as you want since it's easy. I seriously advise excluding Android folder. Click OK when done with custom filters. (Note that I've not added but you may add video extensions too like .mp4, .mkv, etc.)




  7. In the Menu bar, go to Actions → Synchronization settings and choose any of the variant available. For the first backup I prefer Mirror to backup all the filtered files. Click OK at last.



    Synchronization settings




  8. In the Menu bar, go to Actions → Start comparison -- this will show the filtered files in left pane (source) and files available in right pane (destination; would be empty for a new backup folder). (You can always switch the panes by clicking the blue <> icon available between the two panes.) An e.g. would look like:


    Comparison




  9. In the Menu bar, go to Actions → Start synchronization -- this will (as obvious) synchronize the two folders based on the setting you chose in Step 7. An e.g. of process, and completion would look like:


    Processing


    Completion





We're good to backup anything here. Note that for restore the steps (as obvious) would be same but the locations at left and right pane would differ. Also, during restore, my phone freeze out a lot (the reason could be a low class SD card in device or altogether a program issue itself, IDK!)


Issue with, and solution for, multi-storage Android devices


One issue that a multi-storage Android device user would've noticed is that you'll have to repeat the instructions to backup both External and Internal SD card.


This can be avoided by using a file server in Android. See Method#1 or Method#3 in my answer here. Just make sure that the file server should have its root directory at /storage so that in the FreeFileSync all storages (would be listed as folders now) can be mapped for backup.


I tried and it worked well!


Status: Objective Completed




I could cover SyncToy and PureSync here, but the latter freeze out the whole time whenever I click any option and about the former: it's intuitive and very easy in "exclude filters" but doesn't give much flexibility in synchronization variant (I would've ended up deleting images in device due to lack of such, but was stopped somehow. :) )



I think the objective can be achieved by using find and rsync tools in combination on GNU/Linux.


Let me know other options if you come to know any, or technical mistakes in my answer.


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 ...