How to fix any Android app dependent on Google Maps API and make maps working
- Christian, well done! Thanks for fixing :-)
I have patched quite a lot of apps manually and I have learned, that the method "isGooglePlayServicesAvailable" can easily be found by searching for com.vendor.android and using the header as additional identification. This works quite well, even if the methods are obfuscated.12-15-13 05:34 PMLike 0 - Hi Christian,
Annoyingly I am still having problems with v2 but I think the fault might be down to the java I have installed at my end. Just trying to sort it out, but is there any chance you could send me the apk that you created of the file, in case I am unable to find what the problem is on my laptop.
Many thanks for all your help again!12-15-13 06:56 PMLike 0 - Hi Christian,
Annoyingly I am still having problems with v2 but I think the fault might be down to the java I have installed at my end. Just trying to sort it out, but is there any chance you could send me the apk that you created of the file, in case I am unable to find what the problem is on my laptop.
Many thanks for all your help again!
Here it is. Not tested though. Good luck.12-16-13 07:22 AMLike 0 - Christian, well done! Thanks for fixing :-)
I have patched quite a lot of apps manually and I have learned, that the method "isGooglePlayServicesAvailable" can easily be found by searching for com.vendor.android and using the header as additional identification. This works quite well, even if the methods are obfuscated.
Example of an obfuscated method:
.method public static a(Landroid/content/ContextI
.registers 8
const/16 v0, 0x9
const/4 v2, 0x1
const/4 v1, 0x0
invoke-virtual {p0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
move-result-object v3
:try_start_8
invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v4
const v5, 0x7f0a005b
invoke-virtual {v4, v5}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;
:try_end_12
.catch Ljava/lang/Throwable; {:try_start_8 .. :try_end_12} :catch_6b
:goto_12
:try_start_12
const-string v4, "com.android.vending"
const/16 v5, 0x40
------ truncated -----
The method always defines the registers and the three constant values and then defines a string as "com.android.vending"
const/16 v0, 0x9
const/4 v2, 0x1
const/4 v1, 0x0
...
const-string v4, "com.android.vending"
Maybe you can use this identification to a) find the correct file and b) patch the correct method.
What is your opinion on this?
regards
The steps for autodetect and patch the obfuscate google play file would be:
- Search in every *.smali file from correct folder for the unique pattern string (e.g. const-string v4, "com.android.vending") and detect the single file that contains it;
- in the detected file, search again for the unique pattern and get the method singnature that contains the pattern (good luck here)
- replace ONLY the method body with the patched one.
The best that I could come up in a hurry is in version v2.1:
- Search in every *.smali file in folder: 'apkfolder\smali\com\google\android\gms\common\' for string: 'const-string v4, "com.android.vending"' (should occur only once, if many => unpredictable results);
- The result file should be X.smali (if the detection was lucky, the correct file will be something like f.smali or e.smali);
- Search in X.smali for the method '.method public static X(Landroid/content/ContextI' where X could be any letter (should detect only one occurrence, if many => unpredictable results);
- replace the method body with the correct one.
Remarks:
- I have tried 2 obfuscated apk and all went well;
- on the 2 obfuscated apk that I have tried, the string 'const-string v4, "com.android.vending"' is present ONLY in ONE smali file considering 'apkfolder\smali\com\google\android\gms\common\' folder;
- in the detected file (usualy something like f.smali or e.smali), the string 'const-string v4, "com.android.vending"' is present ONLY in '.method public static X(Landroid/content/ContextI' method, where usually X=a;
If you have better ideas, feel free to share
Regards,12-16-13 07:36 AMLike 0 - Hi Christian
Maybe we can refine search by including the const values. The always apear in the same order:
0x9
0x1
0x0
So if you find multiple files with com.android.vending you can discard the result and read the next file until you get a full match.
This should be quite reliable.
Posted via CB1012-16-13 08:10 AMLike 0 - 12-16-13 10:27 AMLike 0
-
You can convert the apk online here or you can download and use the Blackberry Developer Tools12-16-13 10:42 AMLike 0 - Hi Christian
Maybe we can refine search by including the const values. The always apear in the same order:
0x9
0x1
0x0
So if you find multiple files with com.android.vending you can discard the result and read the next file until you get a full match.
This should be quite reliable.
Posted via CB10Cobalt232 likes this.12-17-13 12:18 PMLike 1 - Here is version v2.2. Should cover your suggestion. Regards.
Posted via CB10 using my Gorgeous Z1012-17-13 12:39 PMLike 0 - Hey would anyone be able to convert the latest version of Tinder found here? Tinder 2.1.0 | APKDAD
Thanks!12-22-13 08:56 AMLike 0 - 1 more questions for the apk files, can we edit the Androidmanifest.xml? The problem I got, that the manifest was decrypted and won't be able to edit it with notepad. So I tried to using eclipse to edit the manifest and I can see and edit it the manifest, but when I compiled the apk and sign the apk, I can't convert it to bar file.
Posted via CB1012-23-13 01:33 AMLike 0 - Having trouble with this one - GPS Tracking Pro - by life360
https://www.dropbox.com/s/i3oy3qd1mc....android.c.apk
Getting a boatload of errors in the \res\values\public.xml file.
If somebody has a minute - check if it is me or if it is the app itself.
Thanks12-23-13 08:58 AMLike 0 - LendoRetired ModeratorI've given up hope on this one. https://dl.dropboxusercontent.com/u/....Quebec511.apk12-24-13 05:12 PMLike 0
- I've given up hope on this one. https://dl.dropboxusercontent.com/u/....Quebec511.apk
I'm about to install the latest leak which is 10.2.1.1925. I believe more apps will run on that OS.
Posted via CB10 using my Gorgeous Z1012-24-13 06:22 PMLike 0 - LendoRetired ModeratorFrom my observation, almost all apps, if not all apps that uses API v1 works without any modification on OS 10.2.1.1259. For instance, Adidas miCoach, Dunkin' Donuts, Nike+ Running and so on. I just tested Quebec 511 and it works perfectly without patching it.
I'm about to install the latest leak which is 10.2.1.1925. I believe more apps will run on that OS.
Posted via CB10 using my Gorgeous Z1012-24-13 07:30 PMLike 0 -
- I never get to the screen where you have the choice, when using christian's tool.
I copied the apk over to the extracted folder of the tool, i've set up java und winrar directory correctly. I have opened a command prompt in the tool's folder and typed "patch.bat myapp.apk" and then it does something (too fast to read) and then closes. I never get to the point where you choose whether to patch v1 or v2 map api. Any suggestions?
Other point:
I tried to patch Strava as it says right after start (even before you're able to login) that it cannot detect google play services and that they're needed for this app. So i patched it, found the method with com.android.vending and pasted the code from the OP, changed to correct v2 api key, recompiled and signed the apk. But when i install it (directly using 10.2.1.1925) it's still saying that GooglePS are missing.
Runtastic Pro doesn't even recompile (even without any changes, just decompiled and then tried to build but was given errors), and the runtastic pro from BBW is old and doesn't let you use a heart rate bluetooth devices. So all my beloved android apps are still not working on BB10...Last edited by rocah360; 12-25-13 at 02:47 PM.
12-25-13 02:28 PMLike 0 - I never get to the screen where you have the choice, when using christian's tool.
I copied the apk over to the extracted folder of the tool, i've set up java und winrar directory correctly. I have opened a command prompt in the tool's folder and typed "patch.bat myapp.apk" and then it does something (too fast to read) and then closes. I never get to the point where you choose whether to patch v1 or v2 map api. Any suggestions?
Changelog 2.2.1
- Fixed file encoding to ANSI
- Added support for Fart32 (is default now, rename fart64.exe to fart.exe on 64bit OS)
- Included a valid Google Maps V2 key
You can download the updated version hereLast edited by Cobalt232; 12-25-13 at 05:51 PM.
Sally Mack likes this.12-25-13 05:36 PMLike 1 - Having trouble with this one - GPS Tracking Pro - by life360
https://www.dropbox.com/s/i3oy3qd1mc....android.c.apk
Getting a boatload of errors in the \res\values\public.xml file.
If somebody has a minute - check if it is me or if it is the app itself.
ThanksI've given up hope on this one. https://dl.dropboxusercontent.com/u/....Quebec511.apk12-25-13 10:21 PMLike 0 - Christian's script has some major problems with the file encoding and there is a bug in the script that prevents it from being executed (at least on my Windows 7 32 bit OS). For your convenience, I fixed these problems and added some goodies.
Changelog 2.2.1
- Fixed file encoding to ANSI
- Added support for Fart32 (is default now, rename fart64.exe to fart.exe on 64bit OS)
- Included a valid Google Maps V2 key
You can download the updated version here12-26-13 03:59 AMLike 0 -
Posted via CB10 using my Gorgeous Z1012-26-13 07:40 AMLike 0
- Forum
- BlackBerry 10 Phones & OS
- More for your BlackBerry 10 Phone!
How to fix any Android app dependent on Google Maps API and make maps working
Similar Threads
-
Best Leak to Run on T-Mobile Network?
By AfroZepher in forum BlackBerry 10 OSReplies: 16Last Post: 01-21-15, 07:29 AM -
Manually program BB10 device to set MDN and MSID?
By onlinespending in forum BlackBerry 10 OSReplies: 3Last Post: 10-20-13, 12:26 PM -
My Z10 updated now I can't hook up to wifi
By Tony Stashuk in forum BlackBerry Z10Replies: 5Last Post: 10-19-13, 11:44 PM -
Used sachesi and SR version still says 4181??
By sinnar in forum BlackBerry 10 OSReplies: 4Last Post: 10-19-13, 08:18 PM
LINK TO POST COPIED TO CLIPBOARD