Installing microG services (as Play Services replacement) on the Asus TF101 tablet

I still have an Asus Transformer TF101 tablet in use – running MarshMallow – but after a Play Services upgrade, in which Google inserted some NEON instructions (which the TF101 does not support) , a lot of “Play Services has stopped working” popups showed up  – making the tablet nigh unusable. Initial tests blocking upgrade of the services yielded no success, and a lot of programs demand the newer versions of the services anyway.

In my searches I ran across the microG Project – “A free-as-in-freedom re-implementation of Google’s proprietary Android user space apps and libraries.” Sounded interesting, so I went and tried it, with success, on the tablet. It runs faster, battery life is better, and it works for everything I use it for.

Below you can find the steps I used. These apply to the Transformer TF101, and come with no guarantees whatsoever.

Preparing the tablet

  • First, you’ll need to uninstall both “Google Play Servics” and the “Google Play Store”. Use something like Lucky Patcher, or Titanium Backup, or whatnot, to remove them.
  • Reflash the ROM for KatKiss (I’m using 6.0.1 #29) and SuperSU (linked on the same page). Do NOT install opengapps!
  • Install F-Droid.
    Make sure you enable “Expert Mode” and “Unstable updates” in the settings, as we need the latest version of the packages.
  • Add the repository for microG: https://microg.org/fdroid/repo (as described here)
  • Temporarily disable the F-Droid repository.
  • Install the following items using F-Droid:
    • microG Services Core
    • microG Service Framework Proxy
  • Re-enable the F-Droid repository, and install

Patching the ROM to allow signature spoofing
Download (with git) a copy of https://github.com/Lanchon/haystack.git: git clone https://github.com/Lanchon/haystack.git

Make sure your tablet is connected through usb, and that adb works, and execute these commands in the directory where you cloned the git repository:
(you can find more information on the page of the git repository)

  • ./pull-fileset tf101
  • ./patch-fileset patches/sigspoof-hook-4.1-6.0/ 23 tf101/
  • ./patch-fileset patches/sigspoof-core/ 23 tf101__sigspoof-hook-4.1-6.0/
  • ./patch-fileset patches/sigspoof-ui-global-4.1-6.0/ 23 tf101__sigspoof-hook-4.1-6.0__sigspoof-core/
  • ./push-fileset tf101__sigspoof-hook-4.1-6.0__sigspoof-core__sigspoof-ui-global-4.1-6.0/

Reboot the tablet. Afterwards, go to “Settings”, “Developer options”, scroll to the bottom and enable “Allow signature spoofing”.

Configuring microG Services
Go into the application drawer, and look for an application calld “microG Settings”.

  • Tap “Permission Missing” and give all permissions
  • Enable “Google device registration”
  • Enable “Google Cloud Messaging”
  • Go in “UnifiedNlp Settings”, tap both “location backend” and “address lookup backends” and enable the backends there.
  • Go back to the main menu of microG Settings and tap “Self-Check” and make sure it doesn’t complain about anything
  • In “Self-Check”, make sure to tap “Battery optimizations ignored” to allow the service to run in the background

Reinstall Google Play Store
Download the Play Store from eg. APKMirror (http://www.apkmirror.com/apk/google-inc/google-play-store/[/url] to your PC. Rename it to com.android.vending.apk
Execute the following with adb:

  • adb remount
  • adb shell mkdir /system/priv-app/Phonesky
  • adb push com.android.vending.apk /system/priv-app/Phonesky/

Reboot the tablet one last time. Now you should have the Play Store available and you can install apps again to your heart’s content ;)

Using adb with a OnePlus X on Linux…

… is not really that hard. Just annoying. Since OnePlus’ USB ID is not in the default adb list, you need to add it yourself:
echo "0x2a70" >> ~/.android/adb_usb.ini
where 0x2a70 is the identifier for OnePlus. (you can find this with lsusb)

To add automatic permissions to the device node when it’s created, add this udev rule to /etc/udev/rules.d/51-android.rules (all on one line):

SUBSYSTEM=="usb", ATTR{idVendor}=="2a70", MODE="0666", GROUP="plugdev" ATTR{idVendor}=="2a70", ATTR{idProduct}=="9011|f003", SYMLINK+="libmtp-%k", MODE="660", GROUP="audio", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"

Compiling Android / CyanogenMod from source

On the HTC Desire S, I’ve been using an unofficial build (made by Flinny) of CyanogenMod 10 for a while – happily so.
Unfortunately the author is/was a bit strapped for time, and development slowed down significantly at the time. Updates for CM 10.1 and later were not forthcoming.
Since I’m enough of a geek, and suffering from ORD, I decided to try to ‘roll my own’: to compile CM from source. As it turned out, it’s not quite as hard as you’d think it is.

First, you need toI was going to write a lengthy tutorial here, but there are plenty of tutorials out there. So instead of inventing the wheel yet again, you can just go look at this one, or here or . Or you can just go and Google it ;)

You can find the thread for my unofficial builds on XDA Developers.
The git repository with all my sources can be found here, on GitHub.

Android Backup & Restore

You’ve just gotten your shiny new Android Phone, and you want to migrate to it. There are several options, including Titanium Backup to move stuff, but Google also has you covered (party): Android Backup & Restore. You can find this setting on your phone, under “Settings” and “Backup & Restore”. This thing backups several things, but far from all:

  • Your installed (Google Play) apps
  • WiFi accesspoints & passwords (if this is a good thing, is another question)
  • Certain application settings (this is application dependent)
  • Probably more…

This feature is known to be a bit of a battery drainer, so many people leave it off by default. This is ofcourse a PITA when you want to move – as your phone won’t start backing up immediately after you tap the option.

Luckely, you can trigger this manually: you need to activate USB Debugging on your phone, and then start a new ADB shell with the command aplty called adb shell
Then you can play around with the backup manager, bmgr. In most cases you’ll just want to trigger a backup immediately: bmgr run
This will trigger the backup manager to run a backup, send all your stuff over to the cloud. Give it a few minutes, and then add your Google Account to your new phone, and presto – it’s all there. Sortof.

For a full overview what you can do with bmgr, see the android developer webpage.

Manually flashing an OTA-update

I recently acquired a second-hand HTC One X. A week or two back HTC decided to release the JellyBean update for the phone, all was well. Yesterday, another update was sighted on XDA, and since it seems like this one gives better battery life, I didn’t feel like waiting another 3-5 weeks before it became available in my country, so I searched on how to manually flash an OTA.

As always, this procedure comes with no guarantees it will work for you. It might as well decide to eat your cat, or turn your blood into liquid metal (if you don’t have a cat).
Continue reading

Copying over your wifi access points on Android

In case you have just bought a new phone, rooted it, and want to copy over all your wifi access points, there are a few options:

  • Use the synchronisation to Google to have them keep a backup. Not my favourite, since it tends to restore just a bit too much (like all the apps you already removed before)
  • Use a tool like Titanium Backup, but I’ve noticed that this doesn’t always work between phones. On the same one, sure.
  • Manually copy them over. This is the way I usually go, and it works well.

First, copy the original files over: (do this for both phones)

  1. Plug your phone via USB, enable USB debugging in the setting (developer options) and make sure you have the Android SDK installed on your computer
  2. Disable wifi on your phone. Really. Just do it.
  3. open a shell to your phone, and copy the wpa_supplicant.conf file to your SD:
    adb shell
    su
    cd /data/misc/wifi
    cp wpa_supplicant.conf /mnt/sdcard

  4. Pull the file to your computer somewhere:
    adb pull /mnt/sdcard/wpa_supplicant.conf /tmp/wpa_supplicant.old

Repeat this for the new phone, but in the last step, you should pull it to /tmp/wpa_supplicant.new.

Now, edit the /tmp/wpa_supplicant.old file, and remove everything that doesn’t read

network={
        ssid="mynetwork"
        psk="mysupersecretkey"
        key_mgmt=WPA-PSK
        priority=1
}

network={
        ssid="myotherfabnetwork"
        key_mgmt=NONE
}

Next, we want to add this to the new file. Easy peasy: cat /tmp/wpa_supplicant.old >> /tmp/wpa_supplicant.new.

The last thing to do is put the new file on the new phone, and reset it’s permissions:
adb push /tmp/wpa_supplicant.new /mnt/sdcard/wpa_supplicant.conf
adb shell
su
cd /data/misc/wifi
cp wpa_supplicant.conf wpa_supplicant.conf.backup
mv /mnt/sdcard/wpa_supplicant.conf .
chown system.wifi wpa_supplicant.conf

And you’re good to go. Rebooting your phone might not be necessary, but it’s recommended.

S-OFF and Jellybean on the HTC Desire HD (Ace)

I acquired a secondhand HTC Desire HD, a nice phone (albeit a bit heavy). Comes with Android 2.3 (Gingerbread) and Sense. I’m personally not much of a Sense fan, and I wanted to move to a newer Android release, so I looked around on how to achieve S-OFF.

In the end, it’s fairly easy, thanks to the Advanced Ace Hack Kit (AAHK now for short).

Requirements for the adventure:

First, read the “effen manual” that comes with the AAHK. Find the code, and once you’re in the menu, pick option 1 – “Hack Ace”.
Wait a bit.
See the phone reboot some.
Wait some more.
*poof* you’re now S-OFF!

The next thing I did was flash a new recovery (I’m a big fan of 4Ext Recovery), and after that downloaded the radio and the lastest version of JellyTime and the accompanying Google Apps and flashed those. A reboot later: JellyBean on the HTC Desire HD!