File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
src/main/java/com/reandroid/dex/sections Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 2222import com .reandroid .dex .common .SectionItem ;
2323import com .reandroid .dex .header .DexHeader ;
2424import com .reandroid .dex .header .DexVersion ;
25+ import com .reandroid .utils .collection .ArrayUtil ;
2526import com .reandroid .utils .collection .ComputeIterator ;
2627
2728import java .io .File ;
@@ -157,6 +158,36 @@ private void fixMinimumVersion() {
157158
158159 @ Override
159160 public void refreshFull () {
161+ int [] checkSums = getCheckSums ();
162+ boolean multiContainer = checkSums .length > 1 ;
163+ int repeat = size ();
164+ for (int i = 0 ; i < repeat ; i ++) {
165+ refreshFullLayouts ();
166+ if (multiContainer ) {
167+ int [] changed = getCheckSums ();
168+ if (ArrayUtil .areEqual (checkSums , changed )) {
169+ break ;
170+ }
171+ refresh ();
172+ checkSums = changed ;
173+ changed = getCheckSums ();
174+ if (ArrayUtil .areEqual (checkSums , changed )) {
175+ break ;
176+ }
177+ checkSums = changed ;
178+ }
179+ }
180+ }
181+ private int [] getCheckSums () {
182+ int size = size ();
183+ int [] results = new int [size ];
184+ for (int i = 0 ; i < size ; i ++) {
185+ DexLayoutBlock layoutBlock = get (i );
186+ results [i ] = layoutBlock .getHeader ().checksum .getValue ();
187+ }
188+ return results ;
189+ }
190+ private void refreshFullLayouts () {
160191 clearUnused ();
161192 clearEmptyLayouts ();
162193 for (DexLayoutBlock layoutBlock : this ) {
You can’t perform that action at this time.
0 commit comments