Skip to content

Commit

Permalink
change icons for flavors
Browse files Browse the repository at this point in the history
  • Loading branch information
quetool committed Aug 9, 2024
1 parent 87fe802 commit adb3171
Show file tree
Hide file tree
Showing 73 changed files with 231 additions and 60 deletions.
8 changes: 8 additions & 0 deletions example/dapp/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,17 @@ android {
internal {
dimension "version"
applicationIdSuffix ".internal"
manifestPlaceholders = [
appIcon: "@mipmap/ic_launcher_internal",
applicationLabel: "FL Dapp (internal)",
]
}
production {
dimension "version"
manifestPlaceholders = [
appIcon: "@mipmap/ic_launcher",
applicationLabel: "FL Dapp",
]
}
}

Expand Down
12 changes: 3 additions & 9 deletions example/dapp/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<package android:name="com.walletconnect.flutterwallet.internal"/>
</queries>
<application
android:label="Web3Dapp Flutter"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
android:label="${applicationLabel}"
android:name="${applicationName}"
android:icon="${appIcon}">
<activity
android:name="com.example.dapp.MainActivity"
android:exported="true"
Expand Down Expand Up @@ -46,12 +46,6 @@
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="wcflutterdapp-internal" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="wcflutterdapp-production" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<vector
android:height="108dp"
android:width="108dp"
android:viewportHeight="108"
android:viewportWidth="108"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z"/>
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<vector
android:height="108dp"
android:width="108dp"
android:viewportHeight="108"
android:viewportWidth="108"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z"/>
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_internal_background"/>
<foreground android:drawable="@mipmap/ic_launcher_internal_foreground"/>
</adaptive-icon>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_internal_background"/>
<foreground android:drawable="@mipmap/ic_launcher_internal_foreground"/>
</adaptive-icon>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
10 changes: 0 additions & 10 deletions example/dapp/ios/Runner/Info-internal.plist
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,6 @@
<string>wcflutterdapp-internal</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>com.walletconnect.flutterdapp.internal</string>
<key>CFBundleURLSchemes</key>
<array>
<string>wcflutterdapp</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>2</string>
Expand Down
4 changes: 2 additions & 2 deletions example/dapp/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<string>com.walletconnect.flutterdapp</string>
<key>CFBundleURLSchemes</key>
<array>
<string>wcflutterdapp-production</string>
<string>wcflutterdapp</string>
</array>
</dict>
</array>
Expand All @@ -43,7 +43,7 @@
<string></string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>wcflutterwallet-production</string>
<string>wcflutterwallet</string>
<string>walletapp</string>
</array>
<key>LSRequiresIPhoneOS</key>
Expand Down
7 changes: 4 additions & 3 deletions example/dapp/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,21 @@ class _MyHomePageState extends State<MyHomePage> {
}

Future<void> initialize() async {
const flavor = String.fromEnvironment('FLUTTER_APP_FLAVOR');
String flavor = '-${const String.fromEnvironment('FLUTTER_APP_FLAVOR')}';
flavor = flavor.replaceAll('-production', '');
_web3App = Web3App(
core: Core(
projectId: DartDefines.projectId,
),
metadata: const PairingMetadata(
metadata: PairingMetadata(
name: 'Sample dApp Flutter',
description: 'WalletConnect\'s sample dapp with Flutter',
url: 'https://walletconnect.com/',
icons: [
'https://images.prismic.io/wallet-connect/65785a56531ac2845a260732_WalletConnect-App-Logo-1024X1024.png'
],
redirect: Redirect(
native: 'wcflutterdapp-$flavor://',
native: 'wcflutterdapp$flavor://',
// universal: 'https://walletconnect.com',
),
),
Expand Down
17 changes: 10 additions & 7 deletions example/dapp/lib/pages/connect_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,9 @@ class ConnectPageState extends State<ConnectPage> {
);

final encodedUri = Uri.encodeComponent(connectResponse.uri.toString());
const flavor = String.fromEnvironment('FLUTTER_APP_FLAVOR');
final uri = 'wcflutterwallet-$flavor://wc?uri=$encodedUri';
String flavor = '-${const String.fromEnvironment('FLUTTER_APP_FLAVOR')}';
flavor = flavor.replaceAll('-production', '');
final uri = 'wcflutterwallet$flavor://wc?uri=$encodedUri';
if (await canLaunchUrlString(uri)) {
final openApp = await showDialog(
// ignore: use_build_context_synchronously
Expand Down Expand Up @@ -473,9 +474,10 @@ class ConnectPageState extends State<ConnectPage> {
);

final scheme = event?.session.peer.metadata.redirect?.native;
const flavor = String.fromEnvironment('FLUTTER_APP_FLAVOR');
String flavor = '-${const String.fromEnvironment('FLUTTER_APP_FLAVOR')}';
flavor = flavor.replaceAll('-production', '');
launchUrlString(
scheme ?? 'wcflutterwallet-$flavor://',
scheme ?? 'wcflutterwallet$flavor://',
mode: LaunchMode.externalApplication,
);

Expand All @@ -499,11 +501,12 @@ class ConnectPageState extends State<ConnectPage> {
}) async {
final methods1 = requiredNamespaces['eip155']?.methods ?? [];
final methods2 = optionalNamespaces['eip155']?.methods ?? [];
const flavor = String.fromEnvironment('FLUTTER_APP_FLAVOR');
String flavor = '-${const String.fromEnvironment('FLUTTER_APP_FLAVOR')}';
flavor = flavor.replaceAll('-production', '');
final authResponse = await widget.web3App.authenticate(
params: SessionAuthRequestParams(
chains: _selectedChains.map((e) => e.chainId).toList(),
domain: 'wcflutterdapp-$flavor://',
domain: 'wcflutterdapp$flavor://',
nonce: AuthUtils.generateNonce(),
uri: Constants.aud,
statement: 'Welcome to example flutter app',
Expand All @@ -512,7 +515,7 @@ class ConnectPageState extends State<ConnectPage> {
);

final encodedUri = Uri.encodeComponent(authResponse.uri.toString());
final uri = 'wcflutterwallet-$flavor://wc?uri=$encodedUri';
final uri = 'wcflutterwallet$flavor://wc?uri=$encodedUri';

if (await canLaunchUrlString(uri)) {
final openApp = await showDialog(
Expand Down
8 changes: 8 additions & 0 deletions example/wallet/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,17 @@ android {
internal {
dimension "version"
applicationIdSuffix ".internal"
manifestPlaceholders = [
appIcon: "@mipmap/ic_launcher_internal",
applicationLabel: "FL Wallet (internal)",
]
}
production {
dimension "version"
manifestPlaceholders = [
appIcon: "@mipmap/ic_launcher",
applicationLabel: "FL Wallet",
]
}
}

Expand Down
10 changes: 2 additions & 8 deletions example/wallet/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:label="Web3Wallet Flutter"
android:label="${applicationLabel}"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
android:icon="${appIcon}">
<activity
android:name="com.walletconnect.flutterwallet.MainActivity"
android:exported="true"
Expand Down Expand Up @@ -44,12 +44,6 @@
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="wcflutterwallet-internal" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="wcflutterwallet-production" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_internal_background"/>
<foreground android:drawable="@mipmap/ic_launcher_internal_foreground"/>
</adaptive-icon>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_internal_background"/>
<foreground android:drawable="@mipmap/ic_launcher_internal_foreground"/>
</adaptive-icon>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_internal_background">#F5EDFF</color>
</resources>
Loading

0 comments on commit adb3171

Please sign in to comment.