Skip to content

Commit 3ac65ba

Browse files
committed
WIP - re-gen android files
`$ flutter create --org io.github.x_wei . --platforms=android`
1 parent 97cf801 commit 3ac65ba

File tree

62 files changed

+771
-811
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+771
-811
lines changed

Diff for: .metadata

+24-2
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,27 @@
44
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: c7ea3ca377e909469c68f2ab878a5bc53d3cf66b
8-
channel: beta
7+
revision: "300451adae589accbece3490f4396f10bdf15e6e"
8+
channel: "stable"
9+
10+
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: 300451adae589accbece3490f4396f10bdf15e6e
17+
base_revision: 300451adae589accbece3490f4396f10bdf15e6e
18+
- platform: android
19+
create_revision: 300451adae589accbece3490f4396f10bdf15e6e
20+
base_revision: 300451adae589accbece3490f4396f10bdf15e6e
21+
22+
# User provided section
23+
24+
# List of Local paths (relative to this file) that should be
25+
# ignored by the migrate tool.
26+
#
27+
# Files that are not part of the templates will be ignored by default.
28+
unmanaged_files:
29+
- 'lib/main.dart'
30+
- 'ios/Runner.xcodeproj/project.pbxproj'

Diff for: android/.gitignore

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
*.iml
2-
*.class
3-
.gradle
4-
.project
1+
gradle-wrapper.jar
2+
/.gradle
3+
/captures/
4+
/gradlew
5+
/gradlew.bat
56
/local.properties
6-
/.idea/workspace.xml
7-
/.idea/libraries
8-
.DS_Store
9-
/build
10-
/captures
11-
app/bin
127
GeneratedPluginRegistrant.java
8+
9+
# Remember to never publicly share your keystore.
10+
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11+
key.properties
12+
**/*.keystore
13+
**/*.jks

Diff for: android/app/build.gradle

+24-73
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
id "dev.flutter.flutter-gradle-plugin"
5+
}
6+
17
def localProperties = new Properties()
28
def localPropertiesFile = rootProject.file('local.properties')
39
if (localPropertiesFile.exists()) {
@@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
612
}
713
}
814

9-
def flutterRoot = localProperties.getProperty('flutter.sdk')
10-
if (flutterRoot == null) {
11-
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12-
}
13-
1415
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
1516
if (flutterVersionCode == null) {
1617
flutterVersionCode = '1'
@@ -21,38 +22,33 @@ if (flutterVersionName == null) {
2122
flutterVersionName = '1.0'
2223
}
2324

24-
apply plugin: 'com.android.application'
25-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
26-
apply plugin: 'kotlin-android'
27-
// apply plugin: 'kotlin-android-extensions'
28-
2925
android {
30-
compileSdkVersion 34
31-
buildFeatures {
32-
viewBinding true
26+
namespace "io.github.x_wei.flutter_catalog"
27+
compileSdk flutter.compileSdkVersion
28+
ndkVersion flutter.ndkVersion
29+
30+
compileOptions {
31+
sourceCompatibility JavaVersion.VERSION_1_8
32+
targetCompatibility JavaVersion.VERSION_1_8
3333
}
34-
sourceSets {
35-
main.java.srcDirs += 'src/main/kotlin'
34+
35+
kotlinOptions {
36+
jvmTarget = '1.8'
3637
}
3738

38-
lintOptions {
39-
disable 'InvalidPackage'
39+
sourceSets {
40+
main.java.srcDirs += 'src/main/kotlin'
4041
}
4142

4243
defaultConfig {
44+
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
4345
applicationId "io.github.x_wei.flutter_catalog"
44-
minSdkVersion 21
45-
targetSdkVersion 34
46+
// You can update the following values to match your application needs.
47+
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
48+
minSdkVersion 23
49+
targetSdkVersion flutter.targetSdkVersion
4650
versionCode flutterVersionCode.toInteger()
4751
versionName flutterVersionName
48-
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
49-
// Add this line to resolve "unable to merge dex" error, c.f.
50-
// https://github.com/flutter/flutter/issues/14874.
51-
multiDexEnabled true
52-
ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
53-
}
54-
dexOptions {
55-
preDexLibraries = false
5652
}
5753

5854
signingConfigs {
@@ -70,20 +66,7 @@ android {
7066
}
7167
buildTypes {
7268
release {
73-
// Add multidex-config.pro and this line to void multidex problem
74-
// for API version <21.
75-
// Cf. https://developer.android.com/studio/build/multidex#keep.
76-
multiDexKeepProguard file('multidex-config.pro')
7769
signingConfig signingConfigs.release
78-
// Enable symbolicated native crash stack traces, cf.
79-
// https://developer.android.com/studio/build/shrink-code#android_gradle_plugin_version_41_or_later
80-
ndk {
81-
debugSymbolLevel 'FULL'
82-
}
83-
shrinkResources true
84-
minifyEnabled true
85-
// useProguard true // https://stackoverflow.com/a/71760565/12421326
86-
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
8770
}
8871
}
8972
}
@@ -92,36 +75,4 @@ flutter {
9275
source '../..'
9376
}
9477

95-
// ! 🚧 temp solution for firestore bug.
96-
// see https://github.com/firebase/flutterfire/issues/8501#issuecomment-1107883048
97-
configurations.all {
98-
resolutionStrategy {
99-
force 'com.squareup.okhttp:okhttp:2.7.5'
100-
force 'com.squareup.okio:okio:1.17.5'
101-
}
102-
}
103-
104-
dependencies {
105-
implementation 'androidx.multidex:multidex:2.0.1'
106-
implementation "androidx.exifinterface:exifinterface:1.3.6"
107-
testImplementation 'junit:junit:4.12'
108-
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
109-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
110-
// Cf. https://developers.google.com/admob/android/quick-start.
111-
implementation 'com.google.android.gms:play-services-ads:21.3.0'
112-
implementation 'com.google.ads.mediation:adcolony:4.8.0.0'
113-
implementation 'com.google.ads.mediation:facebook:6.12.0.0'
114-
// Cf. https://firebase.google.com/docs/android/setup#add-sdks.
115-
// Import the BoM for the Firebase platform
116-
implementation platform('com.google.firebase:firebase-bom:31.1.1')
117-
// When using the BoM, you don't specify versions in Firebase library dependencies
118-
implementation 'com.google.firebase:firebase-analytics'
119-
implementation('com.google.firebase:firebase-auth') {
120-
// For safty net issue, cf. https://flutter-developer.medium.com/fixed-reported-critical-issues-with-version-17-0-0-google-play-warning-46c8fa9d5526
121-
exclude module: "play-services-safetynet"
122-
}
123-
implementation 'com.google.firebase:firebase-firestore'
124-
}
125-
126-
apply plugin: 'com.google.gms.google-services'
127-
apply plugin: 'com.google.firebase.crashlytics'
78+
dependencies {}

Diff for: android/app/google-services.json

-71
This file was deleted.

Diff for: android/app/multidex-config.pro

-2
This file was deleted.

Diff for: android/app/proguard-rules.pro

-4
This file was deleted.

Diff for: android/app/src/debug/AndroidManifest.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="io.github.x_wei.flutter_catalog">
3-
<!-- Flutter needs it to communicate with the running application
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<!-- The INTERNET permission is required for development. Specifically,
3+
the Flutter tool needs it to communicate with the running application
44
to allow setting breakpoints, to provide hot reload, etc.
55
-->
66
<uses-permission android:name="android.permission.INTERNET"/>

Diff for: android/app/src/main/AndroidManifest.xml

+25-12
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="io.github.x_wei.flutter_catalog">
3-
4-
<!-- The INTERNET permission is required for development. Specifically,
5-
flutter needs it to communicate with the running application
6-
to allow setting breakpoints, to provide hot reload, etc.
7-
-->
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
82
<uses-permission android:name="android.permission.INTERNET"/>
93
<uses-permission android:name="android.permission.USE_FINGERPRINT"/>
104
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
115
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
126
<uses-permission android:name="com.android.vending.BILLING"/>
13-
147
<application
158
android:label="Flutter Catalog"
16-
android:icon="@mipmap/launcher_icon"
17-
android:requestLegacyExternalStorage="true"
18-
android:usesCleartextTraffic="true">
9+
android:name="${applicationName}"
10+
android:icon="@mipmap/launcher_icon">
1911
<activity
2012
android:name=".MainActivity"
2113
android:exported="true"
2214
android:launchMode="singleTop"
2315
android:theme="@style/LaunchTheme"
24-
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
16+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
2517
android:hardwareAccelerated="true"
2618
android:windowSoftInputMode="adjustResize">
19+
<!-- Specifies an Android theme to apply to this Activity as soon as
20+
the Android process has started. This theme is visible to the user
21+
while the Flutter UI initializes. After that, this theme continues
22+
to determine the Window background behind the Flutter UI. -->
23+
<meta-data
24+
android:name="io.flutter.embedding.android.NormalTheme"
25+
android:resource="@style/NormalTheme"
26+
/>
2727
<intent-filter>
2828
<action android:name="android.intent.action.MAIN"/>
2929
<category android:name="android.intent.category.LAUNCHER"/>
@@ -35,8 +35,21 @@
3535
<meta-data
3636
android:name="com.google.mlkit.vision.DEPENDENCIES"
3737
android:value="ocr,ica,barcode,face" />
38+
<!-- Don't delete the meta-data below.
39+
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
3840
<meta-data
3941
android:name="flutterEmbedding"
4042
android:value="2" />
4143
</application>
44+
<!-- Required to query activities that can process text, see:
45+
https://developer.android.com/training/package-visibility?hl=en and
46+
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
47+
48+
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
49+
<queries>
50+
<intent>
51+
<action android:name="android.intent.action.PROCESS_TEXT"/>
52+
<data android:mimeType="text/plain"/>
53+
</intent>
54+
</queries>
4255
</manifest>
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
package io.github.x_wei.flutter_catalog
22

3-
import io.flutter.embedding.android.FlutterFragmentActivity
4-
import io.flutter.embedding.engine.FlutterEngine
5-
import io.flutter.plugins.GeneratedPluginRegistrant
3+
import io.flutter.embedding.android.FlutterActivity
64

7-
class MainActivity: FlutterFragmentActivity() {
8-
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
9-
GeneratedPluginRegistrant.registerWith(flutterEngine) // add this line
10-
}
11-
}
5+
class MainActivity: FlutterActivity()

Diff for: android/app/src/main/res/drawable-hdpi/splash.png

10 Bytes
Loading

Diff for: android/app/src/main/res/drawable-mdpi/splash.png

967 Bytes
Loading

Diff for: android/app/src/main/res/drawable-xhdpi/splash.png

1.04 KB
Loading

Diff for: android/app/src/main/res/drawable-xxhdpi/splash.png

-2.2 KB
Loading

Diff for: android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml

-5
This file was deleted.

Diff for: android/app/src/main/res/mipmap-hdpi/ic_launcher.png

-6.16 KB
Loading
-4.4 KB
Binary file not shown.
-5.51 KB
Binary file not shown.

Diff for: android/app/src/main/res/mipmap-mdpi/ic_launcher.png

-3.29 KB
Loading
-2.3 KB
Binary file not shown.
-2.96 KB
Binary file not shown.
-9.21 KB
Loading
-7.56 KB
Binary file not shown.
-6.87 KB
Binary file not shown.
-17.1 KB
Loading
Binary file not shown.
Binary file not shown.
-24.9 KB
Loading
Binary file not shown.
Binary file not shown.

Diff for: android/app/src/main/res/values-night/styles.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
44
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
55
<!-- Show a splash screen on the activity. Automatically removed when
6-
Flutter draws its first frame -->
6+
the Flutter engine draws its first frame -->
77
<item name="android:windowBackground">@drawable/launch_background</item>
88
<item name="android:forceDarkAllowed">false</item>
99
<item name="android:windowFullscreen">false</item>
@@ -14,7 +14,7 @@
1414
This theme determines the color of the Android Window while your
1515
Flutter UI initializes, as well as behind your Flutter UI while its
1616
running.
17-
17+
1818
This Theme is only used starting with V2 of Flutter's Android embedding. -->
1919
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
2020
<item name="android:windowBackground">?android:colorBackground</item>

Diff for: android/app/src/main/res/values/colors.xml

-4
This file was deleted.

0 commit comments

Comments
 (0)