Skip to content

Commit 3ac461d

Browse files
committed
Upgrade ffi to version 2.0.1 and require dart 2.17.0
1 parent dc904dc commit 3ac461d

File tree

117 files changed

+3287
-798
lines changed

Some content is hidden

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

117 files changed

+3287
-798
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 4.0.0
2+
* Update ffi to 2.0.1
3+
* Require Flutter 3.0.0+ and Dart 2.17.0+ (because of ffi 2.0.0+)
4+
* Update example project with latest version of Flutter (3.0.5)
5+
16
## 3.4.0
27
* Fix podspec in ios not resolved
38
## 3.3.0

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# open_filex
2-
[![pub package](https://img.shields.io/pub/v/open_filex.svg)](https://pub.dartlang.org/packages/open_filex)
2+
[![pub package](https://img.shields.io/pub/v/open_filex.svg)](https://pub.dev/packages/open_filex)
33

44
**NOTICE**: This package is forked from [here](https://github.com/crazecoder/open_file) to remove a dangerous permission in android
55

66
A plug-in that can call native APP to open files with string result in flutter, support iOS(DocumentInteraction) / android(intent) / PC(ffi) / web(dart:html)
77

88
## Usage
99

10-
To use this plugin, add [open_filex](https://pub.dartlang.org/packages/open_filex#-installing-tab-) as a dependency in your pubspec.yaml file.
10+
To use this plugin, add [open_filex](https://pub.dev/packages/open_filex/install) as a dependency in your pubspec.yaml file.
1111
```yaml
1212
dependencies:
1313
open_filex: ^lastVersion

analysis_options.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This file configures the analyzer, which statically analyzes Dart code to
2+
# check for errors, warnings, and lints.
3+
#
4+
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5+
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6+
# invoked from the command line by running `flutter analyze`.
7+
8+
# The following line activates a set of recommended lints for Flutter apps,
9+
# packages, and plugins designed to encourage good coding practices.
10+
include: package:flutter_lints/flutter.yaml
11+
12+
linter:
13+
# The lint rules applied to this project can be customized in the
14+
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
15+
# included above or to enable additional rules. A list of all available lints
16+
# and their documentation is published at
17+
# https://dart-lang.github.io/linter/lints/index.html.
18+
#
19+
# Instead of disabling a lint rule for the entire project in the
20+
# section below, it can also be suppressed for a single line of code
21+
# or a specific dart file by using the `// ignore: name_of_lint` and
22+
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
23+
# producing the lint.
24+
rules:
25+
# avoid_print: false # Uncomment to disable the `avoid_print` rule
26+
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27+
28+
# Additional information about this file can be found at
29+
# https://dart.dev/guides/language/analysis-options

example/.gitignore

+41-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,47 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
16
.DS_Store
2-
.dart_tool/
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
migrate_working_dir/
12+
13+
# IntelliJ related
14+
*.iml
15+
*.ipr
16+
*.iws
17+
.idea/
318

19+
# The .vscode folder contains launch configuration and tasks you configure in
20+
# VS Code which you may wish to be included in version control, so this line
21+
# is commented out by default.
22+
#.vscode/
23+
24+
# Flutter/Dart/Pub related
25+
**/doc/api/
26+
**/ios/Flutter/.last_build_id
27+
.dart_tool/
28+
.flutter-plugins
29+
.flutter-plugins-dependencies
430
.packages
31+
.pub-cache/
532
.pub/
33+
/build/
634

7-
build/
35+
# Web related
36+
lib/generated_plugin_registrant.dart
837

9-
.flutter-plugins
38+
# Symbolication related
39+
app.*.symbols
40+
41+
# Obfuscation related
42+
app.*.map.json
43+
44+
# Android Studio will place build artifacts here
45+
/android/app/debug
46+
/android/app/profile
47+
/android/app/release

example/.metadata

+40-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,45 @@
11
# This file tracks properties of this Flutter project.
22
# Used by Flutter tool to assess capabilities and perform upgrades etc.
33
#
4-
# This file should be version controlled and should not be manually edited.
4+
# This file should be version controlled.
55

66
version:
7-
revision: 7ac183794b41dea0a66c61f9d995ad617b90cb3b
8-
channel: master
7+
revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
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: fb57da5f945d02ef4f98dfd9409a72b7cce74268
17+
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
18+
- platform: android
19+
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
20+
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
21+
- platform: ios
22+
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
23+
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
24+
- platform: linux
25+
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
26+
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
27+
- platform: macos
28+
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
29+
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
30+
- platform: web
31+
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
32+
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
33+
- platform: windows
34+
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
35+
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
36+
37+
# User provided section
38+
39+
# List of Local paths (relative to this file) that should be
40+
# ignored by the migrate tool.
41+
#
42+
# Files that are not part of the templates will be ignored by default.
43+
unmanaged_files:
44+
- 'lib/main.dart'
45+
- 'ios/Runner.xcodeproj/project.pbxproj'

example/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# open_file
1+
# open_filex
22

33
A plug-in that can open files for android
44

55
## Usage
66

7-
To use this plugin, add [open_file](https://pub.dartlang.org/packages/open_file#-installing-tab-)as a dependency in your pubspec.yaml file.
7+
To use this plugin, add [open_filex](https://pub.dev/packages/open_filex/install) as a dependency in your pubspec.yaml file.
88

99
## Example
1010
```
11-
import 'package:open_file/open_file.dart';
11+
import 'package:open_filex/open_filex.dart';
1212
1313
OpenFilex.open("/sdcard/text.txt");
1414
```

example/analysis_options.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This file configures the analyzer, which statically analyzes Dart code to
2+
# check for errors, warnings, and lints.
3+
#
4+
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5+
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6+
# invoked from the command line by running `flutter analyze`.
7+
8+
# The following line activates a set of recommended lints for Flutter apps,
9+
# packages, and plugins designed to encourage good coding practices.
10+
include: package:flutter_lints/flutter.yaml
11+
12+
linter:
13+
# The lint rules applied to this project can be customized in the
14+
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
15+
# included above or to enable additional rules. A list of all available lints
16+
# and their documentation is published at
17+
# https://dart-lang.github.io/linter/lints/index.html.
18+
#
19+
# Instead of disabling a lint rule for the entire project in the
20+
# section below, it can also be suppressed for a single line of code
21+
# or a specific dart file by using the `// ignore: name_of_lint` and
22+
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
23+
# producing the lint.
24+
rules:
25+
# avoid_print: false # Uncomment to disable the `avoid_print` rule
26+
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27+
28+
# Additional information about this file can be found at
29+
# https://dart.dev/guides/language/analysis-options

example/android/.gitignore

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
*.iml
2-
*.class
3-
.gradle
1+
gradle-wrapper.jar
2+
/.gradle
3+
/captures/
4+
/gradlew
5+
/gradlew.bat
46
/local.properties
5-
/.idea/workspace.xml
6-
/.idea/libraries
7-
.DS_Store
8-
/build
9-
/captures
107
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

example/android/app/build.gradle

+20-10
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,35 @@ if (flutterVersionName == null) {
2222
}
2323

2424
apply plugin: 'com.android.application'
25+
apply plugin: 'kotlin-android'
2526
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2627

2728
android {
28-
compileSdkVersion 29
29+
compileSdkVersion flutter.compileSdkVersion
30+
ndkVersion flutter.ndkVersion
2931

30-
lintOptions {
31-
disable 'InvalidPackage'
32+
compileOptions {
33+
sourceCompatibility JavaVersion.VERSION_1_8
34+
targetCompatibility JavaVersion.VERSION_1_8
35+
}
36+
37+
kotlinOptions {
38+
jvmTarget = '1.8'
39+
}
40+
41+
sourceSets {
42+
main.java.srcDirs += 'src/main/kotlin'
3243
}
3344

3445
defaultConfig {
3546
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
36-
applicationId "com.crazecoder.openfileexample"
37-
minSdkVersion 16
38-
targetSdkVersion 29
47+
applicationId "com.example.example"
48+
// You can update the following values to match your application needs.
49+
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
50+
minSdkVersion flutter.minSdkVersion
51+
targetSdkVersion flutter.targetSdkVersion
3952
versionCode flutterVersionCode.toInteger()
4053
versionName flutterVersionName
41-
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
4254
}
4355

4456
buildTypes {
@@ -55,7 +67,5 @@ flutter {
5567
}
5668

5769
dependencies {
58-
testImplementation 'junit:junit:4.12'
59-
androidTestImplementation 'androidx.test:runner:1.3.0-alpha03'
60-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0-alpha03'
70+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
6171
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.example.example">
3+
<!-- The INTERNET permission is required for development. Specifically,
4+
the Flutter tool needs it to communicate with the running application
5+
to allow setting breakpoints, to provide hot reload, etc.
6+
-->
7+
<uses-permission android:name="android.permission.INTERNET"/>
8+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,39 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
xmlns:tools="http://schemas.android.com/tools"
3-
package="com.crazecoder.openfileexample">
4-
2+
package="com.example.example">
53
<!-- The INTERNET permission is required for development. Specifically,
64
flutter needs it to communicate with the running application
75
to allow setting breakpoints, to provide hot reload, etc.
86
-->
97
<uses-permission android:name="android.permission.INTERNET"/>
10-
11-
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
12-
calls FlutterMain.startInitialization(this); in its onCreate method.
13-
In most cases you can leave this as-is, but you if you want to provide
14-
additional functionality it is fine to subclass or reimplement
15-
FlutterApplication and put your custom class here. -->
16-
<application
17-
android:name="io.flutter.app.FlutterApplication"
18-
android:label="open_file_example"
8+
<application
9+
android:label="example"
10+
android:name="${applicationName}"
1911
android:icon="@mipmap/ic_launcher">
2012
<activity
2113
android:name=".MainActivity"
14+
android:exported="true"
2215
android:launchMode="singleTop"
2316
android:theme="@style/LaunchTheme"
24-
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
17+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
2518
android:hardwareAccelerated="true"
2619
android:windowSoftInputMode="adjustResize">
27-
<!-- This keeps the window background of the activity showing
28-
until Flutter renders its first frame. It can be removed if
29-
there is no splash screen (such as the default splash screen
30-
defined in @style/LaunchTheme). -->
20+
<!-- Specifies an Android theme to apply to this Activity as soon as
21+
the Android process has started. This theme is visible to the user
22+
while the Flutter UI initializes. After that, this theme continues
23+
to determine the Window background behind the Flutter UI. -->
3124
<meta-data
32-
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
33-
android:value="true" />
25+
android:name="io.flutter.embedding.android.NormalTheme"
26+
android:resource="@style/NormalTheme"
27+
/>
3428
<intent-filter>
3529
<action android:name="android.intent.action.MAIN"/>
3630
<category android:name="android.intent.category.LAUNCHER"/>
3731
</intent-filter>
3832
</activity>
39-
<!--<provider-->
40-
<!--android:name="androidx.core.content.FileProvider"-->
41-
<!--android:authorities="${applicationId}.fileProvider"-->
42-
<!--android:exported="false"-->
43-
<!--android:grantUriPermissions="true"-->
44-
<!--tools:replace="android:authorities">-->
45-
<!--<meta-data-->
46-
<!--android:name="android.support.FILE_PROVIDER_PATHS"-->
47-
<!--android:resource="@xml/filepaths"-->
48-
<!--tools:replace="android:resource" />-->
49-
<!--</provider>-->
33+
<!-- Don't delete the meta-data below.
34+
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
35+
<meta-data
36+
android:name="flutterEmbedding"
37+
android:value="2" />
5038
</application>
5139
</manifest>

example/android/app/src/main/java/com/crazecoder/openfileexample/MainActivity.java

-13
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package com.example.example
2+
3+
import io.flutter.embedding.android.FlutterActivity
4+
5+
class MainActivity: FlutterActivity() {
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Modify this file to customize your launch splash screen -->
3+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
4+
<item android:drawable="?android:colorBackground" />
5+
6+
<!-- You can insert your own image assets here -->
7+
<!-- <item>
8+
<bitmap
9+
android:gravity="center"
10+
android:src="@mipmap/launch_image" />
11+
</item> -->
12+
</layer-list>

0 commit comments

Comments
 (0)