1# Copyright (C) 2017 The Android Open Source Project 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15# Keep 16-keep public class androidx.core.view.accessibility.AccessibilityNodeInfoCompat { 17 public static androidx.core.view.accessibility.AccessibilityNodeInfoCompat obtain(); 18} 19 20# This method is marked @hide in DocumentsProvider but we need to implement it for managed mode. 21-keep public class com.android.documentsui.archives.ArchivesProvider { 22 public android.database.Cursor queryChildDocumentsForManage(java.lang.String, java.lang.String[], java.lang.String); 23} 24 25# To prevent class not found exception in org.brotli.dec.Dictionary 26# TODO(b/373579455): Evaluate if <init> needs to be kept. 27-keep final class org.brotli.dec.DictionaryData { 28 void <init>(); 29} 30 31# keep rule generated after running trace references on the test app against DocumentsUIGoogle.jar 32# TODO(b/339312616): Remove after a more permanent fix is available 33# On modifying or adding new test run the following command to generate new keep rules and replace 34# the once listed below with the newly generated keep rules: 35# java -cp prebuilts/r8/r8.jar com.android.tools.r8.tracereferences.TraceReferences \ 36# --lib out/soong/.intermediates/frameworks/base/framework/android_common/<some_hash>/combined/framework.jar \ 37# --source out/target/product/panther/testcases/DocumentsUIGoogleTests/arm64/DocumentsUIGoogleTests.apk \ 38# --target out/soong/.intermediates/vendor/unbundled_google/packages/DocumentsUIGoogle/DocumentsUIGoogle/android_common/<some_hash>/javac/DocumentsUIGoogle.jar \ 39# --keep-rules \ 40# --output /tmp/keep.txt 41 42-keep class androidx.appcompat.R$id { 43 int search_src_text; 44} 45-keep class com.android.documentsui.R$bool { 46 int feature_notification_channel; 47 int full_bar_search_view; 48 int is_launcher_enabled; 49 int show_search_bar; 50} 51-keep class com.android.documentsui.R$color { 52 int app_background_color; 53 int primary; 54} 55-keep class com.android.documentsui.R$dimen { 56 int grid_item_radius; 57} 58-keep class com.android.documentsui.R$drawable { 59 int ic_briefcase; 60 int ic_cab_cancel; 61 int ic_eject; 62 int ic_menu_copy; 63 int ic_root_download; 64 int ic_sd_storage; 65 int root_list_selector; 66 int work_off; 67} 68-keep class com.android.documentsui.R$id { 69 int action_menu_compress; 70 int action_menu_copy_to; 71 int action_menu_delete; 72 int action_menu_deselect_all; 73 int action_menu_extract_to; 74 int action_menu_inspect; 75 int action_menu_move_to; 76 int action_menu_open_with; 77 int action_menu_rename; 78 int action_menu_select; 79 int action_menu_select_all; 80 int action_menu_share; 81 int action_menu_sort; 82 int action_menu_view_in_owner; 83 int apps_group; 84 int apps_row; 85 int button; 86 int content; 87 int cross_profile; 88 int cross_profile_content; 89 int cross_profile_progress; 90 int dir_menu_browse; 91 int dir_menu_copy_to_clipboard; 92 int dir_menu_create_dir; 93 int dir_menu_cut_to_clipboard; 94 int dir_menu_delete; 95 int dir_menu_deselect_all; 96 int dir_menu_extract_here; 97 int dir_menu_inspect; 98 int dir_menu_open; 99 int dir_menu_open_in_new_window; 100 int dir_menu_open_with; 101 int dir_menu_paste_from_clipboard; 102 int dir_menu_paste_into_folder; 103 int dir_menu_rename; 104 int dir_menu_select_all; 105 int dir_menu_share; 106 int dir_menu_view_in_owner; 107 int drawer_layout; 108 int inspector_details_view; 109 int job_progress_panel_title; 110 int option_menu_create_dir; 111 int option_menu_debug; 112 int option_menu_extract_all; 113 int option_menu_inspect; 114 int option_menu_launcher; 115 int option_menu_new_window; 116 int option_menu_search; 117 int option_menu_select_all; 118 int option_menu_settings; 119 int option_menu_show_hidden_files; 120 int option_menu_sort; 121 int root_menu_eject_root; 122 int root_menu_open_in_new_window; 123 int root_menu_paste_into_folder; 124 int root_menu_settings; 125 int sub_menu_grid; 126 int sub_menu_list; 127 int table_header; 128 int tabs; 129 int tabs_container; 130 int toolbar; 131} 132-keep class com.android.documentsui.R$layout { 133 int apps_row; 134 int directory_header; 135 int files_activity; 136 int fixed_layout; 137 int item_doc_list; 138} 139-keep class com.android.documentsui.R$menu { 140 int dir_context_menu; 141 int file_context_menu; 142 int mixed_context_menu; 143} 144-keep class com.android.documentsui.R$plurals { 145 int copy_error_notification_title; 146 int elements_dragged; 147} 148-keep class com.android.documentsui.R$string { 149 int cant_select_work_files_error_message; 150 int cant_select_work_files_error_title; 151 int copy_notification_title; 152 int copy_preparing; 153 int copy_remaining; 154 int debug_content_uri; 155 int default_root_uri; 156 int directory_items; 157 int empty; 158 int menu_copy; 159 int menu_move; 160 int menu_rename; 161 int menu_select; 162 int menu_select_all; 163 int menu_sort; 164 int menu_view_in_owner; 165 int metadata_address; 166 int metadata_album; 167 int metadata_altitude; 168 int metadata_aperture; 169 int metadata_aperture_format; 170 int metadata_artist; 171 int metadata_camera; 172 int metadata_camera_format; 173 int metadata_composer; 174 int metadata_coordinates; 175 int metadata_coordinates_format; 176 int metadata_date_time; 177 int metadata_dimensions; 178 int metadata_dimensions_format; 179 int metadata_duration; 180 int metadata_focal_format; 181 int metadata_focal_length; 182 int metadata_iso_format; 183 int metadata_iso_speed_ratings; 184 int metadata_shutter_speed; 185 int name_conflict; 186 int no_results; 187 int personal_tab; 188 int preferred_root_package; 189 int quiet_mode_button; 190 int quiet_mode_error_title; 191 int rename_error; 192 int search_bar_hint; 193 int share_via; 194 int sort_dimension_date; 195 int sort_dimension_file_type; 196 int sort_dimension_name; 197 int sort_dimension_size; 198 int sort_direction_ascending; 199 int sort_direction_descending; 200 int trusted_quick_viewer_package; 201 int work_tab; 202} 203-keep class com.android.documentsui.R$style { 204 int DocumentsDefaultTheme; 205 int DocumentsTheme; 206} 207 208# Keep Apache Commons Compress classes 209-keep class org.apache.commons.compress.** { *; } 210 211# This is used in the unit test 212-keep class com.google.android.material.chip.Chip { 213 public android.graphics.drawable.Drawable getChipIcon(); 214}