Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 439ac26e authored by Liz Kammer's avatar Liz Kammer Committed by Gerrit Code Review
Browse files

Merge "Add --rename-resources-package to aapt2"

parents 7a2b6a8a 940ae504
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1659,9 +1659,12 @@ class Linker {
      return 1;
    }

    // First extract the Package name without modifying it (via --rename-manifest-package).
    if (Maybe<AppInfo> maybe_app_info =
    // Determine the package name under which to merge resources.
    if (options_.rename_resources_package) {
      context_->SetCompilationPackage(options_.rename_resources_package.value());
    } else if (Maybe<AppInfo> maybe_app_info =
            ExtractAppInfoFromManifest(manifest_xml.get(), context_->GetDiagnostics())) {
      // Extract the package name from the manifest ignoring the value of --rename-manifest-package.
      const AppInfo& app_info = maybe_app_info.value();
      context_->SetCompilationPackage(app_info.package);
    }
+3 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ struct LinkOptions {
  bool output_to_directory = false;
  bool auto_add_overlay = false;
  OutputFormat output_format = OutputFormat::kApk;
  Maybe<std::string> rename_resources_package;

  // Java/Proguard options.
  Maybe<std::string> generate_java_class_path;
@@ -244,6 +245,8 @@ class LinkCommand : public Command {
        &options_.auto_add_overlay);
    AddOptionalFlag("--rename-manifest-package", "Renames the package in AndroidManifest.xml.",
        &options_.manifest_fixer_options.rename_manifest_package);
    AddOptionalFlag("--rename-resources-package", "Renames the package in resources table",
        &options_.rename_resources_package);
    AddOptionalFlag("--rename-instrumentation-target-package",
        "Changes the name of the target package for instrumentation. Most useful\n"
            "when used in conjunction with --rename-manifest-package.",