/** * Returns a human readable package name for this type, like "java.util". * If this is an array type, this returns the package name of the array's * component type. If this is a primitive type, this returns "default". */ public String getPackageName() { // descriptor is a string like "[[Ljava/util/String;" String descriptor = getDescriptor().getString(); int lastSlash = descriptor.lastIndexOf('/'); int lastLeftSquare = descriptor.lastIndexOf('['); // -1 unless this is an array if (lastSlash == -1) { return "default"; } else { // +2 to skip the '[' and the 'L' prefix return descriptor.substring(lastLeftSquare + 2, lastSlash).replace('/', '.'); } }
/** * Returns a human readable package name for this type, like "java.util". * If this is an array type, this returns the package name of the array's * component type. If this is a primitive type, this returns "default". */ public String getPackageName() { // descriptor is a string like "[[Ljava/util/String;" String descriptor = getDescriptor().getString(); int lastSlash = descriptor.lastIndexOf('/'); int lastLeftSquare = descriptor.lastIndexOf('['); // -1 unless this is an array if (lastSlash == -1) { return "default"; } else { // +2 to skip the '[' and the 'L' prefix return descriptor.substring(lastLeftSquare + 2, lastSlash).replace('/', '.'); } } }
/** * Returns a human readable package name for this type, like "java.util". * If this is an array type, this returns the package name of the array's * component type. If this is a primitive type, this returns "default". */ public String getPackageName() { // descriptor is a string like "[[Ljava/util/String;" String descriptor = getDescriptor().getString(); int lastSlash = descriptor.lastIndexOf('/'); int lastLeftSquare = descriptor.lastIndexOf('['); // -1 unless this is an array if (lastSlash == -1) { return "default"; } else { // +2 to skip the '[' and the 'L' prefix return descriptor.substring(lastLeftSquare + 2, lastSlash).replace('/', '.'); } }
/** * Returns a human readable package name for this type, like "java.util". * If this is an array type, this returns the package name of the array's * component type. If this is a primitive type, this returns "default". */ public String getPackageName() { // descriptor is a string like "[[Ljava/util/String;" String descriptor = getDescriptor().getString(); int lastSlash = descriptor.lastIndexOf('/'); int lastLeftSquare = descriptor.lastIndexOf('['); // -1 unless this is an array if (lastSlash == -1) { return "default"; } else { // +2 to skip the '[' and the 'L' prefix return descriptor.substring(lastLeftSquare + 2, lastSlash).replace('/', '.'); } } }
/** {@inheritDoc} */ @Override public void addContents(DexFile file) { file.getStringIds().intern(getDefiningClass().getDescriptor()); }
/** {@inheritDoc} */ @Override public void addContents(DexFile file) { file.getStringIds().intern(getDefiningClass().getDescriptor()); }
/** {@inheritDoc} */ @Override public void addContents(DexFile file) { file.getStringIds().intern(getDefiningClass().getDescriptor()); }
/** {@inheritDoc} */ @Override public void addContents(DexFile file) { file.getStringIds().intern(getDefiningClass().getDescriptor()); }
/** {@inheritDoc} */ @Override public void addContents(DexFile file) { file.getStringIds().intern(getDefiningClass().getDescriptor()); }
/** {@inheritDoc} */ @Override public void addContents(DexFile file) { file.getStringIds().intern(getDefiningClass().getDescriptor()); }
/** {@inheritDoc} */ @Override public void addContents(DexFile file) { file.getStringIds().intern(getDefiningClass().getDescriptor()); }
/** {@inheritDoc} */ @Override public void addContents(DexFile file) { file.getStringIds().intern(getDefiningClass().getDescriptor()); }
/** {@inheritDoc} */ @Override public void writeTo(DexFile file, AnnotatedOutput out) { CstType type = getDefiningClass(); CstString descriptor = type.getDescriptor(); int idx = file.getStringIds().indexOf(descriptor); if (out.annotates()) { out.annotate(0, indexString() + ' ' + descriptor.toHuman()); out.annotate(4, " descriptor_idx: " + Hex.u4(idx)); } out.writeInt(idx); } }
/** {@inheritDoc} */ @Override public void writeTo(DexFile file, AnnotatedOutput out) { CstType type = getDefiningClass(); CstString descriptor = type.getDescriptor(); int idx = file.getStringIds().indexOf(descriptor); if (out.annotates()) { out.annotate(0, indexString() + ' ' + descriptor.toHuman()); out.annotate(4, " descriptor_idx: " + Hex.u4(idx)); } out.writeInt(idx); } }
/** {@inheritDoc} */ @Override public void writeTo(DexFile file, AnnotatedOutput out) { CstType type = getDefiningClass(); CstString descriptor = type.getDescriptor(); int idx = file.getStringIds().indexOf(descriptor); if (out.annotates()) { out.annotate(0, indexString() + ' ' + descriptor.toHuman()); out.annotate(4, " descriptor_idx: " + Hex.u4(idx)); } out.writeInt(idx); } }
/** {@inheritDoc} */ @Override public void writeTo(DexFile file, AnnotatedOutput out) { CstType type = getDefiningClass(); CstString descriptor = type.getDescriptor(); int idx = file.getStringIds().indexOf(descriptor); if (out.annotates()) { out.annotate(0, indexString() + ' ' + descriptor.toHuman()); out.annotate(4, " descriptor_idx: " + Hex.u4(idx)); } out.writeInt(idx); } }
/** {@inheritDoc} */ @Override public void writeTo(DexFile file, AnnotatedOutput out) { CstType type = getDefiningClass(); CstString descriptor = type.getDescriptor(); int idx = file.getStringIds().indexOf(descriptor); if (out.annotates()) { out.annotate(0, indexString() + ' ' + descriptor.toHuman()); out.annotate(4, " descriptor_idx: " + Hex.u4(idx)); } out.writeInt(idx); } }
/** {@inheritDoc} */ @Override public void writeTo(DexFile file, AnnotatedOutput out) { CstType type = getDefiningClass(); CstUtf8 descriptor = type.getDescriptor(); int idx = file.getStringIds().indexOf(descriptor); if (out.annotates()) { out.annotate(0, indexString() + ' ' + descriptor.toHuman()); out.annotate(4, " descriptor_idx: " + Hex.u4(idx)); } out.writeInt(idx); } }
/** {@inheritDoc} */ @Override public void writeTo(DexFile file, AnnotatedOutput out) { CstType type = getDefiningClass(); CstString descriptor = type.getDescriptor(); int idx = file.getStringIds().indexOf(descriptor); if (out.annotates()) { out.annotate(0, indexString() + ' ' + descriptor.toHuman()); out.annotate(4, " descriptor_idx: " + Hex.u4(idx)); } out.writeInt(idx); } }
/** {@inheritDoc} */ @Override public void writeTo(DexFile file, AnnotatedOutput out) { CstType type = getDefiningClass(); CstString descriptor = type.getDescriptor(); int idx = file.getStringIds().indexOf(descriptor); if (out.annotates()) { out.annotate(0, indexString() + ' ' + descriptor.toHuman()); out.annotate(4, " descriptor_idx: " + Hex.u4(idx)); } out.writeInt(idx); } }