congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ResXmlEncoders
Code IndexAdd Tabnine to your IDE (free)

How to use
ResXmlEncoders
in
brut.androlib.res.xml

Best Java code snippets using brut.androlib.res.xml.ResXmlEncoders (Showing top 13 results out of 315)

origin: iBotPeaches/Apktool

@Override
public String encodeAsResXmlItemValue() {
  return ResXmlEncoders.enumerateNonPositionalSubstitutionsIfRequired(ResXmlEncoders.encodeAsXmlValue(mRawValue));
}
origin: iBotPeaches/Apktool

public static boolean hasMultipleNonPositionalSubstitutions(String str) {
  Duo<List<Integer>, List<Integer>> tuple = findSubstitutions(str, 4);
  return ! tuple.m1.isEmpty() && tuple.m1.size() + tuple.m2.size() > 1;
}
origin: iBotPeaches/Apktool

public boolean hasMultipleNonPositionalSubstitutions() throws AndrolibException {
  return ResXmlEncoders.hasMultipleNonPositionalSubstitutions(mRawValue);
}
origin: iBotPeaches/Apktool

  builder.append(ResXmlEncoders.escapeXmlChars(val)).append('"');
} else {
  loop = false;
origin: iBotPeaches/Apktool

  continue;
default:
  if (!isPrintableChar(c)) {
    out.append(String.format("\\u%04x", (int) c));
    continue;
origin: iBotPeaches/Apktool

@Override
public String encodeAsResXmlValue() {
  return ResXmlEncoders.encodeAsXmlValue(mRawValue);
}
origin: iBotPeaches/Apktool

@Override
public String encodeAsResXmlAttr() {
  return checkIfStringIsNumeric(ResXmlEncoders.encodeAsResXmlAttr(mRawValue));
}
origin: iBotPeaches/Apktool

@Override
public void serializeToResValuesXml(XmlSerializer serializer,
                  ResResource res) throws IOException, AndrolibException {
  serializer.startTag(null, "plurals");
  serializer.attribute(null, "name", res.getResSpec().getName());
  for (int i = 0; i < mItems.length; i++) {
    ResScalarValue item = mItems[i];
    if (item == null) {
      continue;
    }
    serializer.startTag(null, "item");
    serializer.attribute(null, "quantity", QUANTITY_MAP[i]);
    serializer.text(ResXmlEncoders.enumerateNonPositionalSubstitutionsIfRequired(item.encodeAsResXmlNonEscapedItemValue()));
    serializer.endTag(null, "item");
  }
  serializer.endTag(null, "plurals");
}
origin: iBotPeaches/Apktool

return ResXmlEncoders.escapeXmlChars(raw);
return ResXmlEncoders.escapeXmlChars(raw);
    html.append(ResXmlEncoders.escapeXmlChars(raw.substring(offset, end + 1)));
    offset = end + 1;
  html.append(ResXmlEncoders.escapeXmlChars(raw.substring(offset, start)));
  if (j >= 0 && unclosed.length >= j && unclosed[j]) {
    if (unclosed.length > (j + 1) && unclosed[j + 1] || unclosed.length == 1) {
origin: iBotPeaches/Apktool

if (!isPrintableChar(c)) {
origin: iBotPeaches/Apktool

@Override
public String getAttributeValue(int index) {
  int offset = getAttributeOffset(index);
  int valueType = m_attributes[offset + ATTRIBUTE_IX_VALUE_TYPE];
  int valueData = m_attributes[offset + ATTRIBUTE_IX_VALUE_DATA];
  int valueRaw = m_attributes[offset + ATTRIBUTE_IX_VALUE_STRING];
  if (mAttrDecoder != null) {
    try {
      return mAttrDecoder.decode(
          valueType,
          valueData,
          valueRaw == -1 ? null : ResXmlEncoders.escapeXmlChars(m_strings.getString(valueRaw)),
          getAttributeNameResource(index));
    } catch (AndrolibException ex) {
      setFirstError(ex);
      LOGGER.log(Level.WARNING, String.format("Could not decode attr value, using undecoded value "
              + "instead: ns=%s, name=%s, value=0x%08x",
          getAttributePrefix(index),
          getAttributeName(index),
          valueData), ex);
    }
  }
  return TypedValue.coerceToString(valueType, valueData);
}
origin: iBotPeaches/Apktool

@Override
protected void serializeExtraXmlAttrs(XmlSerializer serializer, ResResource res) throws IOException {
  if (ResXmlEncoders.hasMultipleNonPositionalSubstitutions(mRawValue)) {
    serializer.attribute(null, "formatted", "false");
  }
}
origin: iBotPeaches/Apktool

public static String enumerateNonPositionalSubstitutionsIfRequired(String str) {
  Duo<List<Integer>, List<Integer>> tuple = findSubstitutions(str, 4);
  if (tuple.m1.isEmpty() || tuple.m1.size() + tuple.m2.size() < 2) {
    return str;
  }
  List<Integer> subs = tuple.m1;
  StringBuilder out = new StringBuilder();
  int pos = 0;
  int count = 0;
  for (Integer sub : subs) {
    out.append(str.substring(pos, ++sub)).append(++count).append('$');
    pos = sub;
  }
  out.append(str.substring(pos));
  return out.toString();
}
brut.androlib.res.xmlResXmlEncoders

Most used methods

  • encodeAsResXmlAttr
  • encodeAsXmlValue
  • enumerateNonPositionalSubstitutionsIfRequired
  • escapeXmlChars
  • findSubstitutions
    It returns a tuple of: - a list of offsets of non positional substitutions. non-pos is defined as an
  • hasMultipleNonPositionalSubstitutions
  • isPrintableChar

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (Timer)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • requestLocationUpdates (LocationManager)
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • JCheckBox (javax.swing)
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now