use of com.taobao.android.dex.EncodedValueReader in project atlas by alibaba.
the class Grep method grep.
/**
* Prints usages to out. Returns the number of matches found.
*/
public int grep() {
for (ClassDef classDef : dex.classDefs()) {
currentClass = classDef;
currentMethod = null;
if (classDef.getClassDataOffset() == 0) {
continue;
}
ClassData classData = dex.readClassData(classDef);
// find the strings in encoded constants
int staticValuesOffset = classDef.getStaticValuesOffset();
if (staticValuesOffset != 0) {
readArray(new EncodedValueReader(dex.open(staticValuesOffset)));
}
// find the strings in method bodies
for (ClassData.Method method : classData.allMethods()) {
currentMethod = method;
if (method.getCodeOffset() != 0) {
codeReader.visitAll(dex.readCode(method).getInstructions());
}
}
}
currentClass = null;
currentMethod = null;
return count;
}
use of com.taobao.android.dex.EncodedValueReader in project atlas by alibaba.
the class IndexMap method adjustEncodedArray.
public EncodedValue adjustEncodedArray(EncodedValue encodedArray) {
ByteArrayAnnotatedOutput out = new ByteArrayAnnotatedOutput(32);
new EncodedValueTransformer(out).transformArray(new EncodedValueReader(encodedArray, ENCODED_ARRAY));
return new EncodedValue(out.toByteArray());
}
use of com.taobao.android.dex.EncodedValueReader in project atlas by alibaba.
the class IndexMap method adjustEncodedValue.
public EncodedValue adjustEncodedValue(EncodedValue encodedValue) {
ByteArrayAnnotatedOutput out = new ByteArrayAnnotatedOutput(32);
new EncodedValueTransformer(out).transform(new EncodedValueReader(encodedValue));
return new EncodedValue(out.toByteArray());
}
Aggregations