1. Sally Mack's Avatar
    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.
    Nice work there... think this will help with some apps I couldn't figure out!
    12-15-13 05:34 PM
  2. Alastair Livingston's Avatar
    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 PM
  3. christian-georgescu's Avatar
    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!
    Hi,

    Here it is. Not tested though. Good luck.
    12-16-13 07:22 AM
  4. christian-georgescu's Avatar
    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
    Hi,

    The steps for autodetect and patch the obfuscate google play file would be:
    1. 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;
    2. in the detected file, search again for the unique pattern and get the method singnature that contains the pattern (good luck here)
    3. replace ONLY the method body with the patched one.


    The best that I could come up in a hurry is in version v2.1:

    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);
    2. The result file should be X.smali (if the detection was lucky, the correct file will be something like f.smali or e.smali);
    3. 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);
    4. replace the method body with the correct one.


    Remarks:
    1. I have tried 2 obfuscated apk and all went well;
    2. 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;
    3. 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 AM
  5. Cobalt232's Avatar
    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 CB10
    12-16-13 08:10 AM
  6. Alastair Livingston's Avatar
    Hi,

    Here it is. Not tested though. Good luck.
    Thanks for your help Christian. Unfortunately it has a failure 500 'Package-Id' when you try to sideload it. Is there anyway to get around that?
    12-16-13 10:27 AM
  7. Cobalt232's Avatar
    Thanks for your help Christian. Unfortunately it has a failure 500 'Package-Id' when you try to sideload it. Is there anyway to get around that?
    Failure 500 means, that you are trying to sideload an apk file. You must first convert the apk file to a bar file before sideloading, if you aren't on OS 10.2.1.xx.

    You can convert the apk online here or you can download and use the Blackberry Developer Tools
    12-16-13 10:42 AM
  8. christian-georgescu's Avatar
    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 CB10
    Here is version v2.2. Should cover your suggestion. Regards.
    Cobalt232 likes this.
    12-17-13 12:18 PM
  9. dustmalik's Avatar
    Here is version v2.2. Should cover your suggestion. Regards.
    Awesome work man. Well done.

    Posted via CB10 using my Gorgeous Z10
    12-17-13 12:39 PM
  10. Cobalt232's Avatar
    Christian

    Tried to run the new script and got garbage on the screen. I figured out, that the problem is the coding of the file. Had to change the coding from UTF-8 to ANSI to make it work.

    Just as a feedback.
    12-17-13 01:49 PM
  11. JBezeau's Avatar
    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 AM
  12. owencool's Avatar
    Hey, 1 questions for me noobs, what tool do you use for edit the apk file? Right now, I'm using eclipse, and it is kinda confusing

    Posted via CB10
    12-23-13 01:27 AM
  13. owencool's Avatar
    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 CB10
    12-23-13 01:33 AM
  14. gschep's Avatar
    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.

    Thanks
    12-23-13 08:58 AM
  15. Lendo's Avatar
    I've given up hope on this one. https://dl.dropboxusercontent.com/u/....Quebec511.apk
    12-24-13 05:12 PM
  16. dustmalik's Avatar
    From 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 Z10
    12-24-13 06:22 PM
  17. Lendo's Avatar
    From 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 Z10
    Mine doesn't show the traffic and such. Thought maybe it had something to do with it.
    12-24-13 07:30 PM
  18. Sally Mack's Avatar
    Mine doesn't show the traffic and such. Thought maybe it had something to do with it.
    It likely does... doesn't 10.2.1 use openstreetmaps API in place of Google maps API? I'll give it a go this week.
    12-24-13 09:50 PM
  19. rocah360's Avatar
    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 PM
  20. Cobalt232's Avatar
    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?
    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 here
    Last edited by Cobalt232; 12-25-13 at 05:51 PM.
    Sally Mack likes this.
    12-25-13 05:36 PM
  21. Sally Mack's Avatar
    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.

    Thanks
    Wow, turns out that both of these apps, when trying to rebuild using the api v1 method spit out errors about their respective public.xml files... perhaps one of the more skilled members isolate what's causing this? I'd think this is affecting more apps out there as well.
    12-25-13 10:21 PM
  22. Sally Mack's Avatar
    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 here
    I seem to be getting the same error with any apks that use api v1... can't find datadispatchrequester.smali.tmp
    12-26-13 03:59 AM
  23. Cobalt232's Avatar
    Just patched a V1 app and it worked flawlessly. Are you on Windows 7 64 bit? If yes, you may have to use fart 64 bit.
    In \wbin folder rename fart.exe to fart32.exe and rename fart64.exe to fart.exe
    12-26-13 06:29 AM
  24. dustmalik's Avatar
    Just patched a V1 app and it worked flawlessly. Are you on Windows 7 64 bit? If yes, you may have to use fart 64 bit.
    In \wbin folder rename fart.exe to fart32.exe and rename fart64.exe to fart.exe
    @Cobalt232, using your modified scripts and Christian's scripts, I tried to patch Dunkin' Donuts v2.7, everything goes well until it tries to sign the apk and there it fails. Could you please look into it and see if that can resolved. Thanks.

    Posted via CB10 using my Gorgeous Z10
    12-26-13 07:40 AM
  25. Cobalt232's Avatar
    Will do and Report back, but earliest on Sunday

    Posted via CB10
    12-26-13 09:38 AM
733 ... 910111213 ...

Similar Threads

  1. Best Leak to Run on T-Mobile Network?
    By AfroZepher in forum BlackBerry 10 OS
    Replies: 16
    Last Post: 01-21-15, 07:29 AM
  2. Manually program BB10 device to set MDN and MSID?
    By onlinespending in forum BlackBerry 10 OS
    Replies: 3
    Last Post: 10-20-13, 12:26 PM
  3. My Z10 updated now I can't hook up to wifi
    By Tony Stashuk in forum BlackBerry Z10
    Replies: 5
    Last Post: 10-19-13, 11:44 PM
  4. Used sachesi and SR version still says 4181??
    By sinnar in forum BlackBerry 10 OS
    Replies: 4
    Last Post: 10-19-13, 08:18 PM
LINK TO POST COPIED TO CLIPBOARD