Commit ccc5a98e authored by Tibor Goldschwendt's avatar Tibor Goldschwendt Committed by Commit Bot

[android] Remove async proguarded feature module functionality

We don't forsee that being used. Thus, remove code and reduce
maintenance burden.

Bug: 1012714
Change-Id: Ia3d93513c39f67e4a1c120e6b0688b4734a0aba3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1849940
Commit-Queue: Tibor Goldschwendt <tiborg@chromium.org>
Auto-Submit: Tibor Goldschwendt <tiborg@chromium.org>
Reviewed-by: default avatarPeter Wen <wnwen@chromium.org>
Reviewed-by: default avatarPiotr Bialecki <bialpio@chromium.org>
Reviewed-by: default avatarFred Mello <fredmello@chromium.org>
Cr-Commit-Position: refs/heads/master@{#704254}
parent a4219e7d
...@@ -11,7 +11,6 @@ java_binary("java_bytecode_rewriter") { ...@@ -11,7 +11,6 @@ java_binary("java_bytecode_rewriter") {
"java/org/chromium/bytecode/AssertionEnablerClassAdapter.java", "java/org/chromium/bytecode/AssertionEnablerClassAdapter.java",
"java/org/chromium/bytecode/ByteCodeProcessor.java", "java/org/chromium/bytecode/ByteCodeProcessor.java",
"java/org/chromium/bytecode/ClassPathValidator.java", "java/org/chromium/bytecode/ClassPathValidator.java",
"java/org/chromium/bytecode/ConstantPoolReferenceReader.java",
"java/org/chromium/bytecode/CustomClassLoaderClassWriter.java", "java/org/chromium/bytecode/CustomClassLoaderClassWriter.java",
"java/org/chromium/bytecode/CustomResourcesClassAdapter.java", "java/org/chromium/bytecode/CustomResourcesClassAdapter.java",
"java/org/chromium/bytecode/ThreadAssertionClassAdapter.java", "java/org/chromium/bytecode/ThreadAssertionClassAdapter.java",
......
...@@ -63,7 +63,6 @@ class ByteCodeProcessor { ...@@ -63,7 +63,6 @@ class ByteCodeProcessor {
private static ClassLoader sDirectClassPathClassLoader; private static ClassLoader sDirectClassPathClassLoader;
private static ClassLoader sFullClassPathClassLoader; private static ClassLoader sFullClassPathClassLoader;
private static Set<String> sFullClassPathJarPaths; private static Set<String> sFullClassPathJarPaths;
private static String sGenerateClassDepsPath;
private static ClassPathValidator sValidator; private static ClassPathValidator sValidator;
private static class EntryDataPair { private static class EntryDataPair {
...@@ -257,7 +256,6 @@ class ByteCodeProcessor { ...@@ -257,7 +256,6 @@ class ByteCodeProcessor {
sShouldUseCustomResources = args[currIndex++].equals("--enable-custom-resources"); sShouldUseCustomResources = args[currIndex++].equals("--enable-custom-resources");
sShouldUseThreadAnnotations = args[currIndex++].equals("--enable-thread-annotations"); sShouldUseThreadAnnotations = args[currIndex++].equals("--enable-thread-annotations");
sShouldCheckClassPath = args[currIndex++].equals("--enable-check-class-path"); sShouldCheckClassPath = args[currIndex++].equals("--enable-check-class-path");
sGenerateClassDepsPath = args[currIndex++];
int sdkJarsLength = Integer.parseInt(args[currIndex++]); int sdkJarsLength = Integer.parseInt(args[currIndex++]);
List<String> sdkJarPaths = List<String> sdkJarPaths =
Arrays.asList(Arrays.copyOfRange(args, currIndex, currIndex + sdkJarsLength)); Arrays.asList(Arrays.copyOfRange(args, currIndex, currIndex + sdkJarsLength));
...@@ -280,13 +278,6 @@ class ByteCodeProcessor { ...@@ -280,13 +278,6 @@ class ByteCodeProcessor {
sFullClassPathJarPaths.addAll( sFullClassPathJarPaths.addAll(
Arrays.asList(Arrays.copyOfRange(args, currIndex, args.length))); Arrays.asList(Arrays.copyOfRange(args, currIndex, args.length)));
// Write list of references from Java class constant pools to specified output file
// sGenerateClassDepsPath. This is needed for keep rule generation for async DFMs.
if (!sGenerateClassDepsPath.isEmpty()) {
ConstantPoolReferenceReader.writeConstantPoolRefsToFile(
sFullClassPathJarPaths, sGenerateClassDepsPath);
}
sFullClassPathClassLoader = loadJars(sFullClassPathJarPaths); sFullClassPathClassLoader = loadJars(sFullClassPathJarPaths);
sFullClassPathJarPaths.removeAll(directClassPathJarPaths); sFullClassPathJarPaths.removeAll(directClassPathJarPaths);
......
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.bytecode;
import org.objectweb.asm.ClassReader;
import java.io.BufferedInputStream;
import java.io.BufferedWriter;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
/**
* Compiles list of references from all Java .class files in given jar paths by
* reading from the constant pool, and writes this list to an output file.
* This list is used for keep rule generation for maintaining compatibility between
* async DFMs and synchronous modules.
*/
public class ConstantPoolReferenceReader {
private static final String CLASS_FILE_SUFFIX = ".class";
private static final int BUFFER_SIZE = 16384;
// Constants representing Java constant pool tags
// See https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.4
private static final int FIELD_REF_TAG = 9;
private static final int METHOD_REF_TAG = 10;
private static final int INTERFACE_METHOD_REF_TAG = 11;
private static byte[] readAllBytes(InputStream inputStream) throws IOException {
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
int numRead = 0;
byte[] data = new byte[BUFFER_SIZE];
while ((numRead = inputStream.read(data, 0, data.length)) != -1) {
buffer.write(data, 0, numRead);
}
return buffer.toByteArray();
}
/**
* Given a set of paths, generates references used to produce Proguard keep rules
* necessary for asynchronous DFMs.
* It reads all references stored in constant pools of Java classes from
* the specified jar paths and writes them to an output file.
* References written to the specified file can be converted to a
* corresponding set of Proguard keep rules using the
* constant_pool_refs_to_keep_rules.py script.
*
* @param jarPaths Set of paths specifying Java files to read constant pool
* references from.
* @param outputFilePath File path to write output to.
*/
public static void writeConstantPoolRefsToFile(Set<String> jarPaths, String outputFilePath) {
HashSet<String> classReferences = new HashSet<>();
for (String jarPath : jarPaths) {
try (ZipInputStream inputStream = new ZipInputStream(
new BufferedInputStream(new FileInputStream(jarPath)))) {
ZipEntry entry;
while ((entry = inputStream.getNextEntry()) != null) {
if (entry.isDirectory() || !entry.getName().endsWith(CLASS_FILE_SUFFIX)) {
continue;
}
byte[] data = readAllBytes(inputStream);
ClassReader reader = new ClassReader(data);
classReferences.addAll(collectConstantPoolClassReferences(reader));
}
} catch (IOException e) {
throw new RuntimeException(e);
}
}
try {
BufferedWriter writer = new BufferedWriter(new FileWriter(outputFilePath));
for (String ref : classReferences) {
writer.append(ref);
writer.append("\n");
}
writer.close();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
/**
* Given a ClassReader, return a set of all super classes, implemented interfaces and
* members by reading from the associated class's constant pool.
*
* @param classReader .class file interface for reading the constant pool.
*/
private static Set<String> collectConstantPoolClassReferences(ClassReader classReader) {
char[] charBuffer = new char[classReader.getMaxStringLength()];
HashSet<String> classReferences = new HashSet<>();
classReferences.add(classReader.getSuperName());
classReferences.addAll(Arrays.asList(classReader.getInterfaces()));
// According to the Java spec, the constant pool is indexed from 1 to constant_pool_count -
// 1. See https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.4
StringBuilder refInfoString = new StringBuilder();
for (int i = 1; i < classReader.getItemCount(); i++) {
int offset = classReader.getItem(i);
if (offset <= 0) {
continue;
}
int constantType = classReader.readByte(offset - 1);
if (offset > 0
&& (constantType == METHOD_REF_TAG || constantType == FIELD_REF_TAG
|| constantType == INTERFACE_METHOD_REF_TAG)) {
// Read the corresponding class ref and member info from the constant pool.
int classIndex = classReader.readUnsignedShort(offset);
int classStartIndex = classReader.getItem(classIndex);
// Class index is a 2-byte quantity, nameAndTypeIndex is stored sequentially after.
int nameAndTypeIndex = classReader.readUnsignedShort(offset + 2);
int nameAndTypeStartIndex = classReader.getItem(nameAndTypeIndex);
// Get member's containing class's name, member's name, and member's details (type,
// return type, and argument types).
refInfoString.append(classReader.readUTF8(classStartIndex, charBuffer));
refInfoString.append(",");
refInfoString.append(classReader.readUTF8(nameAndTypeStartIndex, charBuffer));
refInfoString.append(",");
refInfoString.append(classReader.readUTF8(nameAndTypeStartIndex + 2, charBuffer));
classReferences.add(refInfoString.toString());
refInfoString.setLength(0);
}
}
return classReferences;
}
}
\ No newline at end of file
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
This script is used to convert a list of references to corresponding ProGuard
keep rules, for the purposes of maintaining compatibility between async DFMs
and synchronously proguarded modules.
This script take an input file generated from
//build/android/bytecode/java/org/chromium/bytecode/ByteCodeProcessor.java
during the build phase of an async module.
"""
from collections import defaultdict
import argparse
import sys
# Classes in _IGNORED_PACKAGES do not need explicit keep rules because they are
# system APIs and are already included in ProGuard configs.
_IGNORED_PACKAGES = ['java', 'android', 'org.w3c', 'org.xml', 'dalvik']
# Classes in _WHITELIST_PACKAGES are support libraries compiled into chrome
# that must bypass the _IGNORED_PACKAGES.
_WHITELIST_PACKAGES = ['android.support']
# TODO(https://crbug.com/968769): Filter may be too broad.
# Classes in _DFM_FEATURES will be excluded from "keep all members" rule.
_DFM_FEATURES = [
'org.chromium.chrome.autofill_assistant', 'org.chromium.chrome.tab_ui',
'org.chromium.chrome.browser.tasks.tab_management', 'org.chromium.chrome.vr'
]
# Mapping for translating Java bytecode type identifiers to source code type
# identifiers.
_TYPE_IDENTIFIER_MAP = {
'V': 'void',
'Z': 'boolean',
'B': 'byte',
'S': 'short',
'C': 'char',
'I': 'int',
'J': 'long',
'F': 'float',
'D': 'double',
}
# Translates DEX TypeDescriptor of the first type found in a given string to
# its source code type identifier, as described in
# https://source.android.com/devices/tech/dalvik/dex-format#typedescriptor,
# and returns the translated type and the starting index of the next type
# (if present).
def translate_single_type(typedesc):
array_count = 0
translated = ''
next_index = 0
# In the constant pool, fully qualified names (prefixed by 'L') have a
# trailing ';' if they are describing the type/return type of a symbol,
# or the type of arguments passed to a symbol. TypeDescriptor representing
# primitive types do not have trailing ';'s in any circumstances.
for i, c in enumerate(typedesc):
if c == '[':
array_count += 1
continue
if c == 'L':
# Fully qualified names have no trailing ';' if they are describing the
# containing class of a reference.
next_index = typedesc.find(';')
if next_index == -1:
next_index = len(typedesc)
translated = typedesc[i + 1:next_index]
break
else:
translated = _TYPE_IDENTIFIER_MAP[c]
next_index = i
break
translated += '[]' * array_count
return translated, next_index + 1
# Convert string of method argument types read from constant pool to
# corresponding list of srouce code type identifiers.
def parse_args_list(args_list):
parsed_args = []
start_index = 0
while start_index < len(args_list):
args_list = args_list[start_index:]
translated_arg, start_index = translate_single_type(args_list)
parsed_args.append(translated_arg)
return parsed_args
def add_to_refs(class_name, keep_entry, dep_refs):
# Add entry to class's keep rule if entry is not the empty string
if class_name in dep_refs and keep_entry:
dep_refs[class_name].append(keep_entry)
else:
dep_refs[class_name] = [keep_entry]
def should_include_class_path(class_path):
""" Check whether a class_path should be added as keep rule.
Conditions:
- Class is auto-generated (Lambdas/Nested, for example $)
- Class is not in a DFM Module
- Class is not in a black/white listed package
"""
nested_class = '$' in class_path
not_in_dfm = all(not class_path.startswith(f) for f in _DFM_FEATURES)
allowed_packages = not (any(
class_path.startswith(p)
for p in _IGNORED_PACKAGES) and all(not class_path.startswith(p)
for p in _WHITELIST_PACKAGES))
return nested_class or (not_in_dfm and allowed_packages)
def main(argv):
dep_refs = defaultdict(list)
extended_and_implemented_classes = set()
parser = argparse.ArgumentParser()
parser.add_argument(
'--input-file',
required=True,
help='Path to constant pool reference output.')
parser.add_argument(
'--output-file',
required=True,
help='Path to write corresponding keep rules to')
args = parser.parse_args(argv[1:])
with open(args.input_file, 'r') as constant_pool_refs:
for line in constant_pool_refs:
line = line.rstrip().replace('/', '.')
# Ignore any references specified by the list of
# _IGNORED_PACKAGES and not in _WHITELIST_PACKAGES.
if (any(line.startswith(p) for p in _IGNORED_PACKAGES)
and all(not line.startswith(p) for p in _WHITELIST_PACKAGES)):
continue
reflist = line.split(',')
# Lines denoting super classes and implemented interface references do
# not contain additional information and thus have reflist size 1.
# Store these as a separate set as they require full keep rules.
if len(reflist) == 1:
extended_and_implemented_classes.add(reflist[0])
continue
class_name = reflist[0]
member_name = reflist[1]
member_info = reflist[2]
keep_entry = ''
# When testing with the VR module, all class names read from constant
# pool output that were prefixed with '[' matched references to the
# overridden clone() method of the Object class. These seem to correspond
# to Java enum types defined within classes.
# It is not entirely clear whether or not this always represents
# an enum, why enums would be represented as such in the constant pool,
# or how we should go about keeping these references. For the moment,
# ignoring these references does not impact compatibility between
# modules.
if class_name.startswith('['):
continue
# Ignore R(esources) files that are from the same module.
if ('$' in class_name
and any(class_name.startswith(f) for f in _DFM_FEATURES)):
continue
# If member_info starts with '(', member is a method, otherwise member
# is a field.
# Format keep entries as per ProGuard documentation
# guardsquare.com/en/products/proguard/manual/usage#classspecification.
if member_info.startswith('('):
args_list, return_type = member_info.split(')')
args_list = parse_args_list(args_list[1:])
if member_name == '<init>':
# No return type specified for constructors.
return_type = ''
else:
return_type = translate_single_type(return_type)[0]
# Include types of function arguments.
for arg_type in args_list:
if should_include_class_path(arg_type):
extended_and_implemented_classes.add(arg_type)
# Include the actual class when it's a constructor.
if member_name == '<init>':
if should_include_class_path(class_name):
extended_and_implemented_classes.add(class_name)
continue
keep_entry = '%s %s(%s);' % (return_type, member_name,
', '.join(args_list))
else:
keep_entry = '%s %s;' % (translate_single_type(member_info)[0],
member_name)
dep_refs[class_name].append(keep_entry)
with open(args.output_file, 'w') as keep_rules:
# Write super classes and implemented interfaces to keep rules.
for super_class in sorted(extended_and_implemented_classes):
keep_rules.write('-keep class %s { *; }\n' % (super_class.rstrip()))
keep_rules.write('\n')
# Write all other class references to keep rules.
for c in sorted(dep_refs.iterkeys()):
if c in extended_and_implemented_classes:
continue
class_keeps = '\n '.join(dep_refs[c])
keep_rules.write('-keep class %s {\n %s\n}\n' % (c, class_keeps))
keep_rules.write('\n')
if __name__ == '__main__':
main(sys.argv)
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
import re
import os
class TestProguardRuleGeneration(unittest.TestCase):
"""
This script is used to test a ProGuard keep rules for the purposes
of maintaining compatibility between async DFMs and synchronously
proguarded modules.
The rules are often generated by constant_pool_refs_to_keep_rules.py
This test can be run manually. Example:
python build/android/constant_pool_refs_to_keep_rules_test.py -v
"""
# Make sure this variable is set accordingly.
# It should point to a proguard file.
PROGUARD_FILE_PATH = os.path.join(
os.path.dirname(__file__),
"../../chrome/android/features/tab_ui/proguard_async.flags")
def test_TabUI_HasRules(self):
"""
Ensures that a few of the rules used in tabs_ui module are included.
Although this is far from 100% deterministic, these rules are
created by code that exercise different parts of the rule generation code.
"""
rules = set()
with open(self.PROGUARD_FILE_PATH, 'r') as proguard_rules:
for line in proguard_rules:
if line.startswith('-keep'):
rule = re.search('class (.+?) {', line).group(1)
rules.add(rule)
# The following rules test most of the use cases for
# rules that can be added automatically.
self.assertIn('org.chromium.ui.modelutil.PropertyModel', rules)
self.assertIn('org.chromium.ui.modelutil.PropertyModel', rules)
self.assertIn('org.chromium.ui.modelutil.PropertyKey', rules)
self.assertIn('org.chromium.chrome.browser.toolbar.ToolbarManager', rules)
self.assertIn('org.chromium.base.Supplier', rules)
self.assertIn('android.support.v7.widget.helper.ItemTouchHelper', rules)
self.assertIn(
'android.support.v7.widget.helper.ItemTouchHelper$SimpleCallback',
rules)
self.assertIn('android.support.v7.widget.helper.ItemTouchHelper$Callback',
rules)
self.assertIn('android.support.v4.content.ContextCompat', rules)
self.assertIn('android.support.v7.widget.GridLayoutManager', rules)
self.assertIn('android.support.v4.content.res.ResourcesCompat', rules)
self.assertIn(
'org.chromium.chrome.browser.tasks.tabgroup.TabGroupModelFilter', rules)
self.assertIn('android.support.v7.widget.RecyclerView$ViewHolder', rules)
self.assertIn('android.support.v7.widget.RecyclerView', rules)
self.assertIn('org.chromium.ui.modelutil.SimpleRecyclerViewMcpBase', rules)
self.assertIn('org.chromium.ui.modelutil.RecyclerViewAdapter', rules)
# The following rules need to be added manually.
self.assertNotIn(
'org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager' +
'$FullscreenListener$$CC', rules)
self.assertNotIn(
'org.chromium.chrome.browser.widget.bottomsheet.BottomSheet' +
'$BottomSheetContent$$CC', rules)
self.assertNotIn('org.chromium.ui.widget.RoundedCornerImageView', rules)
self.assertNotIn(
'android.support.v4.graphics.drawable.RoundedBitmapDrawable', rules)
def test_TabUI_HasNoDuplicateRules(self):
"""
Ensures that there are no duplicate keep rules
"""
rules = set()
with open(self.PROGUARD_FILE_PATH, 'r') as proguard_rules:
for line in proguard_rules:
if line.startswith('-keep'):
rule = re.search('class (.+?) {', line).group(1)
self.assertNotIn(rule, rules)
rules.add(rule)
if __name__ == '__main__':
unittest.main()
...@@ -36,7 +36,6 @@ def main(argv): ...@@ -36,7 +36,6 @@ def main(argv):
_AddSwitch(parser, '--enable-assert') _AddSwitch(parser, '--enable-assert')
_AddSwitch(parser, '--enable-thread-annotations') _AddSwitch(parser, '--enable-thread-annotations')
_AddSwitch(parser, '--enable-check-class-path') _AddSwitch(parser, '--enable-check-class-path')
parser.add_argument('--enable-class-deps-output', default='')
args = parser.parse_args(argv) args = parser.parse_args(argv)
sdk_jars = build_utils.ParseGnList(args.sdk_classpath_jars) sdk_jars = build_utils.ParseGnList(args.sdk_classpath_jars)
...@@ -58,7 +57,6 @@ def main(argv): ...@@ -58,7 +57,6 @@ def main(argv):
args.script, args.input_jar, args.output_jar, verbose, args.is_prebuilt, args.script, args.input_jar, args.output_jar, verbose, args.is_prebuilt,
args.enable_assert, args.enable_custom_resources, args.enable_assert, args.enable_custom_resources,
args.enable_thread_annotations, args.enable_check_class_path, args.enable_thread_annotations, args.enable_check_class_path,
args.enable_class_deps_output,
str(len(sdk_jars)) str(len(sdk_jars))
] + sdk_jars + [str(len(direct_jars))] + direct_jars + extra_classpath_jars) ] + sdk_jars + [str(len(direct_jars))] + direct_jars + extra_classpath_jars)
subprocess.check_call(cmd) subprocess.check_call(cmd)
......
...@@ -111,8 +111,7 @@ def _ParseOptions(): ...@@ -111,8 +111,7 @@ def _ParseOptions():
parser.add_argument( parser.add_argument(
'--verbose', '-v', action='store_true', help='Print all ProGuard output') '--verbose', '-v', action='store_true', help='Print all ProGuard output')
parser.add_argument( parser.add_argument(
'--repackage-classes', '--repackage-classes', help='Package all optimized classes are put in.')
help='Unique package name given to an asynchronously proguarded module')
parser.add_argument( parser.add_argument(
'--disable-outlining', '--disable-outlining',
action='store_true', action='store_true',
......
...@@ -1529,10 +1529,8 @@ if (enable_java_templates) { ...@@ -1529,10 +1529,8 @@ if (enable_java_templates) {
_desugar = defined(invoker.supports_android) && invoker.supports_android _desugar = defined(invoker.supports_android) && invoker.supports_android
_jacoco_instrument = invoker.jacoco_instrument _jacoco_instrument = invoker.jacoco_instrument
_enable_class_deps_output = defined(invoker.enable_class_deps_output)
_enable_bytecode_rewriter = _enable_bytecode_rewriter =
_enable_assert || _enable_custom_resources || _enable_assert || _enable_custom_resources || _enable_thread_annotations
_enable_thread_annotations || _enable_class_deps_output
_is_prebuilt = defined(invoker.is_prebuilt) && invoker.is_prebuilt _is_prebuilt = defined(invoker.is_prebuilt) && invoker.is_prebuilt
_enable_bytecode_checks = !defined(invoker.enable_bytecode_checks) || _enable_bytecode_checks = !defined(invoker.enable_bytecode_checks) ||
invoker.enable_bytecode_checks invoker.enable_bytecode_checks
...@@ -1548,7 +1546,6 @@ if (enable_java_templates) { ...@@ -1548,7 +1546,6 @@ if (enable_java_templates) {
if (defined(invoker.enable_bytecode_rewriter)) { if (defined(invoker.enable_bytecode_rewriter)) {
not_needed([ not_needed([
"_enable_assert", "_enable_assert",
"_enable_class_deps_output",
"_enable_custom_resources", "_enable_custom_resources",
"_enable_thread_annotations", "_enable_thread_annotations",
]) ])
...@@ -1616,10 +1613,6 @@ if (enable_java_templates) { ...@@ -1616,10 +1613,6 @@ if (enable_java_templates) {
if (_enable_bytecode_checks) { if (_enable_bytecode_checks) {
args += [ "--enable-check-class-path" ] args += [ "--enable-check-class-path" ]
} }
if (_enable_class_deps_output) {
args += [ "--enable-class-deps-output" ] +
[ invoker.enable_class_deps_output ]
}
args += [ args += [
"--direct-classpath-jars", "--direct-classpath-jars",
"@FileArg($_rebased_build_config:javac:classpath)", "@FileArg($_rebased_build_config:javac:classpath)",
...@@ -3628,7 +3621,6 @@ if (enable_java_templates) { ...@@ -3628,7 +3621,6 @@ if (enable_java_templates) {
[ [
"enable_bytecode_checks", "enable_bytecode_checks",
"enable_bytecode_rewriter", "enable_bytecode_rewriter",
"enable_class_deps_output",
"jar_excluded_patterns", "jar_excluded_patterns",
"jar_included_patterns", "jar_included_patterns",
]) ])
......
This diff is collapsed.
...@@ -475,23 +475,6 @@ android_library("chrome_java") { ...@@ -475,23 +475,6 @@ android_library("chrome_java") {
"//components/module_installer/android:module_interface_processor", "//components/module_installer/android:module_interface_processor",
] ]
proguard_configs = []
if (async_ar) {
proguard_configs += [ "//chrome/android/features/ar/proguard_async.flags" ]
}
if (async_vr) {
proguard_configs += [
"//chrome/android/features/vr/proguard_async.flags",
"//chrome/android/features/vr/proguard_async_manual.flags",
]
}
if (async_tab_ui) {
proguard_configs += [
"//chrome/android/features/tab_ui/proguard_async.flags",
"//chrome/android/features/tab_ui/proguard_async_manual.flags",
]
}
processor_args_javac = [ "dagger.fastInit=enabled" ] processor_args_javac = [ "dagger.fastInit=enabled" ]
} }
......
...@@ -19,5 +19,4 @@ ar_module_desc = { ...@@ -19,5 +19,4 @@ ar_module_desc = {
android_manifest = "//chrome/android/features/ar/AndroidManifest.xml" android_manifest = "//chrome/android/features/ar/AndroidManifest.xml"
loadable_modules_32_bit = [ "$_libarcore_dir/armeabi-v7a/libarcore_sdk_c.so" ] loadable_modules_32_bit = [ "$_libarcore_dir/armeabi-v7a/libarcore_sdk_c.so" ]
loadable_modules_64_bit = [ "$_libarcore_dir/arm64-v8a/libarcore_sdk_c.so" ] loadable_modules_64_bit = [ "$_libarcore_dir/arm64-v8a/libarcore_sdk_c.so" ]
proguard_async = async_ar
} }
# Explicitly keep the ArCoreShim interface. Because ArCoreShim
# is in base, and its implementing class ArCoreShimImpl is in AR,
# asynchronous proguarding of AR will cause ArCoreShim to be removed
# during synchronous proguarding, which causes AR on Chrome to crash.
-keep interface org.chromium.chrome.browser.vr.ArCoreShim {
*;
}
\ No newline at end of file
...@@ -175,8 +175,4 @@ android_library("java") { ...@@ -175,8 +175,4 @@ android_library("java") {
"//third_party/android_deps:com_android_support_support_v13_java", "//third_party/android_deps:com_android_support_support_v13_java",
"//ui/android:ui_java", "//ui/android:ui_java",
] ]
if (async_tab_ui) {
proguard_configs = [ "//base/android/proguard/chromium_code.flags" ]
}
} }
...@@ -5,7 +5,4 @@ ...@@ -5,7 +5,4 @@
declare_args() { declare_args() {
# Controls the feature being a DFM or not. # Controls the feature being a DFM or not.
disable_tab_ui_dfm = true disable_tab_ui_dfm = true
# Whether to create tab_ui module as an asynchronous DFM.
async_tab_ui = false
} }
This diff is collapsed.
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Rules added manually due to types
# 1) used and included in XML files (ie. layout),
# 2) dynamically generated by the compiler (ie. lambda), and
# 3) types not currently being included in our constant pool deps.
-keep class android.support.v4.graphics.drawable.RoundedBitmapDrawable { *; }
-keep class org.chromium.ui.widget.RoundedCornerImageView { *; }
-keep class org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager$FullscreenListener$$CC { *; }
-keep class org.chromium.chrome.browser.widget.bottomsheet.BottomSheet$BottomSheetContent$$CC { *; }
-keep class org.chromium.chrome.browser.compositor.layouts.OverviewModeController { *; }
\ No newline at end of file
...@@ -8,5 +8,4 @@ tab_ui_module_desc = { ...@@ -8,5 +8,4 @@ tab_ui_module_desc = {
name = "tab_ui" name = "tab_ui"
java_deps = [ "//chrome/android/features/tab_ui:java" ] java_deps = [ "//chrome/android/features/tab_ui:java" ]
android_manifest = "//chrome/android/features/tab_ui/AndroidManifest.xml" android_manifest = "//chrome/android/features/tab_ui/AndroidManifest.xml"
proguard_async = async_tab_ui
} }
...@@ -134,9 +134,6 @@ android_library("java") { ...@@ -134,9 +134,6 @@ android_library("java") {
"//ui/android:ui_utils_java", "//ui/android:ui_utils_java",
] ]
if (async_vr) {
proguard_configs = [ "//base/android/proguard/chromium_code.flags" ]
}
annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ] annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ]
} }
......
This diff is collapsed.
...@@ -11,7 +11,6 @@ vr_module_desc = { ...@@ -11,7 +11,6 @@ vr_module_desc = {
name = "vr" name = "vr"
java_deps = [ "//chrome/android/features/vr:java" ] java_deps = [ "//chrome/android/features/vr:java" ]
android_manifest = "//chrome/android/features/vr/java/AndroidManifest.xml" android_manifest = "//chrome/android/features/vr/java/AndroidManifest.xml"
proguard_async = async_vr
if (use_native_partitions) { if (use_native_partitions) {
native_deps = [ "//chrome/browser/vr:vr_ui" ] native_deps = [ "//chrome/browser/vr:vr_ui" ]
native_entrypoints = "//chrome/browser/vr/module_exports.lst" native_entrypoints = "//chrome/browser/vr/module_exports.lst"
......
...@@ -45,10 +45,6 @@ template("chrome_feature_module") { ...@@ -45,10 +45,6 @@ template("chrome_feature_module") {
deps += _module_desc.java_deps deps += _module_desc.java_deps
} }
if (defined(_module_desc.proguard_async) && _module_desc.proguard_async) {
enable_class_deps_output = "${_module_desc.name}_constant_pool_deps.txt"
}
# Don't embed more translations than required (http://crbug.com/932017). # Don't embed more translations than required (http://crbug.com/932017).
aapt_locale_whitelist = locales aapt_locale_whitelist = locales
......
...@@ -28,7 +28,6 @@ if (enable_arcore) { ...@@ -28,7 +28,6 @@ if (enable_arcore) {
# native_deps: (Optional) Native code going into module. # native_deps: (Optional) Native code going into module.
# native_entrypoints: (Optional) File with list of exposed symbols from native # native_entrypoints: (Optional) File with list of exposed symbols from native
# feature module library. # feature module library.
# proguard_async: (Optional) Whether to proguard the module asynchronously.
# loadable_modules_32_bit: (Optional) List of additional 32-bit shared # loadable_modules_32_bit: (Optional) List of additional 32-bit shared
# library files going into module if the module is executed in 32 bit. # library files going into module if the module is executed in 32 bit.
# loadable_modules_64_bit: (Optional) List of additional 64-bit shared # loadable_modules_64_bit: (Optional) List of additional 64-bit shared
......
...@@ -207,14 +207,6 @@ android_library("ar_java") { ...@@ -207,14 +207,6 @@ android_library("ar_java") {
] ]
java_files = [ "//chrome/android/java/src/org/chromium/chrome/browser/vr/ArCoreShimImpl.java" ] java_files = [ "//chrome/android/java/src/org/chromium/chrome/browser/vr/ArCoreShimImpl.java" ]
# TODO(crbug.com/938909): chromium_code.flags is not used as a proguard
# config when proguarding asynchronously. This results in AR crashing
# chrome when AR is an async DFM. Should implement a more scalable
# solution to including chromium_code.flags with all async DFMs.
if (async_ar) {
proguard_configs = [ "//base/android/proguard/chromium_code.flags" ]
}
} }
if (enable_arcore) { if (enable_arcore) {
......
...@@ -47,10 +47,4 @@ declare_args() { ...@@ -47,10 +47,4 @@ declare_args() {
# TODO(crbug.com/843374): AR should not depend on |enable_vr|. # TODO(crbug.com/843374): AR should not depend on |enable_vr|.
enable_arcore = enable_vr && is_android && !is_chromecast && enable_arcore = enable_vr && is_android && !is_chromecast &&
(current_cpu == "arm" || current_cpu == "arm64") (current_cpu == "arm" || current_cpu == "arm64")
# Whether to create AR module as an asynchronous DFM.
async_ar = false
# Whether to create VR module as an asynchronous DFM.
async_vr = false
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment