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

Commit b2bf85b4 authored by Adam Lesinski's avatar Adam Lesinski Committed by Android (Google) Code Review
Browse files

Merge "AAPT2: Allow <key-sets> tags in AndroidManifest.xml"

parents ad60b375 87f1e0fd
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -309,6 +309,9 @@ bool ManifestFixer::BuildRules(xml::XmlActionExecutor* executor,
  manifest_action["meta-data"] = meta_data_action;
  manifest_action["uses-split"].Action(RequiredNameIsJavaPackage);

  manifest_action["key-sets"]["key-set"]["public-key"];
  manifest_action["key-sets"]["upgrade-key-set"];

  // Application actions.
  xml::XmlNodeAction& application_action = manifest_action["application"];
  application_action.Action(OptionalNameIsJavaClassName);
+20 −1
Original line number Diff line number Diff line
@@ -18,7 +18,8 @@

#include "test/Test.h"

using android::StringPiece;
using ::android::StringPiece;
using ::testing::NotNull;

namespace aapt {

@@ -420,4 +421,22 @@ TEST_F(ManifestFixerTest, DoNotIgnoreNonNamespacedElements) {
  EXPECT_EQ(nullptr, Verify(input));
}

TEST_F(ManifestFixerTest, SupportKeySets) {
  std::string input = R"(
      <manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="android">
        <key-sets>
          <key-set android:name="old-set">
            <public-key android:name="old-key" android:value="some+old+key" />
          </key-set>
          <key-set android:name="new-set">
            <public-key android:name="new-key" android:value="some+new+key" />
          </key-set>
          <upgrade-key-set android:name="old-set" />
          <upgrade-key-set android:name="new-set" />
        </key-sets>
      </manifest>)";
  EXPECT_THAT(Verify(input), NotNull());
}

}  // namespace aapt
+2 −0
Original line number Diff line number Diff line
@@ -5,6 +5,8 @@
- Fixed issue where enum values were interpreted as integers and range checked. (bug 62358540)
- Fixed issue where ints and floats with trailing whitespace would not be parsed. (bug 62902869)
- Fixed issue where `--custom-package` was not honored when writing Manifest.java. (bug 62826426)
- Add `<key-sets>` and its nested tags to the allowed set of XML tags in AndroidManifest.xml.
  (bug 62839863)

## Version 2.17
### `aapt2 ...`