Skip to content

Commit

Permalink
fix: Granted android.permission.INTERNET when first created.
Browse files Browse the repository at this point in the history
  • Loading branch information
mathrunet committed Jul 31, 2023
1 parent 14ed1b4 commit 3a3cc9a
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/katana_cli/lib/command/create.dart
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,25 @@ class CreateCliCommand extends CliCommand {
"The structure of AndroidManifest.xml is broken.",
);
}
if (!manifest.first.children.any((p0) =>
p0 is XmlElement &&
p0.name.toString() == "uses-permission" &&
p0.attributes.any((p1) =>
p1.name.toString() == "android:name" &&
p1.value == "android.permission.INTERNET"))) {
manifest.first.children.add(
XmlElement(
XmlName("uses-permission"),
[
XmlAttribute(
XmlName("android:name"),
"android.permission.INTERNET",
),
],
[],
),
);
}
final queries = manifest.first.children.firstWhereOrNull(
(p0) => p0 is XmlElement && p0.name.toString() == "queries") ??
() {
Expand Down

0 comments on commit 3a3cc9a

Please sign in to comment.