@@ -0,0 +1 @@ | |||||
{"_info":"// This is a generated file; do not edit or check into version control.","dependencyGraph":[{"name":"agora_rtc_engine","dependencies":[]},{"name":"amap_location","dependencies":[]},{"name":"android_intent","dependencies":[]},{"name":"app_installer","dependencies":[]},{"name":"apple_sign_in","dependencies":[]},{"name":"audioplayer","dependencies":[]},{"name":"auto_orientation","dependencies":[]},{"name":"city_pickers","dependencies":[]},{"name":"connectivity","dependencies":[]},{"name":"easy_contact_picker","dependencies":[]},{"name":"file_picker","dependencies":[]},{"name":"flutter_app_badger","dependencies":[]},{"name":"flutter_audio_recorder","dependencies":[]},{"name":"flutter_bugly","dependencies":[]},{"name":"flutter_facebook_login","dependencies":[]},{"name":"flutter_ijkplayer","dependencies":[]},{"name":"flutter_image_compress","dependencies":[]},{"name":"flutter_inapp_purchase","dependencies":[]},{"name":"flutter_local_notifications","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"flutter_qr_reader","dependencies":["image_picker"]},{"name":"flutter_webview_plugin","dependencies":[]},{"name":"fluwx_no_pay","dependencies":[]},{"name":"geolocator","dependencies":["google_api_availability","location_permissions"]},{"name":"google_api_availability","dependencies":[]},{"name":"google_maps_flutter","dependencies":[]},{"name":"image_cropper","dependencies":[]},{"name":"image_gallery_saver","dependencies":[]},{"name":"image_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"jpush_flutter","dependencies":[]},{"name":"keyboard_utils","dependencies":[]},{"name":"location","dependencies":[]},{"name":"location_permissions","dependencies":[]},{"name":"open_file","dependencies":[]},{"name":"package_info","dependencies":[]},{"name":"path_provider","dependencies":[]},{"name":"permission_handler","dependencies":[]},{"name":"photo_manager","dependencies":[]},{"name":"receive_sharing_intent","dependencies":[]},{"name":"share","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_macos","shared_preferences_web"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"sqflite","dependencies":[]},{"name":"url_launcher","dependencies":[]},{"name":"video_player","dependencies":[]},{"name":"video_thumbnail","dependencies":[]},{"name":"wifi_info_plugin","dependencies":[]}]} |
@@ -0,0 +1,72 @@ | |||||
# Miscellaneous | |||||
*.class | |||||
*.log | |||||
*.pyc | |||||
*.swp | |||||
.DS_Store | |||||
.atom/ | |||||
.buildlog/ | |||||
.history | |||||
.svn/ | |||||
# IntelliJ related | |||||
*.iml | |||||
*.ipr | |||||
*.iws | |||||
.idea/ | |||||
# The .vscode folder contains launch configuration and tasks you configure in | |||||
# VS Code which you may wish to be included in version control, so this line | |||||
# is commented out by default. | |||||
#.vscode/ | |||||
# Flutter/Dart/Pub related | |||||
**/doc/api/ | |||||
.dart_tool/ | |||||
.flutter-plugins | |||||
.packages | |||||
.pub-cache/ | |||||
.pub/ | |||||
/build/ | |||||
# Android related | |||||
**/android/**/gradle-wrapper.jar | |||||
**/android/.gradle | |||||
**/android/captures/ | |||||
**/android/gradlew | |||||
**/android/gradlew.bat | |||||
**/android/local.properties | |||||
**/android/**/GeneratedPluginRegistrant.java | |||||
# iOS/XCode related | |||||
**/ios/**/*.mode1v3 | |||||
**/ios/**/*.mode2v3 | |||||
**/ios/**/*.moved-aside | |||||
**/ios/**/*.pbxuser | |||||
**/ios/**/*.perspectivev3 | |||||
**/ios/**/*sync/ | |||||
**/ios/**/.sconsign.dblite | |||||
**/ios/**/.tags* | |||||
**/ios/**/.vagrant/ | |||||
**/ios/**/DerivedData/ | |||||
**/ios/**/Icon? | |||||
**/ios/**/Pods/ | |||||
**/ios/**/.symlinks/ | |||||
**/ios/**/profile | |||||
**/ios/**/xcuserdata | |||||
**/ios/.generated/ | |||||
**/ios/Flutter/App.framework | |||||
**/ios/Flutter/Flutter.framework | |||||
**/ios/Flutter/Generated.xcconfig | |||||
**/ios/Flutter/app.flx | |||||
**/ios/Flutter/app.zip | |||||
**/ios/Flutter/flutter_assets/ | |||||
**/ios/ServiceDefinitions.json | |||||
**/ios/Runner/GeneratedPluginRegistrant.* | |||||
# Exceptions to above rules. | |||||
!**/ios/**/default.mode1v3 | |||||
!**/ios/**/default.mode2v3 | |||||
!**/ios/**/default.pbxuser | |||||
!**/ios/**/default.perspectivev3 | |||||
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages |
@@ -0,0 +1,10 @@ | |||||
# This file tracks properties of this Flutter project. | |||||
# Used by Flutter tool to assess capabilities and perform upgrades etc. | |||||
# | |||||
# This file should be version controlled and should not be manually edited. | |||||
version: | |||||
revision: b712a172f9694745f50505c93340883493b505e5 | |||||
channel: stable | |||||
project_type: app |
@@ -0,0 +1,16 @@ | |||||
# chat | |||||
A new Flutter project. | |||||
## Getting Started | |||||
This project is a starting point for a Flutter application. | |||||
A few resources to get you started if this is your first Flutter project: | |||||
- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) | |||||
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) | |||||
For help getting started with Flutter, view our | |||||
[online documentation](https://flutter.dev/docs), which offers tutorials, | |||||
samples, guidance on mobile development, and a full API reference. |
@@ -0,0 +1,17 @@ | |||||
<?xml version="1.0" encoding="UTF-8"?> | |||||
<projectDescription> | |||||
<name>android</name> | |||||
<comment>Project android created by Buildship.</comment> | |||||
<projects> | |||||
</projects> | |||||
<buildSpec> | |||||
<buildCommand> | |||||
<name>org.eclipse.buildship.core.gradleprojectbuilder</name> | |||||
<arguments> | |||||
</arguments> | |||||
</buildCommand> | |||||
</buildSpec> | |||||
<natures> | |||||
<nature>org.eclipse.buildship.core.gradleprojectnature</nature> | |||||
</natures> | |||||
</projectDescription> |
@@ -0,0 +1,6 @@ | |||||
<?xml version="1.0" encoding="UTF-8"?> | |||||
<classpath> | |||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/> | |||||
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/> | |||||
<classpathentry kind="output" path="bin/default"/> | |||||
</classpath> |
@@ -0,0 +1,23 @@ | |||||
<?xml version="1.0" encoding="UTF-8"?> | |||||
<projectDescription> | |||||
<name>app</name> | |||||
<comment>Project app created by Buildship.</comment> | |||||
<projects> | |||||
</projects> | |||||
<buildSpec> | |||||
<buildCommand> | |||||
<name>org.eclipse.jdt.core.javabuilder</name> | |||||
<arguments> | |||||
</arguments> | |||||
</buildCommand> | |||||
<buildCommand> | |||||
<name>org.eclipse.buildship.core.gradleprojectbuilder</name> | |||||
<arguments> | |||||
</arguments> | |||||
</buildCommand> | |||||
</buildSpec> | |||||
<natures> | |||||
<nature>org.eclipse.jdt.core.javanature</nature> | |||||
<nature>org.eclipse.buildship.core.gradleprojectnature</nature> | |||||
</natures> | |||||
</projectDescription> |
@@ -0,0 +1,2 @@ | |||||
connection.project.dir=.. | |||||
eclipse.preferences.version=1 |
@@ -0,0 +1,26 @@ | |||||
{ | |||||
"agcgw":{ | |||||
"backurl":"connect-dra.dbankcloud.cn", | |||||
"url":"connect-dra.hispace.hicloud.com" | |||||
}, | |||||
"client":{ | |||||
"cp_id":"890086000300385560", | |||||
"product_id":"9105385871708389411", | |||||
"client_id":"270664671340528640", | |||||
"client_secret":"00CC308FC014C334D58CF79471B490FD6274BC39FEAAD89B63E762871DB4EBCC", | |||||
"app_id":"101598177", | |||||
"package_name":"com.cyhd.henhoandroid" | |||||
}, | |||||
"service":{ | |||||
"analytics":{ | |||||
"collector_url":"datacollector-dra.dt.hicloud.com,datacollector-dra.dt.dbankcloud.cn", | |||||
"resource_id":"p1", | |||||
"channel_id":"" | |||||
}, | |||||
"ml":{ | |||||
"mlservice_url":"ml-api-dra.ai.hicloud.com,ml-api-dra.ai.dbankcloud.cn" | |||||
} | |||||
}, | |||||
"region":"SG", | |||||
"configuration_version":"1.0" | |||||
} |
@@ -0,0 +1,156 @@ | |||||
def localProperties = new Properties() | |||||
def localPropertiesFile = rootProject.file('local.properties') | |||||
if (localPropertiesFile.exists()) { | |||||
localPropertiesFile.withReader('UTF-8') { reader -> | |||||
localProperties.load(reader) | |||||
} | |||||
} | |||||
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' | |||||
} | |||||
def flutterVersionName = localProperties.getProperty('flutter.versionName') | |||||
if (flutterVersionName == null) { | |||||
flutterVersionName = '1.0' | |||||
} | |||||
apply plugin: 'com.android.application' | |||||
apply plugin: 'kotlin-android-extensions' | |||||
apply plugin: 'kotlin-android' | |||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" | |||||
apply plugin: 'com.google.gms.google-services' | |||||
apply plugin: 'com.huawei.agconnect' | |||||
android { | |||||
compileSdkVersion 28 | |||||
lintOptions { | |||||
disable 'InvalidPackage' | |||||
} | |||||
signingConfigs { | |||||
release { | |||||
keyAlias 'cyhd' | |||||
keyPassword '@)!&8888cyhd' | |||||
storeFile file('../cyhdSign') | |||||
storePassword '@)!&8888cyhd' | |||||
} | |||||
} | |||||
defaultConfig { | |||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). | |||||
applicationId "com.cyhd.henhoandroid" | |||||
minSdkVersion 21 | |||||
targetSdkVersion 28 | |||||
versionCode flutterVersionCode.toInteger() | |||||
versionName flutterVersionName | |||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | |||||
// manifestPlaceholders = [ | |||||
// AMAP_KEY : "1fd4e93e3b4b13747da41f484c955fe2", /// 高德地图key | |||||
// ] | |||||
ndk { | |||||
abiFilters 'armeabi-v7a' | |||||
} | |||||
multiDexEnabled true | |||||
manifestPlaceholders = [ | |||||
JPUSH_PKGNAME : 'com.cyhd.henhoandroid', | |||||
JPUSH_APPKEY : "13dd603952a6632d1dd3ac54", // NOTE: JPush 上注册的包名对应的 Appkey. | |||||
JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可. | |||||
AMAP_KEY : "1fd4e93e3b4b13747da41f484c955fe2", /// 高德地图key | |||||
XIAOMI_APPKEY:"MI-5221829498125",//小米平台注册的appkey | |||||
XIAOMI_APPID:"MI-2882303761518294125",//小米平台注册的appid | |||||
// | |||||
HUAWEI_APPID:"101598177",//华为平台注册的appid | |||||
OPPO_APPKEY : "OP-cd9ece5049514019842f54d537068018", // OPPO平台注册的appkey | |||||
OPPO_APPID : "OP-30233397", // OPPO平台注册的appid | |||||
OPPO_APPSECRET: "OP-您的应用对应OPPO的APPSECRET",//OPPO平台注册的appsecret | |||||
// | |||||
// MEIZU_APPKEY:"MZ-您的应用对应的魅族appkey",//魅族平台注册的appkey | |||||
// MEIZU_APPID:"MZ-您的应用对应魅族的appid",//魅族平台注册的appid | |||||
] | |||||
} | |||||
buildTypes { | |||||
release { | |||||
// minifyEnabled true //混淆 | |||||
// proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | |||||
// shrinkResources false | |||||
signingConfig signingConfigs.release | |||||
minifyEnabled false | |||||
shrinkResources false | |||||
} | |||||
debug { | |||||
signingConfig signingConfigs.release | |||||
minifyEnabled false | |||||
shrinkResources false | |||||
} | |||||
} | |||||
} | |||||
flutter { | |||||
source '../..' | |||||
} | |||||
subprojects { | |||||
project.configurations.all { | |||||
resolutionStrategy.eachDependency { details -> | |||||
if (details.requested.group == 'com.android.support' | |||||
&& !details.requested.name.contains('multidex') ) { | |||||
details.useVersion "27.1.1" | |||||
} | |||||
if (details.requested.group == 'androidx.core' | |||||
&& !details.requested.name.contains('androidx') ) { | |||||
} | |||||
} | |||||
} | |||||
} | |||||
dependencies { | |||||
testImplementation 'junit:junit:4.12' | |||||
androidTestImplementation 'com.android.support.test:runner:1.0.2' | |||||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' | |||||
//implementation 'com.amap.api:location:latest.integration' | |||||
implementation 'com.android.support:multidex:1.0.3' | |||||
//接入厂商推送-跟jpush插件版本要配套 | |||||
implementation 'cn.jiguang.sdk.plugin:xiaomi:3.3.4' | |||||
// implementation 'cn.jiguang.sdk.plugin:huawei:3.3.4' | |||||
implementation 'com.huawei.hms:push:3.0.3.301' | |||||
implementation files('src/main/libs/jpush-android-plugin-huawei-v3.5.4.jar') | |||||
// implementation'cn.jiguang.sdk.plugin:meizu:3.4.1'//JPushSDK3.4.1 | |||||
implementation 'com.google.firebase:firebase-messaging:17.3.4' | |||||
implementation files('src/main/libs/jpush-android-plugin-fcm-v3.5.4.jar') | |||||
implementation 'cn.jiguang.sdk.plugin:oppo:3.3.4' | |||||
compile "androidx.core:core-ktx:+" | |||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" | |||||
} | |||||
repositories { | |||||
mavenCentral() | |||||
} |
@@ -0,0 +1,40 @@ | |||||
{ | |||||
"project_info": { | |||||
"project_number": "151024159565", | |||||
"firebase_url": "https://hi-cyhd.firebaseio.com", | |||||
"project_id": "hi-cyhd", | |||||
"storage_bucket": "hi-cyhd.appspot.com" | |||||
}, | |||||
"client": [ | |||||
{ | |||||
"client_info": { | |||||
"mobilesdk_app_id": "1:151024159565:android:cfc78480e0b6c10e730504", | |||||
"android_client_info": { | |||||
"package_name": "com.cyhd.henhoandroid" | |||||
} | |||||
}, | |||||
"oauth_client": [ | |||||
{ | |||||
"client_id": "151024159565-62j3d7gvusqusksu8dehjd7v6eq0g6he.apps.googleusercontent.com", | |||||
"client_type": 3 | |||||
} | |||||
], | |||||
"api_key": [ | |||||
{ | |||||
"current_key": "AIzaSyB676Y2P0xOg7qFlhOOI_wuMhrqI32AN1I" | |||||
} | |||||
], | |||||
"services": { | |||||
"appinvite_service": { | |||||
"other_platform_oauth_client": [ | |||||
{ | |||||
"client_id": "151024159565-62j3d7gvusqusksu8dehjd7v6eq0g6he.apps.googleusercontent.com", | |||||
"client_type": 3 | |||||
} | |||||
] | |||||
} | |||||
} | |||||
} | |||||
], | |||||
"configuration_version": "1" | |||||
} |
@@ -0,0 +1,7 @@ | |||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |||||
package="com.cyhd.henhoandroid"> | |||||
<!-- Flutter needs it to communicate with the running application | |||||
to allow setting breakpoints, to provide hot reload, etc. | |||||
--> | |||||
<uses-permission android:name="android.permission.INTERNET"/> | |||||
</manifest> |
@@ -0,0 +1,111 @@ | |||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |||||
xmlns:tools="http://schemas.android.com/tools" package="com.cyhd.henhoandroid"> | |||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/> | |||||
<uses-permission android:name="android.permission.INTERNET"/> | |||||
<uses-permission android:name="android.permission.RECORD_AUDIO" /> | |||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | |||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> | |||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> | |||||
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" /> | |||||
<!-- 本地推送 start--> | |||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> | |||||
<uses-permission android:name="android.permission.VIBRATE" /> | |||||
<uses-permission android:name="android.permission.WAKE_LOCK" /> | |||||
<!-- 本地推送 end--> | |||||
<!-- Permissions options for the `contacts` group --> | |||||
<uses-permission android:name="android.permission.READ_CONTACTS"/> | |||||
<uses-permission android:name="android.permission.WRITE_CONTACTS"/> | |||||
<uses-permission android:name="android.permission.GET_ACCOUNTS"/> | |||||
<uses-feature android:name="android.hardware.location.network" android:required="false" /> | |||||
<uses-feature android:name="android.hardware.location.gps" android:required="false" /> | |||||
<!-- 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:name="io.flutter.app.FlutterApplication" android:label="HiBok" android:icon="@mipmap/ic_launcher_1"> | |||||
<activity android:name=".MainActivity" android:launchMode="singleTask" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize"> | |||||
<!-- This keeps the window background of the activity showing | |||||
until Flutter renders its first frame. It can be removed if | |||||
there is no splash screen (such as the default splash screen | |||||
defined in @style/LaunchTheme). --> | |||||
<meta-data android:name="io.flutter.app.android.SplashScreenUntilFirstFrame" android:value="true" /> | |||||
<intent-filter> | |||||
<action android:name="android.intent.action.MAIN"/> | |||||
<category android:name="android.intent.category.LAUNCHER"/> | |||||
</intent-filter> | |||||
<!-- 图片文件分享接收--> | |||||
<intent-filter> | |||||
<action android:name="android.intent.action.SEND" /> | |||||
<category android:name="android.intent.category.DEFAULT" /> | |||||
<!-- <data android:mimeType="image/*" />--> | |||||
<data android:mimeType="*/*" /> | |||||
</intent-filter> | |||||
</activity> | |||||
<activity android:name="com.yalantis.ucrop.UCropActivity" android:screenOrientation="portrait" android:theme="@style/Theme.AppCompat.Light.NoActionBar"/> | |||||
<meta-data android:name="com.google.android.geo.API_KEY" android:value="AIzaSyAb9JNtW0BEZ_qLeDg87ZhvxSmZply-7hU"/> | |||||
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/> | |||||
<activity android:name="com.facebook.FacebookActivity" android:configChanges= | |||||
"keyboard|keyboardHidden|screenLayout|screenSize|orientation" android:label="@string/app_name" /> | |||||
<activity android:name="com.facebook.CustomTabActivity" android:exported="true"> | |||||
<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="@string/fb_login_protocol_scheme" /> | |||||
</intent-filter> | |||||
</activity> | |||||
<!-- 本地推送start--> | |||||
<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver" /> | |||||
<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver"> | |||||
<intent-filter> | |||||
<action android:name="android.intent.action.BOOT_COMPLETED"></action> | |||||
</intent-filter> | |||||
</receiver> | |||||
<!-- 本地推送end--> | |||||
<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/ic_launcher_1" /> | |||||
<service android:name="cn.jpush.android.service.PluginFCMMessagingService"> | |||||
<intent-filter> | |||||
<action android:name="com.google.firebase.MESSAGING_EVENT"/> | |||||
</intent-filter> | |||||
</service> | |||||
<service android:name="cn.jpush.android.service.PluginFCMInstanceIdService"> | |||||
<intent-filter> | |||||
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/> | |||||
</intent-filter> | |||||
</service> | |||||
<service | |||||
android:name="cn.jpush.android.service.PluginHuaweiPlatformsService" | |||||
android:exported="false"> | |||||
<intent-filter> | |||||
<action android:name="com.huawei.push.action.MESSAGING_EVENT" /> | |||||
</intent-filter> | |||||
</service> | |||||
<provider android:name="androidx.core.content.FileProvider" android:authorities="${applicationId}.fileProvider" android:exported="false" tools:replace="android:authorities" android:grantUriPermissions="true"> | |||||
<meta-data tools:replace="android:resource" android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" /> | |||||
</provider> | |||||
</application> | |||||
</manifest> |
@@ -0,0 +1,31 @@ | |||||
package com.cyhd.henhoandroid; | |||||
import android.os.Bundle; | |||||
import android.util.Log; | |||||
import com.cyhd.henhoandroid.plugin.FlutterWindowManagerPlugin; | |||||
import io.flutter.app.FlutterActivity; | |||||
import io.flutter.plugins.GeneratedPluginRegistrant; | |||||
import com.cyhd.henhoandroid.plugin.ScreenShot; | |||||
import com.google.android.gms.common.ConnectionResult; | |||||
import com.google.android.gms.common.GoogleApiAvailability; | |||||
import com.xiaomi.mipush.sdk.MiPushClient; | |||||
public class MainActivity extends FlutterActivity { | |||||
@Override | |||||
protected void onCreate(Bundle savedInstanceState) { | |||||
super.onCreate(savedInstanceState); | |||||
GeneratedPluginRegistrant.registerWith(this); | |||||
FlutterWindowManagerPlugin.registerWith(registrarFor("io.adaptant.labs.flutter_windowmanager.FlutterWindowManagerPlugin")); | |||||
ScreenShot.registerWith(this, registrarFor("make.photo.screen.hibok")); | |||||
} | |||||
} |
@@ -0,0 +1,123 @@ | |||||
package com.cyhd.henhoandroid.plugin; | |||||
import android.app.Activity; | |||||
import android.os.Build; | |||||
import android.util.Log; | |||||
import android.view.WindowManager; | |||||
import io.flutter.plugin.common.MethodCall; | |||||
import io.flutter.plugin.common.MethodChannel; | |||||
import io.flutter.plugin.common.MethodChannel.MethodCallHandler; | |||||
import io.flutter.plugin.common.MethodChannel.Result; | |||||
import io.flutter.plugin.common.PluginRegistry.Registrar; | |||||
/** FlutterWindowManagerPlugin */ | |||||
public class FlutterWindowManagerPlugin implements MethodCallHandler { | |||||
private final Activity activity; | |||||
private FlutterWindowManagerPlugin(Registrar registrar) { | |||||
this.activity = registrar.activity(); | |||||
} | |||||
/** Plugin registration. */ | |||||
public static void registerWith(Registrar registrar) { | |||||
final MethodChannel channel = new MethodChannel(registrar.messenger(), "flutter_windowmanager"); | |||||
FlutterWindowManagerPlugin instance = new FlutterWindowManagerPlugin(registrar); | |||||
channel.setMethodCallHandler(instance); | |||||
} | |||||
/** | |||||
* Validate flag specification against WindowManager.LayoutParams and API levels, as per: | |||||
* https://developer.android.com/reference/android/view/WindowManager.LayoutParams | |||||
*/ | |||||
@SuppressWarnings("deprecation") | |||||
private boolean validLayoutParam(int flag) { | |||||
switch (flag) { | |||||
case WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON: | |||||
case WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM: | |||||
case WindowManager.LayoutParams.FLAG_DIM_BEHIND: | |||||
case WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN: | |||||
case WindowManager.LayoutParams.FLAG_FULLSCREEN: | |||||
case WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED: | |||||
case WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES: | |||||
case WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON: | |||||
case WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR: | |||||
case WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN: | |||||
case WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS: | |||||
case WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE: | |||||
case WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE: | |||||
case WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL: | |||||
case WindowManager.LayoutParams.FLAG_SCALED: | |||||
case WindowManager.LayoutParams.FLAG_SECURE: | |||||
case WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER: | |||||
case WindowManager.LayoutParams.FLAG_SPLIT_TOUCH: | |||||
case WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH: | |||||
return true; | |||||
case WindowManager.LayoutParams.FLAG_BLUR_BEHIND: | |||||
return !(Build.VERSION.SDK_INT >= 15); | |||||
case WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD: | |||||
return (Build.VERSION.SDK_INT >= 5 && Build.VERSION.SDK_INT < 26); | |||||
case WindowManager.LayoutParams.FLAG_DITHER: | |||||
return !(Build.VERSION.SDK_INT >= 17); | |||||
case WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS: | |||||
return (Build.VERSION.SDK_INT >= 21); | |||||
case WindowManager.LayoutParams.FLAG_LAYOUT_ATTACHED_IN_DECOR: | |||||
return (Build.VERSION.SDK_INT >= 22); | |||||
case WindowManager.LayoutParams.FLAG_LAYOUT_IN_OVERSCAN: | |||||
return (Build.VERSION.SDK_INT >= 18); | |||||
case WindowManager.LayoutParams.FLAG_LOCAL_FOCUS_MODE: | |||||
return (Build.VERSION.SDK_INT >= 19); | |||||
case WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED: | |||||
return !(Build.VERSION.SDK_INT >= 27); | |||||
case WindowManager.LayoutParams.FLAG_TOUCHABLE_WHEN_WAKING: | |||||
return !(Build.VERSION.SDK_INT >= 20); | |||||
case WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION: | |||||
case WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS: | |||||
return (Build.VERSION.SDK_INT >= 19); | |||||
case WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON: | |||||
return !(Build.VERSION.SDK_INT >= 27); | |||||
default: | |||||
return false; | |||||
} | |||||
} | |||||
private boolean validLayoutParams(Result result, int flags) { | |||||
for (int i = 0; i < Integer.SIZE; i++) { | |||||
int flag = (1 << i); | |||||
if ((flags & flag) == 1) { | |||||
if (!validLayoutParam(flag)) { | |||||
result.error("FlutterWindowManagerPlugin","FlutterWindowManagerPlugin: invalid flag specification: " + Integer.toHexString(flag), null); | |||||
return false; | |||||
} | |||||
} | |||||
} | |||||
return true; | |||||
} | |||||
@Override | |||||
public void onMethodCall(MethodCall call, Result result) { | |||||
final int flags = call.argument("flags"); | |||||
if (activity == null) { | |||||
result.error("FlutterWindowManagerPlugin", "FlutterWindowManagerPlugin: ignored flag state change, current activity is null", null); | |||||
} | |||||
if (!validLayoutParams(result, flags)) { | |||||
return; | |||||
} | |||||
switch (call.method) { | |||||
case "addFlags": | |||||
activity.getWindow().addFlags(flags); | |||||
result.success(true); | |||||
break; | |||||
case "clearFlags": | |||||
activity.getWindow().clearFlags(flags); | |||||
result.success(true); | |||||
break; | |||||
default: | |||||
result.notImplemented(); | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,216 @@ | |||||
package com.cyhd.henhoandroid.plugin; | |||||
import android.content.Context; | |||||
import android.content.Intent; | |||||
import android.content.pm.PackageInfo; | |||||
import android.content.pm.PackageManager; | |||||
import android.graphics.Bitmap; | |||||
import android.net.Uri; | |||||
import android.util.Log; | |||||
import com.google.android.gms.common.ConnectionResult; | |||||
import com.google.android.gms.common.GoogleApiAvailability; | |||||
import java.io.ByteArrayOutputStream; | |||||
import java.util.ArrayList; | |||||
import java.util.List; | |||||
import io.flutter.plugin.common.MethodCall; | |||||
import io.flutter.plugin.common.MethodChannel; | |||||
import io.flutter.plugin.common.MethodChannel.MethodCallHandler; | |||||
import io.flutter.plugin.common.MethodChannel.Result; | |||||
import io.flutter.plugin.common.PluginRegistry.Registrar; | |||||
import io.flutter.view.FlutterView; | |||||
/** | |||||
* ScreenshotShareImagePlugin | |||||
*/ | |||||
public class ScreenShot implements MethodCallHandler { | |||||
private Registrar registrar; | |||||
private FlutterView flutterView; | |||||
private MethodChannel channel; | |||||
private Context context; | |||||
public static double pi = 3.1415926535897932384626; | |||||
public static double x_pi = 3.14159265358979324 * 3000.0 / 180.0; | |||||
public ScreenShot(Context context, Registrar registrar, FlutterView flutterView, MethodChannel channel) { | |||||
this.context = context; | |||||
this.registrar = registrar; | |||||
this.flutterView = flutterView; | |||||
this.channel = channel; | |||||
this.channel.setMethodCallHandler(this); | |||||
} | |||||
/** | |||||
* Plugin registration. | |||||
*/ | |||||
public static void registerWith(Context context, Registrar registrar) { | |||||
final MethodChannel channel = new MethodChannel(registrar.messenger(), "make.photo.screen.hibok"); | |||||
channel.setMethodCallHandler(new ScreenShot(context, registrar, registrar.view(), channel)); | |||||
} | |||||
@Override | |||||
public void onMethodCall(MethodCall call, Result result) { | |||||
if (call.method.equals("makePhotoScreen")) { | |||||
takeScreenshot(result); | |||||
} else if (call.method.equals("getListForMap")) { | |||||
getOtherMapApp(result); | |||||
} else if (call.method.equals("openMapForOth")) { | |||||
String mapType = call.argument("mapType"); | |||||
ArrayList<Double> lanLng = call.argument("latLng"); | |||||
String address = call.argument("address"); | |||||
Log.d("1", "地址参数 " + address); | |||||
openMapForOth(mapType, lanLng, address); | |||||
} else if(call.method.equals("isSupportGoogle")){ | |||||
result.success(onCheckGooglePlayServices()); | |||||
} | |||||
else { | |||||
result.notImplemented(); | |||||
} | |||||
} | |||||
private void getOtherMapApp(Result result) { | |||||
//获取packagemanager | |||||
final PackageManager packageManager = context.getPackageManager(); | |||||
//获取所有已安装程序的包信息 | |||||
List<PackageInfo> packageInfos = packageManager.getInstalledPackages(0); | |||||
//用于存储所有已安装程序的包名 | |||||
List<String> packageNames = new ArrayList<String>(); | |||||
//从pinfo中将包名字逐一取出,压入pName list中 | |||||
if (packageInfos != null) { | |||||
for (int i = 0; i < packageInfos.size(); i++) { | |||||
String packName = packageInfos.get(i).packageName; | |||||
packageNames.add(packName); | |||||
} | |||||
} | |||||
ArrayList mapList = new ArrayList(); | |||||
if (packageNames.contains("com.baidu.BaiduMap")) { | |||||
mapList.add("baidu"); | |||||
} | |||||
if (packageNames.contains("com.autonavi.minimap")) { | |||||
mapList.add("minimap"); | |||||
} | |||||
if (packageNames.contains("com.google.android.apps.maps")) { | |||||
mapList.add("google"); | |||||
} | |||||
result.success(mapList); | |||||
} | |||||
private void openMapForOth(String mapType, ArrayList latLng, String address) { | |||||
Log.d("1", mapType); | |||||
if (mapType.equals("minimap")) { | |||||
Log.d("1", "打开高德地图 " + address); | |||||
String uri = String.format("androidamap://viewReGeo?sourceApplication=amap&lat=%f&lon=%f&dev=1", latLng.get(0), latLng.get(1)); | |||||
Intent intent = new Intent(); | |||||
intent.setAction(Intent.ACTION_VIEW); | |||||
intent.addCategory(Intent.CATEGORY_DEFAULT); | |||||
intent.setPackage("com.autonavi.minimap"); | |||||
intent.setData(Uri.parse(uri)); | |||||
context.startActivity(intent); | |||||
} else if (mapType.equals("baidu")) { | |||||
Log.d("1", "打开百度地图"); | |||||
double[] location = gcj02_To_Bd09((double) latLng.get(0), (double) latLng.get(1)); | |||||
String uri = String.format("baidumap://map/geocoder?location=%f,%f&src=com.cyhd.henhoandroid", | |||||
location[0], location[1]); | |||||
Intent intent = new Intent(); | |||||
intent.setData(Uri.parse(uri)); | |||||
context.startActivity(intent); | |||||
} else if (mapType.equals("google")) { | |||||
Log.d("1", "打开谷歌地图" + address); | |||||
String gmmIntentUri = String.format("https://ditu.google.com/maps/dir/?q=%f,%f&destination=%s", | |||||
latLng.get(0), latLng.get(1), address); | |||||
Intent mapIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(gmmIntentUri)); | |||||
mapIntent.setPackage("com.google.android.apps.maps"); | |||||
context.startActivity(mapIntent); | |||||
} | |||||
} | |||||
/** | |||||
* 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换算法 将 GCJ-02 坐标转换成 BD-09 坐标 | |||||
* | |||||
* @param lat | |||||
* @param lon | |||||
*/ | |||||
private double[] gcj02_To_Bd09(double lat, double lon) { | |||||
double x = lon, y = lat; | |||||
double z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi); | |||||
double theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi); | |||||
double tempLon = z * Math.cos(theta) + 0.0065; | |||||
double tempLat = z * Math.sin(theta) + 0.006; | |||||
double[] gps = {tempLat, tempLon}; | |||||
return gps; | |||||
} | |||||
private void takeScreenshot(Result result) { | |||||
try { | |||||
Bitmap bitmap = flutterView.getBitmap(); | |||||
ByteArrayOutputStream baos = new ByteArrayOutputStream(); | |||||
boolean isSuccess = bitmap.compress(Bitmap.CompressFormat.JPEG, 80, baos); | |||||
result.success(isSuccess ? baos.toByteArray() : ""); | |||||
} catch (Throwable e) { | |||||
e.printStackTrace(); | |||||
} | |||||
} | |||||
/** | |||||
* 检查 Google Play 服务 | |||||
*/ | |||||
private boolean onCheckGooglePlayServices() { | |||||
// 验证是否已在此设备上安装并启用Google Play服务,以及此设备上安装的旧版本是否为此客户端所需的版本 | |||||
int code = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context); | |||||
if (code == ConnectionResult.SUCCESS) { | |||||
// 支持Google服务 | |||||
return true; | |||||
} else { | |||||
return false; | |||||
// /** | |||||
// * 依靠 Play 服务 SDK 运行的应用在访问 Google Play 服务功能之前,应始终检查设备是否拥有兼容的 Google Play 服务 APK。 | |||||
// * 我们建议您在以下两个位置进行检查:主 Activity 的 onCreate() 方法中,及其 onResume() 方法中。 | |||||
// * onCreate() 中的检查可确保该应用在检查成功之前无法使用。 | |||||
// * onResume() 中的检查可确保当用户通过一些其他方式返回正在运行的应用(比如通过返回按钮)时,检查仍将继续进行。 | |||||
// * 如果设备没有兼容的 Google Play 服务版本,您的应用可以调用以下方法,以便让用户从 Play 商店下载 Google Play 服务。 | |||||
// * 它将尝试在此设备上提供Google Play服务。如果Play服务已经可用,则Task可以立即完成返回。 | |||||
// */ | |||||
// GoogleApiAvailability.getInstance().makeGooglePlayServicesAvailable(this); | |||||
// | |||||
// // 或者使用以下代码 | |||||
// | |||||
// /** | |||||
// * 通过isUserResolvableError来确定是否可以通过用户操作解决错误 | |||||
// */ | |||||
// if (GoogleApiAvailability.getInstance().isUserResolvableError(code)) { | |||||
// /** | |||||
// * 返回一个对话框,用于解决提供的errorCode。 | |||||
// * @param activity 用于创建对话框的父活动 | |||||
// * @param code 通过调用返回的错误代码 | |||||
// * @param activity 调用startActivityForResult时给出的requestCode | |||||
// */ | |||||
// GoogleApiAvailability.getInstance().getErrorDialog(this, code, 200).show(); | |||||
// } | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,12 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<!-- Modify this file to customize your launch splash screen --> | |||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | |||||
<item android:drawable="@android:color/white" /> | |||||
<!-- You can insert your own image assets here --> | |||||
<!-- <item> | |||||
<bitmap | |||||
android:gravity="center" | |||||
android:src="@mipmap/launch_image" /> | |||||
</item> --> | |||||
</layer-list> |
@@ -0,0 +1,13 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<resources> | |||||
<string name="app_name">HiBok</string> | |||||
<!-- Replace "000000000000" with your Facebook App ID here. --> | |||||
<string name="facebook_app_id">473720630090702</string> | |||||
<!-- | |||||
Replace "000000000000" with your Facebook App ID here. | |||||
**NOTE**: The scheme needs to start with `fb` and then your ID. | |||||
--> | |||||
<string name="fb_login_protocol_scheme">fb473720630090702</string> | |||||
</resources> |
@@ -0,0 +1,8 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<resources> | |||||
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar"> | |||||
<!-- Show a splash screen on the activity. Automatically removed when | |||||
Flutter draws its first frame --> | |||||
<item name="android:windowBackground">@drawable/launch_background</item> | |||||
</style> | |||||
</resources> |
@@ -0,0 +1,7 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<paths> | |||||
<external-path path="Android/data/com.cyhd.henhoandroid/" name="files_root" /> | |||||
<external-path path="." name="external_storage_root" /> | |||||
<external-path name="download" path="Download/"/> | |||||
<cache-path name="name" path="." /> | |||||
</paths> |
@@ -0,0 +1,6 @@ | |||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.cyhd.henhoandroid"> | |||||
<!-- Flutter needs it to communicate with the running application | |||||
to allow setting breakpoints, to provide hot reload, etc. | |||||
--> | |||||
<uses-permission android:name="android.permission.INTERNET"/> | |||||
</manifest> |
@@ -0,0 +1,88 @@ | |||||
buildscript { | |||||
ext.kotlin_version = '1.3.61' | |||||
repositories { | |||||
google() | |||||
jcenter() | |||||
// maven { url 'https://maven.aliyun.com/repository/google' } | |||||
// maven{ url 'https://maven.aliyun.com/repository/jcenter'} | |||||
maven { | |||||
url 'http://download.flutter.io' | |||||
} | |||||
maven { url 'http://developer.huawei.com/repo/'} | |||||
} | |||||
dependencies { | |||||
classpath 'com.android.tools.build:gradle:3.2.1' | |||||
classpath 'com.google.gms:google-services:4.2.0' | |||||
classpath 'com.huawei.agconnect:agcp:1.0.0.300' | |||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | |||||
} | |||||
} | |||||
allprojects { | |||||
repositories { | |||||
google() | |||||
jcenter() | |||||
// maven { url 'https://maven.aliyun.com/repository/google' } | |||||
// maven{ url 'https://maven.aliyun.com/repository/jcenter'} | |||||
maven { | |||||
url 'http://download.flutter.io' | |||||
} | |||||
maven { url'http://developer.huawei.com/repo/'} | |||||
} | |||||
} | |||||
rootProject.buildDir = '../build' | |||||
subprojects { | |||||
project.buildDir = "${rootProject.buildDir}/${project.name}" | |||||
configurations.all { | |||||
resolutionStrategy { | |||||
resolutionStrategy.eachDependency { details -> | |||||
if (details.requested.group == 'androidx.core') { | |||||
details.useVersion "1.0.1" | |||||
} | |||||
if (details.requested.group == 'androidx.lifecycle') { | |||||
details.useVersion "2.0.0-rc01" | |||||
} | |||||
if (details.requested.group == 'androidx.legacy') { | |||||
details.useVersion "1.0.0-rc01" | |||||
} | |||||
if (details.requested.group == 'androidx.versionedparcelable') { | |||||
details.useVersion "1.0.0" | |||||
} | |||||
if (details.requested.group == 'com.google.android.gms') { | |||||
details.useVersion "17.0.0" | |||||
} | |||||
if (details.requested.group == 'androidx.fragment') { | |||||
details.useVersion "1.0.0" | |||||
} | |||||
if (details.requested.group == 'androidx.appcompat') { | |||||
details.useVersion "1.0.1" | |||||
} | |||||
if (details.requested.group == 'androidx.annotation') { | |||||
details.useVersion "1.1.0" | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} | |||||
subprojects { | |||||
project.evaluationDependsOn(':app') | |||||
} | |||||
task clean(type: Delete) { | |||||
delete rootProject.buildDir | |||||
} | |||||
tasks.withType(JavaCompile) { | |||||
options.encoding = "UTF-8" | |||||
} |
@@ -0,0 +1,5 @@ | |||||
org.gradle.jvmargs=-Xmx1536M | |||||
android.useAndroidX=true | |||||
android.enableJetifier=true | |||||
android.enableR8=true |
@@ -0,0 +1,6 @@ | |||||
#Mon Nov 18 15:39:25 CST 2019 | |||||
distributionBase=GRADLE_USER_HOME | |||||
distributionPath=wrapper/dists | |||||
zipStoreBase=GRADLE_USER_HOME | |||||
zipStorePath=wrapper/dists | |||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip |
@@ -0,0 +1,15 @@ | |||||
include ':app' | |||||
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() | |||||
def plugins = new Properties() | |||||
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') | |||||
if (pluginsFile.exists()) { | |||||
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } | |||||
} | |||||
plugins.each { name, path -> | |||||
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() | |||||
include ":$name" | |||||
project(":$name").projectDir = pluginDirectory | |||||
} |
@@ -0,0 +1,2 @@ | |||||
include ':app' | |||||