Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "example",
"cwd": "example",
"request": "launch",
"type": "dart",
"args": ["-v"],
},
{
"name": "example (profile mode)",
"cwd": "example",
"request": "launch",
"type": "dart",
"flutterMode": "profile",
"args": ["-v"],
},
{
"name": "example (release mode)",
"cwd": "example",
"request": "launch",
"type": "dart",
"flutterMode": "release",
"args": ["-v"],
}
]
}
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## 1.0.8
- updated packages and compatibility with Flutter 3.29
## 1.0.7
- updating package versions
* archive: ^3.3.7
Expand Down
24 changes: 16 additions & 8 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ group 'com.fsconceicao.open_document'
version '1.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.2.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.android.tools.build:gradle:${androidToolsBuildGradleVersion}"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
}

}

rootProject.allprojects {
Expand All @@ -26,7 +26,10 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 33

namespace "com.fsconceicao.open_document"

compileSdkVersion 35

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -37,8 +40,13 @@ android {
lintOptions {
disable 'InvalidPackage'
}
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_21
targetCompatibility JavaVersion.VERSION_21
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_21
}
}
5 changes: 4 additions & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
org.gradle.jvmargs=-Xmx1536M
org.gradle.jvmargs=-Xmx4608m
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true
# Plugin Versions
androidToolsBuildGradleVersion=8.5.0
kotlinVersion=2.0.20
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,17 @@ class OpenDocument(context: Context, activity: FlutterActivity?) {
applicationContext.packageName,
PackageManager.PackageInfoFlags.of(0)
)
return applicationContext.packageManager?.getApplicationLabel(app.applicationInfo)
.toString()
app.applicationInfo?.let {
applicationContext.packageManager?.getApplicationLabel(it).toString()
} ?: "UnknownApp"
} else {
val app = applicationContext.packageManager?.getApplicationInfo(
applicationContext.packageName,
0
)
return applicationContext.packageManager?.getApplicationLabel(app!!).toString()
app?.let {
applicationContext.packageManager.getApplicationLabel(it).toString()
} ?: "UnknownApp"
}
} catch (e: Exception) {
e.printStackTrace()
Expand Down
2 changes: 2 additions & 0 deletions example/android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ gradle-wrapper.jar
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java
/app/.cxx
/.kotlin
39 changes: 22 additions & 17 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
Expand All @@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
Expand All @@ -21,12 +22,11 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 33

namespace "com.example.open_document_example"

compileSdkVersion 35

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -37,7 +37,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.open_document_example"
minSdkVersion 21
targetSdkVersion 33
targetSdkVersion 35
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand All @@ -49,15 +49,20 @@ android {
signingConfig signingConfigs.debug
}
}
lint {
lintOptions {
disable 'InvalidPackage'
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_21
targetCompatibility JavaVersion.VERSION_21
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_21
}
}

flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
}
3 changes: 1 addition & 2 deletions example/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.open_document_example">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
73 changes: 39 additions & 34 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,43 +1,48 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.open_document_example">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />

<application
android:label="open_document_example"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:label="open_document_example"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:name="com.example.open_document_example.MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />

<provider
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.example.open_document_example.fileprovider"
android:exported="false"
Expand Down

This file was deleted.

3 changes: 1 addition & 2 deletions example/android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.open_document_example">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
25 changes: 10 additions & 15 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,28 +1,23 @@
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.2.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

rootProject.buildDir = '../build'
subprojects {
afterEvaluate { project ->
if (project.hasProperty('android')) {
project.android {
if (namespace == null) {
namespace project.group
}
}
}
}
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}

Expand Down
7 changes: 6 additions & 1 deletion example/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
org.gradle.jvmargs=-Xmx1536M
org.gradle.jvmargs=-Xmx4608m
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true
android.suppressUnsupportedCompileSdk=35
# Plugin Versions
flutterPluginLoaderVersion=1.0.0
androidToolsBuildGradleVersion=8.5.0
jetbrainsKotlinAndroidVersion=2.0.20
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
Loading