| | | |
Offset 1, 243 lines modified | Offset 1, 360 lines modified |
| |
1 | package·com.android.textclassifier; | 1 | package·com.android.textclassifier; |
| |
2 | import·java.util.Collection; | |
3 | import·java.io.IOException; | 2 | import·java.io.IOException; |
4 | import·com.google.common.collect.ImmutableList$Builder; | |
5 | import·java.util.Iterator; | |
6 | import·java.io.FileNotFoundException; | |
7 | import·java.util.List; | |
8 | import·com.google.common.base.Splitter; | |
9 | import·java.util.Locale; | |
10 | import·java.util.ArrayList; | |
11 | import·com.android.textclassifier.common.base.TcLog; | 3 | import·com.android.textclassifier.common.base.TcLog; |
12 | import·android.os.ParcelFileDescriptor; | 4 | import·android.os.ParcelFileDescriptor; |
| 5 | import·java.util.Collection; |
| 6 | import·java.util.ArrayList; |
13 | import·com.google.common.base.Preconditions; | 7 | import·com.google.common.base.Preconditions; |
14 | import·java.util.function.Function; | 8 | import·java.util.function.Function; |
15 | import·java.util.regex.Pattern; | 9 | import·java.util.regex.Pattern; |
16 | import·com.google.common.collect.ImmutableList; | 10 | import·com.google.common.collect.ImmutableList; |
17 | import·java.io.File; | 11 | import·java.io.File; |
18 | import·com.google.common.collect.ImmutableMap; | |
19 | import·java.util.function.Supplier; | 12 | import·java.util.function.Supplier; |
| |
20 | final·class·ModelFileManager$ModelFileSupplierImpl·implements·Supplier | 13 | public·final·class·ModelFileManager$ModelFileSupplierImpl·implements·Supplier |
21 | { | 14 | { |
22 | ····private·static·final·ImmutableMap·MODEL_FILE_INFO_MAP; | |
23 | ····private·final·File·configUpdaterModelFile; | |
24 | ····private·final·File·downloaderModelDir; | |
25 | ····private·final·File·factoryModelDir; | 15 | ····private·final·File·factoryModelDir; |
26 | ····private·ImmutableList·factoryModels; | 16 | ····private·ImmutableList·factoryModels; |
27 | ····private·final·Object·lock; | 17 | ····private·final·Object·lock; |
28 | ····private·final·Pattern·modelFilenamePattern; | 18 | ····private·final·Pattern·modelFilenamePattern; |
29 | ····private·final·String·modelType; | |
30 | ····private·final·TextClassifierSettings·settings; | |
31 | ····private·final·Function·supportedLocalesSupplier; | 19 | ····private·final·Function·supportedLocalesSupplier; |
| 20 | ····private·final·File·updatedModelFile; |
32 | ····private·final·Function·versionSupplier; | 21 | ····private·final·Function·versionSupplier; |
33 | ···· | 22 | ···· |
34 | ····static·{ | |
35 | ········MODEL_FILE_INFO_MAP·=·ImmutableMap.builder().put((Object)"annotator",·(Object)new·ModelFileManager$ModelFileSupplierImpl$ModelFileInfo("(annotator|textclassifier)\\.(.*)\\.model",·"/data/misc/textclassifier/textclassifier.model",·(Function)-$$Lambda$jJq8RXuVdjYF3lPq-77PEw1NJLM.INSTANCE,·(Function)-$$Lambda$NxwbyZSxofZ4Z5SQhfXmtLQ1nxk.INSTANCE)).put((Object)"lang_id",·(Object)new·ModelFileManager$ModelFileSupplierImpl$ModelFileInfo("lang_id.model",·"/data/misc/textclassifier/lang_id.model",·(Function)-$$Lambda$0biFK4yZBmWN1EO2wtnXskzuEcE.INSTANCE,·(Function)-$$Lambda$ModelFileManager$ModelFileSupplierImpl$fMYSxifD0V8sHsS4KyfvDE-HosE.INSTANCE)).put((Object)"actions_suggestions",·(Object)new·ModelFileManager$ModelFileSupplierImpl$ModelFileInfo("actions_suggestions\\.(.*)\\.model",·"/data/misc/textclassifier/actions_suggestions.model",·(Function)-$$Lambda$9N8WImc0VBjy2oxI_Gk5_Pbye_A.INSTANCE,·(Function)-$$Lambda$XeE_KI7QgMKzF9vYRSoFWAolyuA.INSTANCE)).build(); | |
36 | ····} | |
37 | ···· | |
38 | ····public·ModelFileManager$ModelFileSupplierImpl(final·TextClassifierSettings·textClassifierSettings,·final·String·s,·final·File·file)·{ | |
39 | ········this(textClassifierSettings,·s,·new·File("/etc/textclassifier/"),·((ModelFileManager$ModelFileSupplierImpl$ModelFileInfo)ModelFileManager$ModelFileSupplierImpl.MODEL_FILE_INFO_MAP.get((Object)s)).getModelNameRegex(),·new·File(((ModelFileManager$ModelFileSupplierImpl$ModelFileInfo)ModelFileManager$ModelFileSupplierImpl.MODEL_FILE_INFO_MAP.get((Object)s)).getConfigUpdaterModelPath()),·file,·((ModelFileManager$ModelFileSupplierImpl$ModelFileInfo)ModelFileManager$ModelFileSupplierImpl.MODEL_FILE_INFO_MAP.get((Object)s)).getVersionSupplier(),·((ModelFileManager$ModelFileSupplierImpl$ModelFileInfo)ModelFileManager$ModelFileSupplierImpl.MODEL_FILE_INFO_MAP.get((Object)s)).getSupportedLocalesSupplier()); | |
40 | ····} | |
41 | ···· | |
42 | ····ModelFileManager$ModelFileSupplierImpl(TextClassifierSettings·settings,·String·modelType,·File·factoryModelDir,·final·String·s,·File·configUpdaterModelFile,·File·downloaderModelDir,·Function·versionSupplier,·Function·supportedLocalesSupplier)·{ | 23 | ····public·ModelFileManager$ModelFileSupplierImpl(File·factoryModelDir,·final·String·s,·File·updatedModelFile,·Function·versionSupplier,·Function·supportedLocalesSupplier)·{ |
43 | ········this.lock·=·new·Object(); | 24 | ········this.lock·=·new·Object(); |
44 | ········Preconditions.checkNotNull((Object)settings); | |
45 | ········settings·=·settings; | |
46 | ········this.settings·=·settings; | |
47 | ········Preconditions.checkNotNull((Object)modelType); | 25 | ········Preconditions.checkNotNull((Object)updatedModelFile); |
48 | ········modelType·=·modelType; | |
49 | ········this.modelType·=·modelType; | 26 | ········updatedModelFile·=·updatedModelFile; |
| 27 | ········this.updatedModelFile·=·updatedModelFile; |
50 | ········Preconditions.checkNotNull((Object)factoryModelDir); | 28 | ········Preconditions.checkNotNull((Object)factoryModelDir); |
51 | ········factoryModelDir·=·factoryModelDir; | 29 | ········factoryModelDir·=·factoryModelDir; |
52 | ········this.factoryModelDir·=·factoryModelDir; | 30 | ········this.factoryModelDir·=·factoryModelDir; |
53 | ········Preconditions.checkNotNull((Object)s); | 31 | ········Preconditions.checkNotNull((Object)s); |
54 | ········this.modelFilenamePattern·=·Pattern.compile(s); | 32 | ········this.modelFilenamePattern·=·Pattern.compile(s); |
55 | ········Preconditions.checkNotNull((Object)configUpdaterModelFile); | |
56 | ········configUpdaterModelFile·=·configUpdaterModelFile; | |
57 | ········this.configUpdaterModelFile·=·configUpdaterModelFile; | |
58 | ········Preconditions.checkNotNull((Object)downloaderModelDir); | |
59 | ········downloaderModelDir·=·downloaderModelDir; | |
60 | ········this.downloaderModelDir·=·downloaderModelDir; | |
61 | ········Preconditions.checkNotNull((Object)versionSupplier); | 33 | ········Preconditions.checkNotNull((Object)versionSupplier); |
62 | ········versionSupplier·=·versionSupplier; | 34 | ········versionSupplier·=·versionSupplier; |
63 | ········this.versionSupplier·=·versionSupplier; | 35 | ········this.versionSupplier·=·versionSupplier; |
64 | ········Preconditions.checkNotNull((Object)supportedLocalesSupplier); | 36 | ········Preconditions.checkNotNull((Object)supportedLocalesSupplier); |
65 | ········supportedLocalesSupplier·=·supportedLocalesSupplier; | 37 | ········supportedLocalesSupplier·=·supportedLocalesSupplier; |
66 | ········this.supportedLocalesSupplier·=·supportedLocalesSupplier; | 38 | ········this.supportedLocalesSupplier·=·supportedLocalesSupplier; |
67 | ····} | 39 | ····} |
68 | ···· | 40 | ···· |
69 | ····private·ModelFileManager$ModelFile·createModelFile(final·File·file)·{ | 41 | ····private·ModelFileManager$ModelFile·createModelFile(final·File·p0)·{ |
70 | ········final·String·s·=·"ModelFileManager"; | |
71 | ········final·boolean·exists·=·file.exists(); | |
72 | ········final·ParcelFileDescriptor·parcelFileDescriptor·=·null; | |
73 | ········if·(!exists)·{ | |
74 | ············return·null; | |
75 | ········} | 42 | ········//· |
| 43 | ········//·This·method·could·not·be·decompiled. |
76 | ········final·int·n·=·268435456; | |
77 | ········Label_0396:·{ | |
78 | ············ParcelFileDescriptor·open; | |
79 | ············try·{ | |
80 | ················open·=·ParcelFileDescriptor.open(file,·n); | |
81 | ················if·(open·==·null)·{ | |
82 | ····················maybeCloseAndLogError(open); | |
83 | ····················return·null; | |
84 | ················} | |
85 | ················int·intValue·=·0; | |
86 | ················String·s2·=·null; | |
87 | ················ArrayList<Locale>·list·=·null; | |
88 | ················ModelFileManager$ModelFile·modelFileManager$ModelFile·=·null; | |
89 | ················try·{ | |
90 | ····················final·int·fd·=·open.getFd(); | |
91 | ····················try·{ | |
92 | ························final·Function·versionSupplier·=·this.versionSupplier; | |
93 | ························try·{ | |
94 | ····························final·Integer·apply·=·versionSupplier.apply(fd); | |
95 | ····························try·{ | |
96 | ································final·Integer·n2·=·(Integer)apply; | |
97 | ································try·{ | |
98 | ····································intValue·=·n2; | |
99 | ····································try·{ | |
100 | ········································final·Function·supportedLocalesSupplier·=·this.supportedLocalesSupplier; | |
101 | ········································try·{ | |
102 | ············································s2·=·supportedLocalesSupplier.apply(fd); | |
103 | ············································try·{ | |
104 | ················································Label_0180:·{ | |
105 | ····················································if·(!s2.isEmpty())·{ | |
106 | ························································break·Label_0180; | |
107 | ····················································} | |
108 | ····················································try·{ | |
109 | ························································final·StringBuilder·sb·=·new·StringBuilder(); | |
110 | ························································sb.append("Ignoring·"); | |
111 | ························································sb.append(file.getAbsolutePath()); | |
112 | ························································TcLog.d(s,·sb.toString()); | |
113 | ························································maybeCloseAndLogError(open); | |
114 | ························································return·null; | |
115 | ························································try·{ | |
116 | ····························································list·=·new·ArrayList<Locale>(); | |
117 | ····························································final·Iterable·split·=·Splitter.on(',').split((CharSequence)s2); | |
118 | ····························································try·{ | |
119 | ································································final·Iterator<String>·iterator·=·split.iterator(); | |
120 | ································································try·{ | |
121 | ····································································while·(true)·{ | |
122 | ········································································Label_0269:·{ | |
123 | ············································································if·(!iterator.hasNext())·{ | |
124 | ················································································break·Label_0269; | |
125 | ············································································} | |
126 | ············································································final·String·next·=·iterator.next(); | |
127 | ············································································try·{ | |
128 | ················································································final·String·languageTag·=·(String)next; | |
129 | ················································································try·{ | |
130 | ····················································································list.add(Locale.forLanguageTag(languageTag)); | |
131 | ····················································································continue; | |
132 | ····················································································modelFileManager$ModelFile·=·new(com.android.textclassifier.ModelFileManager$ModelFile.class); | |
133 | ····················································································final·ModelFileManager$ModelFileSupplierImpl·modelFileManager$ModelFileSupplierImpl·=·this; | |
134 | ····················································································final·String·s3·=·modelFileManager$ModelFileSupplierImpl.modelType; | |
135 | ····················································································final·String·s4·=·"*"; | |
136 | ····················································································final·String·s5·=·s4; | |
137 | ····················································································final·String·s6·=·s2; | |
138 | ····················································································final·boolean·b·=·s5.equals(s6); | |
139 | ····················································································final·ModelFileManager$ModelFile·modelFileManager$ModelFile2·=·modelFileManager$ModelFile; | |
140 | ····················································································final·String·s7·=·s3; | |
141 | ····················································································final·File·file2·=·file; | |
142 | ····················································································final·int·n3·=·intValue; | |
143 | ····················································································final·ArrayList<Locale>·list2·=·list; | |
144 | ····················································································final·String·s8·=·s2; | |
145 | ····················································································final·boolean·b2·=·b; | |
146 | ····················································································new·ModelFileManager$ModelFile(s7,·file2,·n3,·(List)list2,·s8,·b2); | |
147 | ····················································································final·ParcelFileDescriptor·parcelFileDescriptor2·=·open; | |
148 | ····················································································maybeCloseAndLogError(parcelFileDescriptor2); | |
149 | ····················································································return·modelFileManager$ModelFile; | |
150 | ················································································} | |
151 | ················································································catch·(FileNotFoundException·ex2)·{} | |
152 | ············································································} | |
153 | ············································································catch·(FileNotFoundException·ex3)·{} | |
154 | ········································································} | |
155 | ····································································} | |
156 | ································································} | |
157 | ································································catch·(FileNotFoundException·ex4)·{} | |
158 | ····························································} | |
159 | ····························································catch·(FileNotFoundException·ex5)·{} | |
160 | ························································} | |
161 | ························································catch·(FileNotFoundException·ex6)·{} | |
162 | ····················································} | |
163 | ····················································catch·(FileNotFoundException·ex7)·{} | |
164 | ················································} | |
165 | ············································} | |
166 | ············································catch·(FileNotFoundException·ex8)·{} | |
167 | ········································} | |
168 | ········································catch·(FileNotFoundException·ex9)·{} | |
169 | ····································} | |
170 | ····································catch·(FileNotFoundException·ex10)·{} | |
171 | ································} | |
172 | ································catch·(FileNotFoundException·ex11)·{} | |
173 | ····························} | |
174 | ····························catch·(FileNotFoundException·ex12)·{} | |
175 | ························} | |
176 | ························catch·(FileNotFoundException·ex13)·{} | |
177 | ····················} | |
178 | ····················catch·(FileNotFoundException·ex14)·{} | |
179 | ················} | |
180 | ················catch·(FileNotFoundException·ex15)·{} | |
181 | ················try·{ | |
182 | ····················final·ModelFileManager$ModelFileSupplierImpl·modelFileManager$ModelFileSupplierImpl·=·this; | |
183 | ····················final·String·s3·=·modelFileManager$ModelFileSupplierImpl.modelType; | |
184 | ····················final·String·s5; | |
185 | ····················final·String·s4·=·s5·=·"*"; | |
186 | ····················final·String·s6·=·s2; | |
187 | ····················final·boolean·b·=·s5.equals(s6); | |
188 | ····················final·ModelFileManager$ModelFile·modelFileManager$ModelFile2·=·modelFileManager$ModelFile; | |
189 | ····················final·String·s7·=·s3; | |
190 | ····················final·File·file2·=·file; | |
191 | ····················final·int·n3·=·intValue; | |
192 | ····················final·ArrayList<Locale>·list2·=·list; | |
193 | ····················final·String·s8·=·s2; | |
194 | ····················final·boolean·b2·=·b; | |
195 | ····················new·ModelFileManager$ModelFile(s7,·file2,·n3,·(List)list2,·s8,·b2); | |
196 | ····················final·ParcelFileDescriptor·parcelFileDescriptor2·=·open; | |
197 | ····················maybeCloseAndLogError(parcelFileDescriptor2); | |
198 | ····················return·modelFileManager$ModelFile; | |
199 | ················} | |
200 | ················catch·(FileNotFoundException·ex16)·{} | |
201 | ············} | |
202 | ············catch·(FileNotFoundException·ex)·{ | |
203 | ················open·=·null; | |
204 | ············} | |
205 | ············finally·{ | |
206 | ················break·Label_0396; | |
207 | ············} | |
208 | ············final·StringBuilder·sb2·=·new·StringBuilder(); | |
209 | ············sb2.append("Failed·to·find·"); | |
210 | ············sb2.append(file.getAbsolutePath()); | |
211 | ············final·FileNotFoundException·ex; | |
212 | ············TcLog.e(s,·sb2.toString(),·(Throwable)ex); | |
213 | ············maybeCloseAndLogError(open); | |
214 | ············return·null; | |
215 | ········} | 44 | ········//· |
216 | ········maybeCloseAndLogError(parcelFileDescriptor); | 45 | ········//·Original·Bytecode: |
| 46 | ········//· |
| 47 | ········//·····2:·astore_2······· |
| 48 | ········//·····3:·aload_1········ |
| 49 | ········//·····4:·invokevirtual···java/io/File.exists:()Z |
| 50 | ········//·····7:·istore_3······· |
| 51 | ········//·····8:·aconst_null···· |
| 52 | ········//·····9:·astore··········4 |
| 53 | ········//····11:·iload_3········ |
| 54 | ········//····12:·ifne············17 |
| 55 | ········//····15:·aconst_null···· |
| 56 | ········//····16:·areturn········ |
| 57 | ········//····17:·ldc·············268435456 |
| 58 | ········//····19:·istore_3······· |
| 59 | ········//····20:·aload_1········ |
| 60 | ········//····21:·iload_3········ |
| 61 | ········//····22:·invokestatic····android/os/ParcelFileDescriptor.open:(Ljava/io/File;I)Landroid/os/ParcelFileDescriptor; |
| 62 | ········//····25:·astore··········5 |
| 63 | ········//····27:·aload···········5 |
| 64 | ········//····29:·ifnonnull·······39 |
| 65 | ········//····32:·aload···········5 |
| 66 | ········//····34:·invokestatic····com/android/textclassifier/ModelFileManager$ModelFileSupplierImpl.maybeCloseAndLogError:(Landroid/os/ParcelFileDescriptor;)V |
| 67 | ········//····37:·aconst_null···· |
| 68 | ········//····38:·areturn········ |
| 69 | ········//····39:·aload···········5 |
| 70 | ········//····41:·invokevirtual···android/os/ParcelFileDescriptor.getFd:()I |
| 71 | ········//····44:·istore··········6 |
| 72 | ········//····46:·aload_0········ |
| 73 | ········//····47:·getfield········com/android/textclassifier/ModelFileManager$ModelFileSupplierImpl.versionSupplier:Ljava/util/function/Function; |
| 74 | ········//····50:·astore··········7 |
| 75 | ········//····52:·iload···········6 |
| 76 | ········//····54:·invokestatic····java/lang/Integer.valueOf:(I)Ljava/lang/Integer; |
| 77 | ········//····57:·astore··········8 |
| 78 | ········//····59:·aload···········7 |
| 79 | ········//····61:·aload···········8 |
| 80 | ········//····63:·invokeinterface·java/util/function/Function.apply:(Ljava/lang/Object;)Ljava/lang/Object; |
| 81 | ········//····68:·astore··········7 |
| 82 | ········//····70:·aload···········7 |
| 83 | ········//····72:·checkcast·······Ljava/lang/Integer; |
| 84 | ········//····75:·astore··········7 |
| 85 | ········//····77:·aload···········7 |
| 86 | ········//····79:·invokevirtual···java/lang/Integer.intValue:()I |
| 87 | ········//····82:·istore··········9 |
| 88 | ········//····84:·aload_0········ |
| 89 | ········//····85:·getfield········com/android/textclassifier/ModelFileManager$ModelFileSupplierImpl.supportedLocalesSupplier:Ljava/util/function/Function; |
| 90 | ········//····88:·astore_0······· |
| 91 | ········//····89:·iload···········6 |
| 92 | ········//····91:·invokestatic····java/lang/Integer.valueOf:(I)Ljava/lang/Integer; |
| 93 | ········//····94:·astore··········10 |
| 94 | ········//····96:·aload_0········ |
| 95 | ········//····97:·aload···········10 |
| 96 | ········//····99:·invokeinterface·java/util/function/Function.apply:(Ljava/lang/Object;)Ljava/lang/Object; |
| 97 | ········//···104:·astore_0······· |
| 98 | ········//···105:·aload_0········ |
| 99 | ········//···106:·astore··········11 |
| 100 | ········//···108:·aload_0········ |
| 101 | ········//···109:·checkcast·······Ljava/lang/String; |
| 102 | ········//···112:·astore··········11 |
| 103 | ········//···114:·aload···········11 |
| 104 | ········//···116:·invokevirtual···java/lang/String.isEmpty:()Z |
| 105 | ········//···119:·istore··········12 |
| 106 | ········//···121:·iload···········12 |
| 107 | ········//···123:·ifeq············175 |
| 108 | ········//···126:·new·············Ljava/lang/StringBuilder; |
| 109 | ········//···129:·astore_0······· |
| 110 | ········//···130:·aload_0········ |
| 111 | ········//···131:·invokespecial···java/lang/StringBuilder.<init>:()V |
| 112 | ········//···134:·ldc·············"Ignoring·" |
| 113 | ········//···136:·astore··········10 |
| 114 | ········//···138:·aload_0········ |
| 115 | ········//···139:·aload···········10 |
| 116 | ········//···141:·invokevirtual···java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; |
| 117 | ········//···144:·pop············ |
| 118 | ········//···145:·aload_1········ |
| 119 | ········//···146:·invokevirtual···java/io/File.getAbsolutePath:()Ljava/lang/String; |
| 120 | ········//···149:·astore··········10 |
| 121 | ········//···151:·aload_0········ |
| 122 | ········//···152:·aload···········10 |
| 123 | ········//···154:·invokevirtual···java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; |
| 124 | ········//···157:·pop············ |
| 125 | ········//···158:·aload_0········ |
| 126 | ········//···159:·invokevirtual···java/lang/StringBuilder.toString:()Ljava/lang/String; |
| 127 | ········//···162:·astore_0······· |
| 128 | ········//···163:·aload_2········ |
| 129 | ········//···164:·aload_0········ |
| 130 | ········//···165:·invokestatic····com/android/textclassifier/common/base/TcLog.d:(Ljava/lang/String;Ljava/lang/String;)V |
| 131 | ········//···168:·aload···········5 |
| 132 | ········//···170:·invokestatic····com/android/textclassifier/ModelFileManager$ModelFileSupplierImpl.maybeCloseAndLogError:(Landroid/os/ParcelFileDescriptor;)V |
| 133 | ········//···173:·aconst_null···· |
| 134 | ········//···174:·areturn········ |
| 135 | ········//···175:·new·············Ljava/util/ArrayList; |
| 136 | ········//···178:·astore··········13 |
| 137 | ········//···180:·aload···········13 |
| 138 | ········//···182:·invokespecial···java/util/ArrayList.<init>:()V |
| 139 | ········//···185:·bipush··········44 |
| 140 | ········//···187:·istore··········12 |
| 141 | ········//···189:·iload···········12 |
| 142 | ········//···191:·invokestatic····com/google/common/base/Splitter.on:(C)Lcom/google/common/base/Splitter; |
| 143 | ········//···194:·astore_0······· |
| 144 | ········//···195:·aload_0········ |
| 145 | ········//···196:·aload···········11 |
| 146 | ········//···198:·invokevirtual···com/google/common/base/Splitter.split:(Ljava/lang/CharSequence;)Ljava/lang/Iterable; |
| 147 | ········//···201:·astore_0······· |
| 148 | ········//···202:·aload_0········ |
| 149 | ········//···203:·invokeinterface·java/lang/Iterable.iterator:()Ljava/util/Iterator; |
| 150 | ········//···208:·astore_0······· |
| 151 | ········//···209:·aload_0········ |
| 152 | ········//···210:·invokeinterface·java/util/Iterator.hasNext:()Z |
| 153 | ········//···215:·istore··········6 |
| 154 | ········//···217:·iload···········6 |
| 155 | ········//···219:·ifeq············257 |
| 156 | ········//···222:·aload_0········ |
| 157 | ········//···223:·invokeinterface·java/util/Iterator.next:()Ljava/lang/Object; |
| 158 | ········//···228:·astore··········10 |
| 159 | ········//···230:·aload···········10 |
| 160 | ········//···232:·checkcast·······Ljava/lang/String; |
| 161 | ········//···235:·astore··········10 |
| 162 | ········//···237:·aload···········10 |
| 163 | ········//···239:·invokestatic····java/util/Locale.forLanguageTag:(Ljava/lang/String;)Ljava/util/Locale; |
| 164 | ········//···242:·astore··········10 |
| 165 | ········//···244:·aload···········13 |
| 166 | ········//···246:·aload···········10 |
| 167 | ········//···248:·invokeinterface·java/util/List.add:(Ljava/lang/Object;)Z |
| 168 | ········//···253:·pop············ |
| 169 | ········//···254:·goto············209 |
| 170 | ········//···257:·new·············Lcom/android/textclassifier/ModelFileManager$ModelFile; |
| 171 | ········//···260:·astore_0······· |
| 172 | ········//···261:·ldc·············"*" |
| 173 | ········//···263:·astore··········10 |
| 174 | ········//···265:·aload···········10 |
| 175 | ········//···267:·aload···········11 |
| 176 | ········//···269:·invokevirtual···java/lang/String.equals:(Ljava/lang/Object;)Z |
| 177 | ········//···272:·istore··········14 |
| 178 | ········//···274:·aload_0········ |
| 179 | ········//···275:·astore··········8 |
| 180 | ········//···277:·aload_0········ |
| 181 | ········//···278:·aload_1········ |
| 182 | ········//···279:·iload···········9 |
| 183 | ········//···281:·aload···········13 |
| 184 | ········//···283:·aload···········11 |
| 185 | ········//···285:·iload···········14 |
| 186 | ········//···287:·invokespecial···com/android/textclassifier/ModelFileManager$ModelFile.<init>:(Ljava/io/File;ILjava/util/List;Ljava/lang/String;Z)V |
| 187 | ········//···290:·aload···········5 |
| 188 | ········//···292:·invokestatic····com/android/textclassifier/ModelFileManager$ModelFileSupplierImpl.maybeCloseAndLogError:(Landroid/os/ParcelFileDescriptor;)V |
| 189 | ········//···295:·aload_0········ |
| 190 | ········//···296:·areturn········ |
| 191 | ········//···297:·astore_0······· |
| 192 | ········//···298:·aload···········5 |
| 193 | ········//···300:·astore··········4 |
| 194 | ········//···302:·goto············372 |
| 195 | ········//···305:·astore_0······· |
| 196 | ········//···306:·goto············319 |
| 197 | ········//···309:·astore_0······· |
| 198 | ········//···310:·goto············372 |
| 199 | ········//···313:·astore_0······· |
| 200 | ········//···314:·iconst_0······· |
| 201 | ········//···315:·istore_3······· |
| 202 | ········//···316:·aconst_null···· |
| 203 | ········//···317:·astore··········5 |
| 204 | ········//···319:·new·············Ljava/lang/StringBuilder; |
| 205 | ········//···322:·astore··········10 |
| 206 | ········//···324:·aload···········10 |
| 207 | ········//···326:·invokespecial···java/lang/StringBuilder.<init>:()V |
| 208 | ········//···329:·ldc·············"Failed·to·find·" |
| 209 | ········//···331:·astore··········7 |
| 210 | ········//···333:·aload···········10 |
| 211 | ········//···335:·aload···········7 |
| 212 | ········//···337:·invokevirtual···java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; |
| 213 | ········//···340:·pop············ |
| 214 | ········//···341:·aload_1········ |
| 215 | ········//···342:·invokevirtual···java/io/File.getAbsolutePath:()Ljava/lang/String; |
| 216 | ········//···345:·astore_1······· |
| 217 | ········//···346:·aload···········10 |
| 218 | ········//···348:·aload_1········ |
| 219 | ········//···349:·invokevirtual···java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; |
| 220 | ········//···352:·pop············ |
| 221 | ········//···353:·aload···········10 |
| 222 | ········//···355:·invokevirtual···java/lang/StringBuilder.toString:()Ljava/lang/String; |
| 223 | ········//···358:·astore_1······· |
| 224 | ········//···359:·aload_2········ |
| 225 | ········//···360:·aload_1········ |
| 226 | ········//···361:·aload_0········ |
| 227 | ········//···362:·invokestatic····com/android/textclassifier/common/base/TcLog.e:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V |
| 228 | ········//···365:·aload···········5 |
| 229 | ········//···367:·invokestatic····com/android/textclassifier/ModelFileManager$ModelFileSupplierImpl.maybeCloseAndLogError:(Landroid/os/ParcelFileDescriptor;)V |
| 230 | ········//···370:·aconst_null···· |
| 231 | ········//···371:·areturn········ |
| 232 | ········//···372:·aload···········4 |
| 233 | ········//···374:·invokestatic····com/android/textclassifier/ModelFileManager$ModelFileSupplierImpl.maybeCloseAndLogError:(Landroid/os/ParcelFileDescriptor;)V |
| 234 | ········//···377:·aload_0········ |
| 235 | ········//···378:·athrow········· |
| 236 | ········//····Exceptions: |
| 237 | ········//··Try···········Handler |
| 238 | ········//··Start··End····Start··End····Type··························· |
| 239 | ········//··-----··-----··-----··-----··------------------------------- |
| 240 | ········//··21·····25·····313····319····Ljava/io/FileNotFoundException; |
| 241 | ········//··21·····25·····309····313····Any |
| 242 | ········//··39·····44·····305····309····Ljava/io/FileNotFoundException; |
| 243 | ········//··39·····44·····297····305····Any |
| 244 | ········//··46·····50·····305····309····Ljava/io/FileNotFoundException; |
| 245 | ········//··46·····50·····297····305····Any |
| 246 | ········//··52·····57·····305····309····Ljava/io/FileNotFoundException; |
| 247 | ········//··52·····57·····297····305····Any |
| 248 | ········//··61·····68·····305····309····Ljava/io/FileNotFoundException; |
| 249 | ········//··61·····68·····297····305····Any |
| 250 | ········//··70·····75·····305····309····Ljava/io/FileNotFoundException; |
| 251 | ········//··70·····75·····297····305····Any |
| 252 | ········//··77·····82·····305····309····Ljava/io/FileNotFoundException; |
| 253 | ········//··77·····82·····297····305····Any |
| 254 | ········//··84·····88·····305····309····Ljava/io/FileNotFoundException; |
| 255 | ········//··84·····88·····297····305····Any |
| 256 | ········//··89·····94·····305····309····Ljava/io/FileNotFoundException; |
| 257 | ········//··89·····94·····297····305····Any |
| 258 | ········//··97·····104····305····309····Ljava/io/FileNotFoundException; |
| 259 | ········//··97·····104····297····305····Any |
| 260 | ········//··108····112····305····309····Ljava/io/FileNotFoundException; |
| 261 | ········//··108····112····297····305····Any |
| 262 | ········//··114····119····305····309····Ljava/io/FileNotFoundException; |
| 263 | ········//··114····119····297····305····Any |
| 264 | ········//··126····129····305····309····Ljava/io/FileNotFoundException; |
| 265 | ········//··126····129····297····305····Any |
| 266 | ········//··130····134····305····309····Ljava/io/FileNotFoundException; |
| 267 | ········//··130····134····297····305····Any |
| 268 | ········//··139····145····305····309····Ljava/io/FileNotFoundException; |
| 269 | ········//··139····145····297····305····Any |
| 270 | ········//··145····149····305····309····Ljava/io/FileNotFoundException; |
| 271 | ········//··145····149····297····305····Any |
| 272 | ········//··152····158····305····309····Ljava/io/FileNotFoundException; |
| 273 | ········//··152····158····297····305····Any |
| 274 | ········//··158····162····305····309····Ljava/io/FileNotFoundException; |
| 275 | ········//··158····162····297····305····Any |
| 276 | ········//··164····168····305····309····Ljava/io/FileNotFoundException; |
| 277 | ········//··164····168····297····305····Any |
| 278 | ········//··175····178····305····309····Ljava/io/FileNotFoundException; |
| 279 | ········//··175····178····297····305····Any |
| 280 | ········//··180····185····305····309····Ljava/io/FileNotFoundException; |
| 281 | ········//··180····185····297····305····Any |
| 282 | ········//··189····194····305····309····Ljava/io/FileNotFoundException; |
| 283 | ········//··189····194····297····305····Any |
| 284 | ········//··196····201····305····309····Ljava/io/FileNotFoundException; |
| 285 | ········//··196····201····297····305····Any |
| 286 | ········//··202····208····305····309····Ljava/io/FileNotFoundException; |
| 287 | ········//··202····208····297····305····Any |
| 288 | ········//··209····215····305····309····Ljava/io/FileNotFoundException; |
| 289 | ········//··209····215····297····305····Any |
| 290 | ········//··222····228····305····309····Ljava/io/FileNotFoundException; |
| 291 | ········//··222····228····297····305····Any |
| 292 | ········//··230····235····305····309····Ljava/io/FileNotFoundException; |
| 293 | ········//··230····235····297····305····Any |
| 294 | ········//··237····242····305····309····Ljava/io/FileNotFoundException; |
| 295 | ········//··237····242····297····305····Any |
| 296 | ········//··246····254····305····309····Ljava/io/FileNotFoundException; |
| 297 | ········//··246····254····297····305····Any |
| 298 | ········//··257····260····305····309····Ljava/io/FileNotFoundException; |
| 299 | ········//··257····260····297····305····Any |
| 300 | ········//··267····272····305····309····Ljava/io/FileNotFoundException; |
| 301 | ········//··267····272····297····305····Any |
| 302 | ········//··285····290····305····309····Ljava/io/FileNotFoundException; |
| 303 | ········//··285····290····297····305····Any |
| 304 | ········//··319····322····297····305····Any |
| 305 | ········//··324····329····297····305····Any |
| 306 | ········//··335····341····297····305····Any |
| 307 | ········//··341····345····297····305····Any |
| 308 | ········//··348····353····297····305····Any |
| 309 | ········//··353····358····297····305····Any |
| 310 | ········//··361····365····297····305····Any |
| 311 | ········//· |
| 312 | ········//·The·error·that·occurred·was: |
| 313 | ········//· |
| 314 | ········//·java.lang.IllegalStateException:·Expression·is·linked·from·several·locations:·Label_0257: |
| 315 | ········//·····at·com.strobel.decompiler.ast.Error.expressionLinkedFromMultipleLocations(Error.java:27) |
| 316 | ········//·····at·com.strobel.decompiler.ast.AstOptimizer.mergeDisparateObjectInitializations(AstOptimizer.java:2596) |
| 317 | ········//·····at·com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:235) |
| 318 | ········//·····at·com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:42) |
| 319 | ········//·····at·com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:214) |
| 320 | ········//·····at·com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:99) |
| 321 | ········//·····at·com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:757) |
| 322 | ········//·····at·com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:655) |
| 323 | ········//·····at·com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:532) |
| 324 | ········//·····at·com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:499) |
| 325 | ········//·····at·com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:141) |
| 326 | ········//·····at·com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:130) |
| 327 | ········//·····at·com.strobel.decompiler.languages.java.ast.AstBuilder.addType(AstBuilder.java:105) |
| 328 | ········//·····at·com.strobel.decompiler.languages.java.JavaLanguage.buildAst(JavaLanguage.java:71) |
| 329 | ········//·····at·com.strobel.decompiler.languages.java.JavaLanguage.decompileType(JavaLanguage.java:59) |
| 330 | ········//·····at·com.strobel.decompiler.DecompilerDriver.decompileType(DecompilerDriver.java:336) |
| 331 | ········//·····at·com.strobel.decompiler.DecompilerDriver.main(DecompilerDriver.java:144) |
| 332 | ········//· |
| 333 | ········throw·new·IllegalStateException("An·error·occurred·while·decompiling·this·method."); |
217 | ····} | 334 | ····} |
218 | ···· | 335 | ···· |
219 | ····private·ImmutableList·getMatchedModelFiles(final·File·file)·{ | |
220 | ········final·ImmutableList$Builder·builder·=·ImmutableList.builder(); | |
221 | ········if·(file.exists()·&&·file.isDirectory())·{ | 336 | ····private·ImmutableList·getFactoryModels()·{ |
| 337 | ········final·ArrayList<ModelFileManager$ModelFile>·list·=·new·ArrayList<ModelFileManager$ModelFile>(); |
| 338 | ········if·(this.factoryModelDir.exists()·&&·this.factoryModelDir.isDirectory())·{ |
222 | ············final·File[]·listFiles·=·file.listFiles(); | 339 | ············final·File[]·listFiles·=·this.factoryModelDir.listFiles(); |
223 | ············for·(int·length·=·listFiles.length,·i·=·0;·i·<·length;·++i)·{ | 340 | ············for·(int·length·=·listFiles.length,·i·=·0;·i·<·length;·++i)·{ |
224 | ················final·File·file2·=·listFiles[i]; | 341 | ················final·File·file·=·listFiles[i]; |
225 | ················if·(this.modelFilenamePattern.matcher(file2.getName()).matches()·&&·file2.isFile())·{ | 342 | ················if·(this.modelFilenamePattern.matcher(file.getName()).matches()·&&·file.isFile())·{ |
226 | ····················final·ModelFileManager$ModelFile·modelFile·=·this.createModelFile(file2); | 343 | ····················final·ModelFileManager$ModelFile·modelFile·=·this.createModelFile(file); |
227 | ····················if·(modelFile·!=·null)·{ | 344 | ····················if·(modelFile·!=·null)·{ |
228 | ························builder.add((Object)modelFile); | 345 | ························list.add(modelFile); |
229 | ····················} | 346 | ····················} |
230 | ················} | 347 | ················} |
231 | ············} | 348 | ············} |
232 | ········} | 349 | ········} |
233 | ········return·builder.build(); | 350 | ········return·ImmutableList.copyOf((Collection)list); |
234 | ····} | 351 | ····} |
235 | ···· | 352 | ···· |
236 | ····private·static·void·maybeCloseAndLogError(final·ParcelFileDescriptor·parcelFileDescriptor)·{ | 353 | ····private·static·void·maybeCloseAndLogError(final·ParcelFileDescriptor·parcelFileDescriptor)·{ |
237 | ········if·(parcelFileDescriptor·==·null)·{ | 354 | ········if·(parcelFileDescriptor·==·null)·{ |
238 | ············return; | 355 | ············return; |
239 | ········} | 356 | ········} |
240 | ········try·{ | 357 | ········try·{ |
Offset 246, 26 lines modified | Offset 363, 23 lines modified |
246 | ········catch·(IOException·ex)·{ | 363 | ········catch·(IOException·ex)·{ |
247 | ············TcLog.e("ModelFileManager",·"Error·closing·file.",·(Throwable)ex); | 364 | ············TcLog.e("ModelFileManager",·"Error·closing·file.",·(Throwable)ex); |
248 | ········} | 365 | ········} |
249 | ····} | 366 | ····} |
250 | ···· | 367 | ···· |
251 | ····public·ImmutableList·get()·{ | 368 | ····public·ImmutableList·get()·{ |
252 | ········final·ArrayList<ModelFileManager$ModelFile>·list·=·new·ArrayList<ModelFileManager$ModelFile>(); | 369 | ········final·ArrayList<ModelFileManager$ModelFile>·list·=·new·ArrayList<ModelFileManager$ModelFile>(); |
253 | ········if·(this.downloaderModelDir.exists()·&&·this.settings.isModelDownloadManagerEnabled())·{ | |
254 | ············list.addAll((Collection<?>)this.getMatchedModelFiles(this.downloaderModelDir)); | |
255 | ········} | |
256 | ········if·(this.configUpdaterModelFile.exists())·{ | 370 | ········if·(this.updatedModelFile.exists())·{ |
257 | ············final·ModelFileManager$ModelFile·modelFile·=·this.createModelFile(this.configUpdaterModelFile); | 371 | ············final·ModelFileManager$ModelFile·modelFile·=·this.createModelFile(this.updatedModelFile); |
258 | ············if·(modelFile·!=·null)·{ | 372 | ············if·(modelFile·!=·null)·{ |
259 | ················list.add(modelFile); | 373 | ················list.add(modelFile); |
260 | ············} | 374 | ············} |
261 | ········} | 375 | ········} |
262 | ········synchronized·(this.lock)·{ | 376 | ········synchronized·(this.lock)·{ |
263 | ············if·(this.factoryModels·==·null)·{ | 377 | ············if·(this.factoryModels·==·null)·{ |
264 | ················this.factoryModels·=·this.getMatchedModelFiles(this.factoryModelDir); | 378 | ················this.factoryModels·=·this.getFactoryModels(); |
265 | ············} | 379 | ············} |
266 | ············list.addAll((Collection<?>)this.factoryModels); | 380 | ············list.addAll((Collection<?>)this.factoryModels); |
267 | ············//·monitorexit(this.lock) | 381 | ············//·monitorexit(this.lock) |
268 | ············return·ImmutableList.copyOf((Collection)list); | 382 | ············return·ImmutableList.copyOf((Collection)list); |
269 | ········} | 383 | ········} |
270 | ····} | 384 | ····} |
271 | } | 385 | } |