Tag: wifi

Virgin Media have a handy Android app which lets Virgin Media subscribers connect to their Virgin Media WiFi service. However they have, in their infinite wisdom, decided that they will not support running this app on rooted Android devices – which is entirely their prerogative.

As a longtime fan of rooted Android (I currently run LineageOS 14.1 on my HTC 10) I was disappointed by Virgin’s decision but decided to treat it as a learning opportunity. So, purely for academic / research purposes, is it possible to modify the Android APK such that it will run on a rooted handset? Yes, yes it is and it’s quite easy if you know what you’re doing.

Now let’s start looking for the text in the toast notification it pops up to tell you it’s not going to run on a rooted device:

grep -R "rooted" *
res/values/public.xml: <public type="string" name="alert_rooted_device" id="0x7f0800d1" />
res/values/strings.xml: <string name="alert_rooted_device">For security reasons you are not able to run this app on a rooted device</string>

I’d take a reasonable guess that “alert_rooted_device” is the one we’re after. Let’s see if that id “0x7f0800d1” is referenced anywhere in the decompiled code:

So let’s take a look at the decompiled StartActivity.smali:
Seems like it’s invoking com/studios/ocasta/prototype/vmwfsclient/g/i;->a() (line 283), putting the result into v0 (line 285) and then jumping to :cond_0 if v0 is equal to 0 (line 287). If v0 isn’t zero then it raises a Toast notification with the id of the “alert_rooted_device” string (0x7f0800d) (lines 289-297) and calls the “finish()” method (line 299).
I think it’s a reasonable guess that lines 283-299 are responsible to detecting whether the device is rooted, displaying a toast notification to that effect and exiting.
So what,if we were so inclined, could we do about it?

Looks likely that if the device isn’t rooted then line 287:

if-eqz v0, :cond_0

will skip over the toast + exit stuff. So what if line 287 read simply:

goto :cond_0

instead? Skipping over the toast and exit regardless of the result of the method invoked at line 283.Let’s give it a go!

Make whatever modifications you decide to and use apktool to rebuild the apk

This should produce an apk which you’ll need to zipalign and sign before you try installing it on a rooted Android device for educational purposes only.

So what did we learn here?

It is often trivial to work around root detection on Android apps.

The root detection in this case isn’t even necessary since the app will set-up WiFi auto sign-on for you, so you could:
Remove root (temporary)
Install the app & set-up auto sign-on
Reinstate root and just don’t launch the app