[Android Stick & Console AMLogic based Computers] jameson.donaghy:
I downloaded the DirecTV Now app on New Year's Eve hoping for $35/cable. Instead, I was greeted with the same Error 40 that everyone with a rooted device got. It took me a couple of days of researching and playing and reflashing and..., but I've finally figured out the simple(r) method to bypass this stupid root check for DirectTV Now (AKA Error 40, QP1005)

This applies to the TX5Pro, but it should work on any s905x based AMLogic SoC running Marshmallow 6.0 (A95X, CQ9, TX5, TX3, X96, NEXBOX, +many more.) As I understand it, they all have similar Android builds using the p212 board and firmware. I also have a M8S s812 running Kit-Kat 4.4.2 that I'll work on breaking, next.

First things, first: If possible, find your firmware and do a clean flash. Not a requirement, but if you've been playing with this for a while and you've ended up here, you've probably mucked up your /system files in some way or another. I managed to screw up my su binary location a few times and couldn't get it back without a lot of work. Reflashing was a three-minute, headache-free task.

That said, you'll want to adb over tcp/ip as these devices don't like to play the USB cable game.

adb connect deviceipaddress:5555

Follow up with

adb shell

and

su

to get into a root shell (if you don't get one by default.) Mine came with SuperUser from ClockworkMod preinstalled as a system app. Mount your system folder

mount -o rw,remount,rw /system

and edit your build.prop file with Vim.

vi /system/build.prop

If Vim is new to you, search the interwebs for a Vim cheat sheet.

Here's the trick with this... DirecTV Now's shared object file in lib/armeabi/libdrmagent_downloadable_jni.so looks for a few keywords within a few properties. Those properties are:

ro.build.product
ro.build.tags
ro.build.type
ro.build.display.id

...and the keywords are:

"release-keys, OnePlus2, OnePlus, Z26CL, STUDIO_C, user" are keywords that it favors, while "cm, cyanogen, cyanogenmod, debug, userdebug, A0001" are disqualifying keywords. Supposedly, "test-keys" is a bad word, too.

In my case, I needed to edit my build.prop to eliminate any sign of the bad words. Example:

ro.build.display.id=p212-userdebug 6.0.1 MHC19J 20160909 test-keys
to
ro.build.display.id=p212-user 6.0.1 MHC19J 20160909 release-keys

Run through the file and replace anything that says userdebug with user and test-keys with release-keys until you get to "#end build properties" Then save and reboot.

After reboot, install Hide My Root (I used the one from Amphoras) and hide the Su binary. This is where things might be getting tricky for some of you... on the TX5Pro, the SuperUser app is a system installed app, meaning it can't be uninstalled (it can, but it's not exactly a simple task for everyone) so you'll need to go into settings -> apps -> superuser and disable the app from there. Reboot again. Now, with the su binary hidden and the app's manifest not showing up in the system, the error 40 message should go away. This option will allow you to quickly restore su and SuperUser without needing a bunch of additional steps. You'll still need to set the device location service to "battery saving" (or use mock locations) but that's a simple task anyone can figure out.

The app is a choppy on high def feeds for some reason. I can't tell if this is processing/memory issue or a feed (wifi) issue. By default, the app doesn't work on ethernet, meaning you'll have to use wifi until you can fix that issue. But hey, one thing at a time, right? Anyway, I hope this helps anyone with this particular headache.