Mads Ager | 418d1ca | 2017-05-22 09:35:49 +0200 | [diff] [blame] | 1 | # Copyright (c) 2017, the R8 project authors. Please see the AUTHORS file |
| 2 | # for details. All rights reserved. Use of this source code is governed by a |
| 3 | # BSD-style license that can be found in the LICENSE file. |
| 4 | |
Mads Ager | 418d1ca | 2017-05-22 09:35:49 +0200 | [diff] [blame] | 5 | import os |
| 6 | import utils |
| 7 | |
Christoffer Quist Adamsen | ae60e66 | 2019-11-08 10:34:35 +0100 | [diff] [blame] | 8 | ANDROID_H_MR2_API = '13' |
Yohann Roussel | 49e54a1 | 2017-06-23 18:08:07 +0200 | [diff] [blame] | 9 | ANDROID_L_API = '21' |
Rico Wind | 6238f22 | 2018-10-03 10:36:10 +0200 | [diff] [blame] | 10 | BASE = os.path.join(utils.THIRD_PARTY, 'youtube') |
Mads Ager | 418d1ca | 2017-05-22 09:35:49 +0200 | [diff] [blame] | 11 | |
Christoffer Quist Adamsen | d839c3f | 2020-08-20 10:12:34 +0200 | [diff] [blame] | 12 | V15_33_BASE = os.path.join(BASE, 'youtube.android_15.33') |
| 13 | V15_33_PREFIX = os.path.join(V15_33_BASE, 'YouTubeRelease') |
| 14 | |
Christoffer Quist Adamsen | e18f920 | 2021-05-31 13:14:20 +0200 | [diff] [blame] | 15 | V16_20_BASE = os.path.join(BASE, 'youtube.android_16.20') |
| 16 | V16_20_PREFIX = os.path.join(V16_20_BASE, 'YouTubeRelease') |
| 17 | |
| 18 | LATEST_VERSION = '16.20' |
Mads Ager | 418d1ca | 2017-05-22 09:35:49 +0200 | [diff] [blame] | 19 | |
| 20 | VERSIONS = { |
Christoffer Quist Adamsen | d839c3f | 2020-08-20 10:12:34 +0200 | [diff] [blame] | 21 | '15.33': { |
| 22 | 'dex' : { |
| 23 | 'inputs': [os.path.join(V15_33_BASE, 'YouTubeRelease_unsigned.apk')], |
| 24 | 'pgmap': '%s_proguard.map' % V15_33_PREFIX, |
Christoffer Quist Adamsen | 4380de3 | 2021-04-23 06:24:31 +0200 | [diff] [blame] | 25 | 'libraries' : [utils.get_android_jar(25)], |
Christoffer Quist Adamsen | d839c3f | 2020-08-20 10:12:34 +0200 | [diff] [blame] | 26 | 'min-api' : ANDROID_L_API, |
| 27 | }, |
| 28 | 'deploy' : { |
| 29 | # When -injars and -libraryjars are used for specifying inputs library |
| 30 | # sanitization is on by default. For this version of YouTube -injars and |
| 31 | # -libraryjars are not used, but library sanitization is still required. |
| 32 | 'sanitize_libraries': True, |
| 33 | 'inputs': ['%s_deploy.jar' % V15_33_PREFIX], |
| 34 | 'libraries' : [os.path.join(V15_33_BASE, 'legacy_YouTubeRelease_combined_library_jars.jar')], |
| 35 | 'pgconf': [ |
| 36 | '%s_proguard.config' % V15_33_PREFIX, |
| 37 | '%s_proguard_missing_classes.config' % V15_33_PREFIX, |
Christoffer Quist Adamsen | 1ca046c | 2021-02-21 11:25:16 +0100 | [diff] [blame] | 38 | '%s/proguardsettings/YouTubeRelease_proguard.config' % utils.THIRD_PARTY, |
| 39 | utils.IGNORE_WARNINGS_RULES], |
Christoffer Quist Adamsen | d839c3f | 2020-08-20 10:12:34 +0200 | [diff] [blame] | 40 | 'maindexrules' : [ |
| 41 | os.path.join(V15_33_BASE, 'mainDexClasses.rules'), |
| 42 | os.path.join(V15_33_BASE, 'main-dex-classes-release-optimized.pgcfg'), |
| 43 | os.path.join(V15_33_BASE, 'main_dex_YouTubeRelease_proguard.cfg')], |
| 44 | 'min-api' : ANDROID_H_MR2_API, |
| 45 | }, |
| 46 | 'proguarded' : { |
| 47 | 'inputs': ['%s_proguard.jar' % V15_33_PREFIX], |
| 48 | 'pgmap': '%s_proguard.map' % V15_33_PREFIX, |
| 49 | 'min-api' : ANDROID_L_API, |
| 50 | } |
| 51 | }, |
Christoffer Quist Adamsen | e18f920 | 2021-05-31 13:14:20 +0200 | [diff] [blame] | 52 | '16.20': { |
| 53 | 'deploy' : { |
| 54 | 'sanitize_libraries': False, |
| 55 | 'inputs': ['%s_deploy.jar' % V16_20_PREFIX], |
| 56 | 'libraries' : [ |
| 57 | os.path.join( |
| 58 | V16_20_BASE, |
| 59 | 'legacy_YouTubeRelease_combined_library_jars_filtered.jar')], |
| 60 | 'pgconf': [ |
| 61 | '%s_proguard.config' % V16_20_PREFIX, |
| 62 | '%s/proguardsettings/YouTubeRelease_proguard.config' % utils.THIRD_PARTY, |
| 63 | utils.IGNORE_WARNINGS_RULES], |
| 64 | 'min-api' : ANDROID_L_API, |
| 65 | 'android_java8_libs': { |
| 66 | 'config': '%s/desugar_jdk_libs/full_desugar_jdk_libs.json' % V16_20_BASE, |
| 67 | # Intentionally not adding desugar_jdk_libs_configuration.jar since it |
| 68 | # is part of jdk_libs_to_desugar.jar in YouTube 16.20. |
| 69 | 'program': ['%s/desugar_jdk_libs/jdk_libs_to_desugar.jar' % V16_20_BASE], |
| 70 | 'library': '%s/android_jar/lib-v30/android.jar' % utils.THIRD_PARTY, |
| 71 | 'pgconf': [ |
| 72 | '%s/desugar_jdk_libs/base.pgcfg' % V16_20_BASE, |
| 73 | '%s/desugar_jdk_libs/minify_desugar_jdk_libs.pgcfg' % V16_20_BASE |
| 74 | ] |
| 75 | } |
| 76 | }, |
| 77 | 'proguarded' : { |
| 78 | 'inputs': ['%s_proguard.jar' % V16_20_PREFIX], |
| 79 | 'pgmap': '%s_proguard.map' % V16_20_PREFIX, |
| 80 | 'min-api' : ANDROID_L_API, |
| 81 | } |
| 82 | }, |
Mads Ager | 418d1ca | 2017-05-22 09:35:49 +0200 | [diff] [blame] | 83 | } |
Christoffer Quist Adamsen | 81d4150 | 2021-06-25 09:33:43 +0200 | [diff] [blame] | 84 | |
| 85 | def GetLatestVersion(): |
| 86 | return LATEST_VERSION |
| 87 | |
| 88 | def GetName(): |
| 89 | return 'youtube' |
| 90 | |
| 91 | def GetMemoryData(version): |
| 92 | assert version == '16.20' |
| 93 | return { |
Morten Krogh-Jespersen | 1d5c4ea | 2021-08-26 08:11:18 +0200 | [diff] [blame] | 94 | 'find-xmx-min': 3150, |
Morten Krogh-Jespersen | d7f1620 | 2021-08-23 09:41:52 +0200 | [diff] [blame] | 95 | 'find-xmx-max': 3300, |
Christoffer Quist Adamsen | 81d4150 | 2021-06-25 09:33:43 +0200 | [diff] [blame] | 96 | 'find-xmx-range': 64, |
Morten Krogh-Jespersen | d7f1620 | 2021-08-23 09:41:52 +0200 | [diff] [blame] | 97 | 'oom-threshold': 3100, |
Christoffer Quist Adamsen | 81d4150 | 2021-06-25 09:33:43 +0200 | [diff] [blame] | 98 | # TODO(b/143431825): Youtube can OOM randomly in memory configurations |
| 99 | # that should work. |
| 100 | 'skip-find-xmx-max': True, |
| 101 | } |