Tabnine Logo
ResXmlPatcher.removeManifestVersions
Code IndexAdd Tabnine to your IDE (free)

How to use
removeManifestVersions
method
in
brut.androlib.res.xml.ResXmlPatcher

Best Java code snippets using brut.androlib.res.xml.ResXmlPatcher.removeManifestVersions (Showing top 1 results out of 315)

origin: iBotPeaches/Apktool

public void decodeManifestWithResources(ResTable resTable, ExtFile apkFile, File outDir)
    throws AndrolibException {
  Duo<ResFileDecoder, AXmlResourceParser> duo = getResFileDecoder();
  ResFileDecoder fileDecoder = duo.m1;
  ResAttrDecoder attrDecoder = duo.m2.getAttrDecoder();
  attrDecoder.setCurrentPackage(resTable.listMainPackages().iterator().next());
  Directory inApk, in = null, out;
  try {
    inApk = apkFile.getDirectory();
    out = new FileDirectory(outDir);
    LOGGER.info("Decoding AndroidManifest.xml with resources...");
    fileDecoder.decodeManifest(inApk, "AndroidManifest.xml", out, "AndroidManifest.xml");
    // Remove versionName / versionCode (aapt API 16)
    if (!resTable.getAnalysisMode()) {
      // check for a mismatch between resources.arsc package and the package listed in AndroidManifest
      // also remove the android::versionCode / versionName from manifest for rebuild
      // this is a required change to prevent aapt warning about conflicting versions
      // it will be passed as a parameter to aapt like "--min-sdk-version" via apktool.yml
      adjustPackageManifest(resTable, outDir.getAbsolutePath() + File.separator + "AndroidManifest.xml");
      ResXmlPatcher.removeManifestVersions(new File(
          outDir.getAbsolutePath() + File.separator + "AndroidManifest.xml"));
      mPackageId = String.valueOf(resTable.getPackageId());
    }
  } catch (DirectoryException ex) {
    throw new AndrolibException(ex);
  }
}
brut.androlib.res.xmlResXmlPatcherremoveManifestVersions

Javadoc

Removes attributes like "versionCode" and "versionName" from file.

Popular methods of ResXmlPatcher

  • pullValueFromStrings
    Finds key in strings.xml file and returns text value
  • fixingPublicAttrsInProviderAttributes
    Any @string reference in a value in AndroidManifest.xml will break on build, thus preventing the app
  • isSaved
    Checks if the replacement was properly made to a node.
  • loadDocument
  • removeApplicationDebugTag
    Removes "debug" tag from file
  • renameManifestPackage
    Replaces package value with passed packageOriginal string
  • saveDocument

Popular in Java

  • Making http post requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • onRequestPermissionsResult (Fragment)
  • startActivity (Activity)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • String (java.lang)
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • JComboBox (javax.swing)
  • Top plugins for Android Studio
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