How to load HappyCow app on BB OS 10 (or use Vegetarious)

W

winter.frost

Guest
Hi all,

I recently purchased a BlackBerry Q10 - I know, people still buy BlackBerrys! - and I really wanted to be able to use the app for www.happycow.net as it is really useful when you are on the go.

Before I begin what will be a long post, it is worth me noting that there is another useful - and free- app to BlackBerry users which is available via the Amazon appstore. It is called Vegetarious. You can use this alongside HappyCow, or you can use it as an alternative if you decide that the length or complexity of the steps below is not for you.

HappyCow does not officially support devices running BlackBerry OS 10 despite the fact that there are people who have wanted this for some time.

However I was determined to find a way to get the app to work. The more people who have access to an on-the-go vegan directory the better; consider it my contribution to the movement. After fiddling about for sometime, I have finally found a way to get it to run on any BlackBerry device running from OS 10. This is essentially the same workaround for many Android apps, though specifically tested for success with HappyCow. I have customised a patching method that will enable Google Maps to run inside it too.

You will need BlackBerry Link for this to work - your computer and mobile will need to connect. Or you can use Bluetooth, DropBox (over Wifi this will probably be quickest), or whichever method you prefer. The following method is for a windows computer (or virtual machine) but I do believe all the steps can be recreated on a Mac and other operating systems.
http://uk.blackberry.com/software/desktop/blackberry-link.html

You will need the latest version of Java before proceeding (download v.8u101). < This is a more comprehensive and future-proof Java Kit, which is why I recommend it. I tried v.8v102 but it did not work as well (I was running Vista 32 bit). You will need to reset your environment variables (right click My Computer > Properties > Advanced System Settings > Environment Variables > Add New System variable "JAVA_HOME" with value "C:\Program Files\Java\jdk1.8.0_101" (or wherever your Java is installed).

Here are the instructions (not for Snap users, see bottom note):
1. Make sure your BlackBerry OS software is fully updated. It might be prudent to back-up your files before we begin using BB Link above.
2. Use your device's browser and point it to http://playstoreblackberry.com/
Follow the instructions on the page. However please download the Android gms and Account Manager v.4.4.4 files from:
(copy and pate) mega:///#F!lIUWjSSQ!yoLoiNX3PNG3Sef1Fa_fMA
These updated versions will get rid of a few bugs.
3. Point your desktop browser to https://github.com/xsacha/Sachesi/releases/
Download and install the latest version of Sachesi onto your computer.
4. Point desktop browser to this link and download the files (copy and paste to browser url field):
mega:///#!9JIhFIyJ!GYnFXMeLDn1mLPtE-3xOP36HzAyaxbjpSCZBeHP1ueQ
5. Connect your BB to your desktop computer and open Sachesi.
Install the files from Step 4 into Sachesi.
You will need to deselect 'Only install newer apps' otherwise it will not work.
Steps 3-5 will allow you to uninstall unwanted apps you might download via Google Play in the future. For some reason v.10.3.2.2876 does not allow uninstallations of sideloaded Android apps without this fix. It might be possible that future versions of OS 10 will fix this so this step might not be necessary in future. Then again, the problem might still persist so I recommend you keep these files somewhere to hand should you need to reinstall them again.
6. Perform a hard reset (aka battery pull). Your phone should restart. Connect it to your desktop once more.
7. Point your desktop browser to this link.
Follow the instructions to install apktool to your Windows desktop (or to your Windows virtual machine). I recommend creating your apktool folder on your Desktop and not at C://Windows (for super easy access).
8. Open Google Play on your BB and point it to the HappyCow app. There is both a free version and a premium version - you can choose which you wish to use. Download the app but do not install it.
It must be a version downloaded from Google Play and not from the Amazon Appstore.
If you wish to purchase the premium version, I recommend buying it via pointing your browser to https://play.google.com/store/apps/ rather than trying to purchase it in-app (which can be temperamental, this is a workaround after all).

9. Open File Manager and search for .apk files - once you have found the .apk file for HappyCow send it to your desktop and move it to your apktool folder.
10. Open the apktool folder, hold shift and right click. Select 'Open Command Window Here'.
Type exactly this into the command window: apktool d [name of apk].apk
My apk appeared as com.sisow.hcvg.healthydiningguide, therefore I typed apktool d com.sisow.hcvg.healthydiningguide.apk
You can rename the apk to something easier and it won't make a difference to the installation.
apktool will now decompile the app into a folder with the same name which will appear in the apktool folder. Keep the command window open, as we will be going back to it.
11. Navigate through the created folder smali > com > google > android > gms > common. Find the file GooglePlayServicesUtil.smali and open it in Notepad.
12. Find the method section beginning with line "method public static isGooglePlayServicesAvailable". Replace the entire method section in question with the following, indenting the first three lines with four spaces:
.locals 3

const/4 v0, 0x0

return v0
.end method
Save and exit.
13. Point your browser to this link. Select Project and 'Create project' from the top left. Click 'Create' again. Then, under Google Maps APIs, select Google Maps Android API. Select 'Enable' and then 'Go to Credentials'. Under 'Where will you be calling the API from?' Select 'Android' and follow on. Then select 'Create API Key' and 'Done'. Leave the window open, or copy the key that is generated (it will begin AIza...).
14. Go back to your Desktop > apktool > new folder > and open AndroidManifest.xml with Notepad.
Find the line
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="@string/google_maps_api_key"/>
Replace the part I have made bold with the API key generated in the last step (keeping speech marks). Save and exit.
15. Return to your command window and now type: apktool b [name of apk]
apktool will now rebuild your apk. The destination folder of the rebuild will be apktool > new folder > dist. You can now close this command window.
16. Point your desktop browser to this link. The password is SanketN8. Download and unrar the folder with an application like 7zip if you don't already have something similar.
17. Open the SignApk folder and hold shift + right click to Open Command Window in that folder. At the same time, open the Text Document file 'Signing'. You should see a line like this: java -jar signapk.jar certificate.pem key.pk8 your-app.apk your-app-signed.apk
18. Replace wherever it says "your-app" with the name of the apk we generated in step 15 that can be found in the dist folder. Now move that apk from the dist folder to your SignApk folder.
Copy and paste the new line in the doc (which should now look something like java -jar signapk.jar certificate.pem key.pk8 com.sisow.hcvg.healthydiningguide.apk com.sisow.hcvg.healthydiningguide-signed.apk) into the SignApk command window (right click and select 'Paste' because ctrl+v will not work). Hit Enter.
Your final, patched and signed, .apk file will now be created in the SignApk folder. It will be the file that ends with "-signed.apk".
19. Send this back to your phone. Once received, the file should automatically open.
(If not you can search for the new .apk file in your File Manager.)
It will give you the option of installing either via the native installation app or via the Play Store - use the native app to install. If the app does not open, you might need to restart your phone. Please note that opening any patched application for the first time can take several minutes.

Now you have a working version of the latest HappyCow app on your BlackBerry 10 device with Google Maps integrated!! Just remember to load Google Play Services (will appear on BB as 'Google Settings') whenever you restart your device to make sure sideloaded apps will work. Once loaded you can close the window and it will run in the background.

If you already have sideloaded Google Play onto your phone and you are already a user of Snap then the process will be simpler. However, as of late, Snap users cannot register new accounts - apparently the developer is aware of this issue and is hoping to submit a new release soon that fixes it (v.2.0.0.2 is the latest issue at the time of this post). Existing users, however, should still be able to use Snap unaffected.

Last update: 22nd Aug '16.
 
Last edited by a moderator:
  • Like
Reactions: jatergb and Damo
Other recommended apps for BB OS 10:

Green Tomato Cars - via Google Play (the app is free). For environmental cab services in London, Paris, or DC.
VegeTipple - via Google Play. There is a free version. It uses the Barnivore drinks database to help you identify vegan from non-vegan alcoholic drinks, along with country of origin should you wish to purchase a bit more locally.
ViewRangeGPS - via Amazon appstore (free). No patching required. This is an amazing app.

Post your recommendations below. :)
 
Last edited by a moderator: