|
20 | 20 | import com.reandroid.common.ArraySupplier; |
21 | 21 | import com.reandroid.dex.base.UsageMarker; |
22 | 22 | import com.reandroid.dex.common.Modifier; |
| 23 | +import com.reandroid.dex.debug.DebugSequence; |
23 | 24 | import com.reandroid.dex.id.IdItem; |
24 | 25 | import com.reandroid.dex.id.MethodId; |
25 | 26 | import com.reandroid.dex.id.ProtoId; |
@@ -202,6 +203,26 @@ public DebugInfo getDebugInfo() { |
202 | 203 | public DebugInfo getOrCreateDebugInfo() { |
203 | 204 | return getOrCreateCodeItem().getOrCreateDebugInfo(); |
204 | 205 | } |
| 206 | + public DebugSequence getDebugSequence() { |
| 207 | + DebugInfo debugInfo = getDebugInfo(); |
| 208 | + if (debugInfo != null) { |
| 209 | + return debugInfo.getDebugSequence(); |
| 210 | + } |
| 211 | + return null; |
| 212 | + } |
| 213 | + public DebugSequence getOrCreateDebugSequence() { |
| 214 | + return getOrCreateDebugInfo().getDebugSequence(); |
| 215 | + } |
| 216 | + public boolean hasDebugInfo() { |
| 217 | + return getDebugInfo() != null; |
| 218 | + } |
| 219 | + public boolean hasDebugSequence() { |
| 220 | + DebugInfo debugInfo = getDebugInfo(); |
| 221 | + if (debugInfo != null) { |
| 222 | + return debugInfo.hasSequence(); |
| 223 | + } |
| 224 | + return false; |
| 225 | + } |
205 | 226 | public ProtoId getProtoId() { |
206 | 227 | MethodId methodId = getId(); |
207 | 228 | if (methodId != null) { |
@@ -355,6 +376,22 @@ public void editInternal(Block user) { |
355 | 376 | this.edit(); |
356 | 377 | } |
357 | 378 |
|
| 379 | + @Override |
| 380 | + public boolean uses(Key key) { |
| 381 | + Key k = getKey(); |
| 382 | + if (key.equals(k)) { |
| 383 | + return false; |
| 384 | + } |
| 385 | + if (k.uses(key)) { |
| 386 | + return true; |
| 387 | + } |
| 388 | + CodeItem codeItem = getCodeItem(); |
| 389 | + if (codeItem != null && codeItem.uses(key)) { |
| 390 | + return true; |
| 391 | + } |
| 392 | + return false; |
| 393 | + } |
| 394 | + |
358 | 395 | @Override |
359 | 396 | public Iterator<IdItem> usedIds() { |
360 | 397 | Iterator<IdItem> iterator; |
@@ -395,7 +432,7 @@ public void fromSmali(Smali smali) { |
395 | 432 | MethodKey methodKey = smaliMethod.getKey(); |
396 | 433 | throw new RuntimeException("Parameter out of range, class = " + |
397 | 434 | methodKey.getDeclaring() + ", method = " + methodKey.getName() + |
398 | | - methodKey.getProto() + "\n" + smaliMethodParameter); |
| 435 | + methodKey.getType() + "\n" + smaliMethodParameter); |
399 | 436 | } |
400 | 437 | MethodParameterDef parameter = getParameter(index); |
401 | 438 | parameter.fromSmali(smaliMethodParameter, false); |
|
0 commit comments