Quantcast
Channel: xda-developers - Android Software and Hacking General [Developers Only]
Viewing all articles
Browse latest Browse all 3614

Modified Gmail.apk for downloading attached '.zip', '.tar', etc. files

$
0
0
Hello all,

Yesterday, I discovered that the Gmail app refuses to open or save attached zips (or other archives) because they "could contain malicious software." Well I don't appreciate Google making that determination for me, so I modified the latest Gmail.apk to remove the restriction and thought I'd share. This is based off Gmail 4.2.1 and should work on most devices.

This will allow you to download attachments that were previously disallowed by the Gmail application. You will need another app that is capable of opening a zip/tar/etc file installed.

Disclaimer: I am not responsible for whatever happens as a result of using this modified version. If it goes crazy and emails embarrassing photos to all of your contacts it is neither my nor Google's fault.

That said, the changes are pretty minor and so far seem to work as expected.


Installation:
  1. Uninstall existing Gmail app. If Gmail came pre-installed you must delete it from /system/app (root required)
  2. Install Gmail-zips-signed.apk as normal.
  3. Enjoy.

Modifications Made:
These instructions are only necessary if you wish to modify the APK yourself, otherwise see above.
Decode Gmail.apk:
Code:

apktool d Gmail.apk
Replace the following from 'smali/com/google/android/gm/provider' (starting around line 40):
Code:

    .line 34
    const-string v0, "application/zip"

    const-string v1, "application/x-gzip"

    const-string v2, "application/x-bzip2"

    const-string v3, "application/x-compress"

    const-string v4, "application/x-compressed"

    const-string v5, "application/x-tar"

    new-array v6, v7, [Ljava/lang/String;

    invoke-static/range {v0 .. v6}, Lcom/google/common/collect/ImmutableSet;->of(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;[Ljava/lang/Object;)Lcom/google/common/collect/ImmutableSet;

with
Code:

    .line 34
    new-array v6, v7, [Ljava/lang/String;

    invoke-static {v6}, Lcom/google/common/collect/ImmutableSet;->of(Ljava/lang/Object;)Lcom/google/common/collect/ImmutableSet;

Rebuild Gmail.apk:
Code:

apktool b Gmail.apk
Sign and install!

*This seemed like the correct place to post since the modification applies to any device, but I apologize if this post belongs in another forum*

Attached Files
File Type: apk Gmail-zips-signed.apk - [Click for QR Code] (2.75 MB)

Viewing all articles
Browse latest Browse all 3614

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>