Add the latest version of Gmail
The following changes was made to the Proguard configuration for R8
processing to succeed:
1. Added the line -dontwarn sun.net.spi.nameservice.NameServiceDescriptor
2. Removed Signature from -keepattributes
3. Uncommented -verbose
4. Uncommented all -checkdiscard rules
Change-Id: Ie28fe241b7d378b74254cf22b705d0e264d9ed8c
diff --git a/tools/gmail_data.py b/tools/gmail_data.py
new file mode 100644
index 0000000..ab1e6b4
--- /dev/null
+++ b/tools/gmail_data.py
@@ -0,0 +1,37 @@
+# Copyright (c) 2017, the R8 project authors. Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+import glob
+import os
+import utils
+
+THIRD_PARTY = os.path.join(utils.REPO_ROOT, 'third_party')
+BASE = os.path.join(THIRD_PARTY, 'gmail')
+
+V170604_16_BASE = os.path.join(BASE, 'gmail_android_170604.16')
+V170604_16_PREFIX = os.path.join(V170604_16_BASE, 'Gmail_release_unstripped')
+
+# NOTE: we always use android.jar for SDK v25, later we might want to revise it
+# to use proper android.jar version for each of youtube version separately.
+ANDROID_JAR = os.path.join(THIRD_PARTY, 'android_jar', 'lib-v25', 'android.jar')
+
+VERSIONS = {
+ '170604.16': {
+ 'dex' : {
+ 'inputs': [os.path.join(V170604_16_BASE, 'Gmail_release_unsigned.apk')],
+ 'pgmap': '%s_proguard.map' % V170604_16_PREFIX,
+ 'libraries' : [ANDROID_JAR, '/usr/local/buildtools/java/jdk-64/jre/lib/rt.jar'],
+ 'r8-flags': '--ignore-missing-classes',
+ },
+ 'deploy' : {
+ 'inputs': ['%s_deploy.jar' % V170604_16_PREFIX],
+ 'pgconf': ['%s_proguard.config' % V170604_16_PREFIX,
+ '%s/proguardsettings/YouTubeRelease_proguard.config' % THIRD_PARTY],
+ },
+ 'proguarded' : {
+ 'inputs': ['%s_proguard.jar' % V170604_16_PREFIX],
+ 'pgmap': '%s_proguard.map' % V170604_16_PREFIX,
+ }
+ },
+}
diff --git a/tools/run_r8_on_app.py b/tools/run_r8_on_app.py
index 804a27e..19696bb 100755
--- a/tools/run_r8_on_app.py
+++ b/tools/run_r8_on_app.py
@@ -10,9 +10,10 @@
import gmscore_data
import youtube_data
+import gmail_data
TYPES = ['dex', 'deploy', 'proguarded']
-APPS = ['gmscore', 'youtube']
+APPS = ['gmscore', 'youtube', 'gmail']
def ParseOptions():
result = optparse.OptionParser()
@@ -69,6 +70,9 @@
elif options.app == 'youtube':
options.version = options.version or '12.22'
data = youtube_data
+ elif options.app == 'gmail':
+ options.version = options.version or '170604.16'
+ data = gmail_data
else:
raise 'Unexpected'