GithubHelp home page GithubHelp logo

rhymelph / r_upgrade Goto Github PK

View Code? Open in Web Editor NEW
421.0 7.0 69.0 77.74 MB

🆙🚀 Flutter application upgrade/ Flutter App Upgrade /Flutter App Update/Flutter Update / download Plug-in (with notice bar progress), supports full upgrade, hot update and incremental upgrade

Home Page: http://rhyme95.win/r_upgrade/

License: Apache License 2.0

Java 61.66% Swift 3.24% Objective-C 0.19% Dart 33.78% Ruby 1.06% Kotlin 0.07%
upgrade download flutter-plugin flutter app-downloader flutter-update-apk flutter-update-version version-manager version version-control

r_upgrade's Introduction

r_upgrade

pub package

Android and IOS upgrade plugin.

  • [✔] Jump link mode upgrade
  • [✔] Android Get user installed android stores.
  • [✔] Android Get version from android stores(only support GooglePlay、XiaoMi、Tencent)
  • [✔] Android Jump to store mode upgrade
  • [✔] Android Download APK using download link
    • [✔] Monitor download information
    • [✔] cancel/pause/continue download
    • [✔] Get download status according to ID
    • [✔] Install app according to ID
    • [✔] Get the last download ID (based on the version name and version number)
    • [✔] Modify the information displayed in the notification bar
  • [✔] Android hot upgrade
  • [✔] Android increment upgrade
  • [✔] IOS Jump to Appstore upgrade according to appid
  • [✔] IOS Get the current online version of Appstore according to appid

For the development of this plug-in, I haven't had a good meal for a long time. I hope you can click on the sponsor and give a little bit of money. Thank you!

List

Getting Started

1. Use Plugin:

  • add this code in pubspec.yaml
dependencies:
  r_upgrade: last version

2. Upgrade from your website ( Android or IOS )

    void upgradeFromUrl()async{
        bool isSuccess =await RUpgrade.upgradeFromUrl(
                    'https://www.google.com',
                  );
        print(isSuccess);
    }

Android Platform

1.Get android store list.

    void getAndroidStores() async {
       final stores = await RUpgrade.androidStores;
    }

2.Get version from android store.

    void getVersionName() async {
       final versionName = await RUpgrade.getVersionFromAndroidStore(AndroidStore.GOOGLE_PLAY);
    }

3. App upgrade from store.

    void upgradeFromAndroidStore(){
       bool isSuccess = await RUpgrade.upgradeFromAndroidStore(AndroidStore.GOOGLE_PLAY);
       print('${isSuccess?'jump success':'jump error'}');
    }

4. App upgrade from download link.

make sure your application had this permission and request dynamic permission.

    <!--(if you want to upload google store,can not add this permission)-->
    <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
     <!--(if you want to use silent install,need to add this permission,and app is system app-->
    <uses-permission android:name="android.permission.INSTALL_PACKAGES" tools:ignore="ProtectedPermissions"/>

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

1. Add Upgrade Download Listener

RUpgrade.stream.listen((DownloadInfo info){
  ///...
});

info:

param desc
(int) id download id
(int) max_length download max bytes length (bytes)
(int) current_length download current bytes length (bytes)
(double) percent download percent 0-100
(double) planTime download plan time /s (X.toStringAsFixed(0))
(String) path download file path
(double) speed download speed kb/s
(DownloadStatus) status download status
STATUS_PAUSED
STATUS_PENDING
STATUS_RUNNING
STATUS_SUCCESSFUL
STATUS_FAILED
STATUS_CANCEL

2. Upgrade your application

This upgrade have two part. useDownloadManager:

  • true: Use system DownloadManagerto download
    • advantage:Simple, use system.
    • Inferiority:can not use http download , can not click the notification pause downloading, can not pause and continue download by network status etc...
    • support: RUpgrade.streaminstallcancel
  • false: Use Service download(default use)
    • advantage:Power, support http/https download, support auto pause and continue download by network status etc..
    • Inferiority:No bugs found yet. If you find a bug, you are welcome to issue
    • support: RUpgrade.streaminstallcancel
    // [installType] downloaded finish will use install type to install apk.
    // [apkName] apk name (such as `release.apk`)
    // [notificationVisibility] notification visibility.
    // [notificationStyle] download notification show style about content text, only support [useDownloadManager]==false.
    // [useDownloadManager] if true will use DownloadManager,false will use my service ,
    //         if true will no use [pause] , [upgradeWithId] , [getDownloadStatus] , [getLastUpgradedId] methods.
    // [upgradeFlavor] you can use [RUpgradeFlavor.normal] , [RUpgradeFlavor.hotUpgrade] , [RUpgradeFlavor.incrementUpgrade] flavor
    void upgrade() async {
      int id = await RUpgrade.upgrade(
                 'https://raw.githubusercontent.com/rhymelph/r_upgrade/master/apk/app-release.apk',
                 apkName: 'app-release.apk', installType: RUpgradeInstallType.normal,);
    }

New upgraded flavor:(no support use DownloadManager)

enum RUpgradeFlavor {
  normal, // full upgrade
  hotUpgrade, // hot upgrade
  incrementUpgrade, // increment upgrade
}

3. Cancel Download

    void cancel() async {
      bool isSuccess=await RUpgrade.cancel(id);
    }

4. Install Apk

  • use download id install
    void install() async {
      bool isSuccess=await RUpgrade.install(id);
    }
  • use file path install
    void installByPath(String path) async {
      bool isSuccess=await RUpgrade.installByPath(path);
     }
  • install type
/// [RUpgrade.upgradeWithId][RUpgrade.upgrade][RUpgrade.install][RUpgrade.installByPath]
enum RUpgradeInstallType {
  normal,//normal install
  silent,//silent install
  none,// not install
}

5. Pause Download

    void pause() async {
      bool isSuccess=await RUpgrade.pause(id);
    }

6. Continue Download

    void pause() async {
      bool isSuccess=await RUpgrade.upgradeWithId(id);
      /// return true.
      /// * if download status is [STATUS_PAUSED] or [STATUS_FAILED] or [STATUS_CANCEL], will restart running.
      /// * if download status is [STATUS_RUNNING] or [STATUS_PENDING], nothing happened.
      /// * if download status is [STATUS_SUCCESSFUL] , will install apk.
      ///
      /// return false.
      /// * if not found the id , will return [false].
    }

7. Get the last upgrade id

    void getLastUpgradeId() async {
     int id = await RUpgrade.getLastUpgradedId();
    }

8. Get the download status from id

    void getDownloadStatus()async{
    DownloadStatus status = await RUpgrade.getDownloadStatus(id);
   }

9. Increment Upgrade

  • 1.Download bsdiff to local.
  • 2.Prepare two installation packages, one is the one to be upgraded( old.apk ), an installation package that you need to update( new.apk )
  • 3.Switch to the 'bsdiff' directory downloaded above on the command line, and run the command./bsdiff old.apk new.apk increment.patch
  • 4.Put theincrement.patchUpload to server
  • 5.use RUpgrade.upgrade(...,upgradeFlavor:RUpgradeFlavor.incrementUpgrade)download file
  • 6.use RUpgrade.install(id) install apk.

The code is as follows:

    int id;
    void incrementUpgrade(){
        id = await RUpgrade.upgrade(
                'https://mydata-1252536312.cos.ap-guangzhou.myqcloud.com/r_upgrade.patch',
                fileName: 'r_upgrade.patch',
                useDownloadManager: false,
                installType: RUpgradeInstallType.none,
                upgradeFlavor: RUpgradeFlavor.incrementUpgrade,
              );
    }

    void install(){
        try {
            await RUpgrade.install(id);
        } catch (e) {
            _state.currentState
                .showSnackBar(SnackBar(content: Text('failure!')));
        }
    }

10. Hot Upgrade

  • you can use this id to hot upgrade,but download file is zip. include three file [isolate_snapshot_data]、[kernel_blob.bin]、[vm_snapshot_data].Your can use flutter build bundle generate.
 flutter build bundle
  • generate file path form ./build/flutter_assets and packaged into zip.
|- AssetManifest.json
|- FontManifest.json
|- fonts
    |- ...
|- isolate_snapshot_data *
|- kernel-blob.bin       *
|- LICENSE
|- packages
    |- ...
|- vm_snapshot_data      *
  • use RUpgrade.upgrade(...,upgradeFlavor:RUpgradeFlavor.hotUpgrade)download file.
  • download complete you can use download id to hot upgrade
          bool isSuccess = await RUpgrade.install(id);
           if (isSuccess) {
              _state.currentState
                    .showSnackBar(SnackBar(content: Text('Hot update succeeded, exit the application after 3S, please enter again')));
                Future.delayed(Duration(seconds: 3)).then((_){
                  SystemNavigator.pop(animated: true);
                });
           }else{
              _state.currentState
                    .showSnackBar(SnackBar(content: Text('Hot update failed, please wait for update package download to complete')));
              }

At present, the hot update is still in the testing stage, only supporting the change of the flutter code, not supporting the resource file, etc. the author of the plug-in is not responsible for all the consequences caused by the hot update, and the user is responsible for it.

Android Platform Notification Bar

If you want to customize the content displayed in the download notification bar, you can do so, modify or add files project/android/app/main/res/values/r_upgrade_value.xml,add the following code

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="r_upgrade_download_speech">%.0f kb/s</string>
    <string name="r_upgrade_download_planTime">%.0fs left</string>
    <string name="r_upgrade_download_finish">Download finished</string>
    <string name="r_upgrade_download_paused">Download paused</string>
    <string name="r_upgrade_download_failed">Download failed</string>
</resources>

And then.When you use upgrade method,you should set the notificationStyle param.

/// Notification show style about content text
enum NotificationStyle {
  speechAndPlanTime, // 100kb/s 1s left
  planTimeAndSpeech, // 1s left 100kb/s
  speech,// 100kb/s
  planTime, // 1s left
  none, //
}

IOS Platform

1.Go to the AppStore Upgrade

    void upgradeFromAppStore() async {
        bool isSuccess =await RUpgrade.upgradeFromAppStore(
                 'your AppId',//such as:WeChat AppId:414478124
                 false
              );
        print(isSuccess);
    }

2.Get the last version form AppStore

    void getVersionFromAppStore() async {
        String versionName = await RUpgrade.getVersionFromAppStore(
                'your AppId',//such as:WeChat AppId:414478124
                false
               );
        print(versionName);
    }

LICENSE

Copyright 2021 rhymelph

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

r_upgrade's People

Contributors

rhymelph avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

r_upgrade's Issues

Android 12 FLAG_IMMUTABLE

FLAG_IMMUTABLE is missing for PendingIntent in UpgradeNotification.java:

E/AndroidRuntime(11658): java.lang.RuntimeException: Error receiving broadcast Intent { act=com.example.r_upgrade.DOWNLOAD_STATUS flg=0x10 (has extras) } in com.example.r_upgrade.common.UpgradeManager$3@7fc8eed
E/AndroidRuntime(11658): at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$LoadedApk$ReceiverDispatcher$Args(LoadedApk.java:1689)
E/AndroidRuntime(11658): at android.app.LoadedApk$ReceiverDispatcher$Args$$ExternalSyntheticLambda0.run(Unknown Source:2)
E/AndroidRuntime(11658): at android.os.Handler.handleCallback(Handler.java:938)
E/AndroidRuntime(11658): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(11658): at android.os.Looper.loopOnce(Looper.java:201)
E/AndroidRuntime(11658): at android.os.Looper.loop(Looper.java:288)
E/AndroidRuntime(11658): at android.app.ActivityThread.main(ActivityThread.java:7838)
E/AndroidRuntime(11658): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(11658): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
E/AndroidRuntime(11658): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
E/AndroidRuntime(11658): Caused by: java.lang.IllegalArgumentException: [...]: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.

run for ios error

1 warning generated.
~/.pub-cache/hosted/pub.flutter-io.cn/r_upgrade-0.3.2+3/ios/Classes/RUpgradePlugin.m:2:9: fatal error: 'r_upgrade/r_upgrade-Swift.h' file not found
#import <r_upgrade/r_upgrade-Swift.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

fatal error: 'r_upgrade/r_upgrade-Swift.h' file not found

看过其他issues里面的解决方案了 对我都不生效
理论上podfile里面使用 user_framework 可以安装上
但是如果我user_framework 我其他的很多库就不能用了
flutter是2.5版本 xcode是13 都是最新版
项目当时创立的时候是OC的 楼主说的那个删掉重新创建swift版本的风险对我来说太大了
请问作者还有其他的解决办法吗
作者能否提供个联系方式啊

IOS编译报错,急急急

提示:

  • r_upgrade does not specify a Swift version and none of the targets (Runner) integrating it have the SWIFT_VERSION attribute set. Please contact the author or set the SWIFT_VERSION attribute in at least one of the targets that integrate this pod.

这个好像是要作者你添加各配置

作者微信多少?

IOS编译失败

fatal error: 'r_upgrade/r_upgrade-Swift.h' file not found
#import <r_upgrade/r_upgrade-Swift.h>

按照 #5 这个issue里面的方法操作了,没用

Unexpected Exception On Application Close

Flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.8.1, on Microsoft Windows [Version 10.0.22000.434], locale en-ID)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
[✗] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[!] Android Studio (not installed)
[✓] VS Code, 64-bit edition (version 1.63.2)
[✓] Connected device (2 available)

Exception

E/ActivityThread( 6400): Activity rick.roll.MainActivity has leaked IntentReceiver com.example.r_upgrade.common.UpgradeManager$3@1b77883 that was originally registered here. Are you missing a call to unregisterReceiver()?
E/ActivityThread( 6400): android.app.IntentReceiverLeaked: Activity rick.roll.caraka.MainActivity has leaked IntentReceiver com.example.r_upgrade.common.UpgradeManager$3@1b77883 that was originally registered here. Are you missing a call to unregisterReceiver()?
E/ActivityThread( 6400): 	at android.app.LoadedApk$ReceiverDispatcher.<init>(LoadedApk.java:1429)
E/ActivityThread( 6400): 	at android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:1210)
E/ActivityThread( 6400): 	at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1476)
E/ActivityThread( 6400): 	at android.app.ContextImpl.registerReceiver(ContextImpl.java:1449)
E/ActivityThread( 6400): 	at android.app.ContextImpl.registerReceiver(ContextImpl.java:1437)
E/ActivityThread( 6400): 	at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:623)
E/ActivityThread( 6400): 	at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:623)
E/ActivityThread( 6400): 	at com.example.r_upgrade.common.UpgradeManager.<init>(UpgradeManager.java:101)
E/ActivityThread( 6400): 	at com.example.r_upgrade.RUpgradePlugin.<init>(RUpgradePlugin.java:39)
E/ActivityThread( 6400): 	at com.example.r_upgrade.RUpgradePlugin.onAttachedToActivity(RUpgradePlugin.java:71)
E/ActivityThread( 6400): 	at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.add(FlutterEngineConnectionRegistry.java:155)
E/ActivityThread( 6400): 	at io.flutter.plugins.GeneratedPluginRegistrant.registerWith(GeneratedPluginRegistrant.java:139)
E/ActivityThread( 6400): 	at java.lang.reflect.Method.invoke(Native Method)
E/ActivityThread( 6400): 	at io.flutter.embedding.engine.plugins.util.GeneratedPluginRegister.registerGeneratedPlugins(GeneratedPluginRegister.java:80)
E/ActivityThread( 6400): 	at io.flutter.embedding.android.FlutterActivity.configureFlutterEngine(FlutterActivity.java:1004)
E/ActivityThread( 6400): 	at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onAttach(FlutterActivityAndFragmentDelegate.java:191)
E/ActivityThread( 6400): 	at io.flutter.embedding.android.FlutterActivity.onCreate(FlutterActivity.java:459)
E/ActivityThread( 6400): 	at android.app.Activity.performCreate(Activity.java:7136)
E/ActivityThread( 6400): 	at android.app.Activity.performCreate(Activity.java:7127)
E/ActivityThread( 6400): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
E/ActivityThread( 6400): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
E/ActivityThread( 6400): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
E/ActivityThread( 6400): 	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
E/ActivityThread( 6400): 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
E/ActivityThread( 6400): 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
E/ActivityThread( 6400): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
E/ActivityThread( 6400): 	at android.os.Handler.dispatchMessage(Handler.java:106)
E/ActivityThread( 6400): 	at android.os.Looper.loop(Looper.java:193)
E/ActivityThread( 6400): 	at android.app.ActivityThread.main(ActivityThread.java:6669)
E/ActivityThread( 6400): 	at java.lang.reflect.Method.invoke(Native Method)
E/ActivityThread( 6400): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/ActivityThread( 6400): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

Step to produce exception

  1. Create new Flutter project (default code inside, no changes)
  2. Add r_upgrade into pubspec.yaml (latest version, 0.3.7+2)
  3. Run project (debug, profile, release doesn't matter)
  4. On emulator or device, press back button to close the app (exception will appear in debug console)
  5. On some occasion, Android pop-up dialog will appear with this message "MyApp keeps stopping", which is not pleasant for end user

Did some test using r_upgrade v0.3.3 to v0.3.7+2, all of them gave exact same exception

下载完apk ,安装的时候报错,使用的手机是三星,android 版本6.0.1,

试了一下,用你的demo 在这个手机上也不行

D/Instrumentation(16066): checkStartActivityResult() : Intent { act=android.intent.action.VIEW dat=content://com.example.r_upgrade_example.fileProvider/external_storage_root/Download/r_upgrade.apk typ=application/vnd.android.package-archive flg=0x10000001 }
D/Instrumentation(16066): checkStartActivityResult() : intent is instance of [Intent].
E/MethodChannel#com.rhyme/r_upgrade_method(16066): Failed to handle method call
E/MethodChannel#com.rhyme/r_upgrade_method(16066): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=content://com.example.r_upgrade_example.fileProvider/external_storage_root/Download/r_upgrade.apk typ=application/vnd.android.package-archive flg=0x10000001 }
E/MethodChannel#com.rhyme/r_upgrade_method(16066): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1879)
E/MethodChannel#com.rhyme/r_upgrade_method(16066): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1546)
E/MethodChannel#com.rhyme/r_upgrade_method(16066): at android.app.ContextImpl.startActivity(ContextImpl.java:745)
E/MethodChannel#com.rhyme/r_upgrade_method(16066): at android.app.ContextImpl.startActivity(ContextImpl.java:727)
E/MethodChannel#com.rhyme/r_upgrade_method(16066): at android.content.ContextWrapper.startActivity(ContextWrapper.java:345)
E/MethodChannel#com.rhyme/r_upgrade_method(16066): at android.content.ContextWrapper.startActivity(ContextWrapper.java:345)
E/MethodChannel#com.rhyme/r_upgrade_method(16066): at com.example.r_upgrade.common.UpgradeManager.installApk(UpgradeManager.java:266)
E/MethodChannel#com.rhyme/r_upgrade_method(16066): at com.example.r_upgrade.common.UpgradeManager.installApkById(UpgradeManager.java:284)
E/MethodChannel#com.rhyme/r_upgrade_method(16066): at com.example.r_upgrade.method.RUpgradeMethodEnum$3.handler(RUpgradeMethodEnum.java:33)
E/MethodChannel#com.rhyme/r_upgrade_method(16066): at com.example.r_upgrade.method.RUpgradeMethodCallHandler.onMethodCall(RUpgradeMethodCallHandler.java:13)
E/MethodChannel#com.rhyme/r_upgrade_method(16066): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:231)
E/MethodChannel#com.rhyme/r_upgrade_method(16066): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:93)
E/MethodChannel#com.rhyme/r_upgrade_method(16066): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:642)
E/MethodChannel#com.rhyme/r_upgrade_method(16066): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#com.rhyme/r_upgrade_method(16066): at android.os.MessageQueue.next(MessageQueue.java:323)
E/MethodChannel#com.rhyme/r_upgrade_method(16066): at android.os.Looper.loop(Looper.java:135)
E/MethodChannel#com.rhyme/r_upgrade_method(16066): at android.app.ActivityThread.main(ActivityThread.java:7224)
E/MethodChannel#com.rhyme/r_upgrade_method(16066): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#com.rhyme/r_upgrade_method(16066): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
E/MethodChannel#com.rhyme/r_upgrade_method(16066): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
E/flutter (16066): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(error, No Activity found to handle Intent { act=android.intent.action.VIEW dat=content://com.example.r_upgrade_example.fileProvider/external_storage_root/Download/r_upgrade.apk typ=application/vnd.android.package-archive flg=0x10000001 }, null)
E/flutter (16066): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
E/flutter (16066): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:321:33)
E/flutter (16066):
E/flutter (16066): #2 RUpgrade.install (package:r_upgrade/r_upgrade.dart:81:33)
E/flutter (16066): #3 _MyAppState._buildAndroidPlatformWidget. (package:r_upgrade_example/main.dart:98:47)
E/flutter (16066): #4 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:706:14)
E/flutter (16066): #5 _InkResponseState.build. (package:flutter/src/material/ink_well.dart:789:36)
E/flutter (16066): #6 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24)
E/flutter (16066): #7 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:486:11)
E/flutter (16066): #8 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:264:5)
E/flutter (16066): #9 BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:236:7)
E/flutter (16066): #10 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:156:27)
E/flutter (16066): #11 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:222:20)
E/flutter (16066): #12 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22)
E/flutter (16066): #13 GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)
E/flutter (16066): #14 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)
E/flutter (16066): #15 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)
E/flutter (16066): #16 _rootRunUnary (dart:async/zone.dart:1138:13)
E/flutter (16066): #17 _CustomZone.runUnary (dart:async/zone.dart:1031:19)
E/flutter (16066): #18 _CustomZone.runUnaryGuarded (dart:async/zone.dart:933:7)
E/flutter (16066): #19 _invoke1 (dart:ui/hooks.dart:273:10)
E/flutter (16066): #20 _dispatchPointerDataPacket (dart:ui/hooks.dart:182:5)
E/flutter (16066):

build apk failed

FAILURE: Build failed with an exception.

  • Where:
    Build file '/Users/emery/.pub-cache/hosted/pub.flutter-io.cn/r_upgrade-0.3.1/android/build.gradle' line: 20

  • What went wrong:
    A problem occurred evaluating root project 'r_upgrade'.

Project with path ':r_upgrade' could not be found in root project 'r_upgrade'.

Android应用市场的支持程度

目前Android应用市场还是以各大手机厂商的应用市场下载安装为主,是否考虑添加vivo、oppo、魅族、联想等手机厂商的应用市场安装跳转支持

这是什么错

点了立即更新之后没有反应 报了两行错
D/r_upgrade.Service(26148): run: code=404
D/r_upgrade.Service(26148): handlerDownloadFailure: failure

2个必现的bug

  • miui 12
  • android 10
  • flutter stable

useDownloadManager: false 下载完成后通知栏的notification不会自动消失(notificationVisibility = NotificationVisibility.VISIBILITY_VISIBLE)

useDownloadManager: true的时候 拉起安装页面-不做任何操作,直接返回,一回到我们的app就会跳回到安装页(useDownloadManager为false的不会有这个问题),log疯狂输出如下

I/Timeline(11488): Timeline: Activity_launch_request time:127296962
D/r_upgrade.Manager(11488): queryTask: 下载成功
D/r_upgrade.AsyncTask(11488): content://downloads/all_downloads/59
I/Timeline(11488): Timeline: Activity_launch_request time:127297489
D/r_upgrade.Manager(11488): queryTask: 下载成功
D/r_upgrade.AsyncTask(11488): content://downloads/all_downloads/59
I/Timeline(11488): Timeline: Activity_launch_request time:127298032
D/r_upgrade.Manager(11488): queryTask: 下载成功
D/r_upgrade.AsyncTask(11488): content://downloads/all_downloads/59
I/Timeline(11488): Timeline: Activity_launch_request time:127298571

下载出现问题

example project release 版本 总是显示 下载失败
我的flutter版本 1.22.5

http code 301/302 失败

下载链接重定向后会导致下载失败,希望重定向后可以获取新链接继续下载

ios部分报错

bugly报错信息:

0 r_upgrade getInfoFromAppStore (SwiftRUpgradePlugin.swift:75)
1 r_upgrade getInfoFromAppStore (SwiftRUpgradePlugin.swift:75)
2 r_upgrade getVersionFromAppStore (SwiftRUpgradePlugin.swift:85)
3 r_upgrade handle (:0)
4 r_upgrade handle (:0)
5 Flutter 0x00000001014b4000 + 601920
6 Flutter 0x00000001014b4000 + 183728
7 Flutter 0x00000001014b4000 + 537792
8 Flutter 0x00000001014b4000 + 248976
9 Flutter 0x00000001014b4000 + 256264
10 CoreFoundation __CFCalendarCreateMatchingDateAfterStartDateMatchingComponents + 2936
11 CoreFoundation __CFCalendarCreateMatchingDateAfterStartDateMatchingComponents + 2192
12 CoreFoundation __CFCalendarEnumerateDates + 6492
13 CoreFoundation ___CFRunLoopDoSources0 + 52
14 CoreFoundation CFRunLoopRunSpecific + 480
15 GraphicsServices GSEventRunModal + 164
16 UIKitCore UIApplicationMain + 1944
17 Runner main (AppDelegate.swift:5)
18 libdyld.dylib 0x00000001b7020000 + 4828

使用flutter版本:1.17.5

型号大概是这些
QQ20200813-103240

app退出报错 Are you missing a call to unregisterReceiver()?

r_upgrade:0.3.5
com.example.r_upgrade.common.UpgradeManager$3@36e7e0c that was originally registered here. Are you missing a call to unregisterReceiver()?
E/ActivityThread(10921): android.app.IntentReceiverLeaked: Activity com.example.hmc_flutter_module.MainActivity has leaked IntentReceiver com.example.r_upgrade.common.UpgradeManager$3@36e7e0c that was originally registered here. Are you missing a call to unregisterReceiver()?

空指针了。

     Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void java.util.Timer.cancel()' on a null object reference
        at com.example.r_upgrade.common.UpgradeManager$3.onReceive(UpgradeManager.java:314)
        at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:1122)
        at android.os.Handler.handleCallback(Handler.java:751) 
        at android.os.Handler.dispatchMessage(Handler.java:95) 
        at android.os.Looper.loop(Looper.java:154) 
        at android.app.ActivityThread.main(ActivityThread.java:6119) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) 

Any API to get new version available or not from Google Store ?

Hi,
Appreciated for your working on r_upgrade and it's really helpful !
Full of features but I have only 1 question maybe I'm wrong since I'm new to APP world.

It's good to have getVersionFromAppStore to notify users new version on Apple Store.
Is there any API for Google Store ?

Thank you in advance for your feedback !

Android Back to Home: java.lang.NullPointerException

the log shows:

 Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void io.flutter.plugin.common.MethodChannel.setMethodCallHandler(io.flutter.plugin.common.MethodChannel$MethodCallHandler)' on a null object reference
        at com.example.r_upgrade.RUpgradePlugin.onDetachedFromEngine(RUpgradePlugin.java:62)
        at io.flutter.embedding.engine.FlutterEnginePluginRegistry.remove(FlutterEnginePluginRegistry.java:252)
        at io.flutter.embedding.engine.FlutterEnginePluginRegistry.remove(FlutterEnginePluginRegistry.java:260)

The code locates at

    @Override
    public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) {
        Intent intent = new Intent(binding.getApplicationContext(), UpgradeService.class);
        binding.getApplicationContext().stopService(intent);
        if (upgradeManager != null) {
            upgradeManager.dispose();
        }
        if (hotUpgradeManager != null) {
            hotUpgradeManager.dispose();
        }
        _channel.setMethodCallHandler(null);  // this is line 62. 
        _channel = null;
    }

ios upgradeFromAppStore

ios app已发布还不能通过appStore搜索到 通过链接下载下来点击升级 调用RUpgrade.upgradeFromAppStore app会闪退

android Q 下,报权限错误

W/System.err(32263): java.io.FileNotFoundException: /storage/emulated/0/Download/app-release.apk: open failed: EACCES (Permission denied)

在 安卓8.1 下的系统下,能正常使用。

sqlite报错

W/SQLiteConnectionPool(17929): A SQLiteConnection object for database '/data/user/0/com.xxx.app/databases/r_upgrade.db' was leaked!  Please fix your application to end transactions in progress properly and to close the database when it is no longer needed

连接池爆了,老哥修一下,复用一下连接。PS:不会原生,提不了PR ...
原因应该是在下载过程中记录下载进度频繁读写导致,复用一下连接即可解决。
如果下载的文件小还好,我测试时下载的文件是 2GB 的游戏

在debug模式下,使用r_upgrade后,每退出一次app都报一次错误

1、使用版本为: ^0.3.1

2、错误的信息为:
Activity com.xxx.MainActivity has leaked IntentReceiver com.example.r_upgrade.common.UpgradeManager$3@ba42023 that was originally registered here. Are you missing a call to unregisterReceiver()?

E/ActivityThread(18075): android.app.IntentReceiverLeaked: Activity com.xxx.MainActivity
has leaked IntentReceiver com.example.r_upgrade.common.UpgradeManager$3@ba42023 that was originally registered here.
Are you missing a call to unregisterReceiver()?

3、希望作者能解决这个问题

注: 感觉您这个插件蛮好用的

App Crash on INCREMENT Patch update.

log cat

05-14 19:36:58.865  1662  1881 I ActivityTaskManager: Fully drawn in.canews.movieroar/.MainActivity: +1s559ms
05-14 19:36:58.871 30945  8094 I anews.movieroa: Waiting for a blocking GC ProfileSaver
05-14 19:36:58.888 30945  8203 I DynamiteModule: Considering local module providerinstaller:0 and remote module providerinstaller:0
05-14 19:36:58.888 30945  8203 W ProviderInstaller: Failed to load providerinstaller module: No acceptable module found. Local version is 0 and remote version is 0.
05-14 19:36:58.903 30945  8203 I anews.movieroa: The ClassLoaderContext is a special shared library.
05-14 19:36:58.908 30945  8203 I anews.movieroa: The ClassLoaderContext is a special shared library.
05-14 19:36:58.945 30945  8203 V NativeCrypto: Registering com/google/android/gms/org/conscrypt/NativeCrypto's 287 native methods...
05-14 19:36:58.951  1339  2064 E statsd  : Found dropped events: 1 error -19 last atom tag 240 from uid 10510
05-14 19:36:58.961 30945  8203 I ProviderInstaller: Installed default security provider GmsCore_OpenSSL
05-14 19:36:58.976  1662  3772 D WifiNetworkFactory: got request NetworkRequest [ TRACK_DEFAULT id=1454, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10510 AdministratorUids: [] RequestorUid: 10510 RequestorPackageName: in.canews.movieroar] ] with score 60 and providerId 6
05-14 19:36:58.976  1662  3772 D UntrustedWifiNetworkFactory: got request NetworkRequest [ TRACK_DEFAULT id=1454, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10510 AdministratorUids: [] RequestorUid: 10510 RequestorPackageName: in.canews.movieroar] ] with score 60 and providerId 605-14 19:36:58.977  4391  4391 D PhoneSwitcherNetworkRequstListener: got request NetworkRequest [ TRACK_DEFAULT id=1454, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10510 AdministratorUids: [] RequestorUid: 10510 RequestorPackageName: in.canews.movieroar] ] with score 60 and providerId 6
05-14 19:36:58.979  1662  3819 D WIFI_AWARE_FACTORY: got request NetworkRequest [ TRACK_DEFAULT id=1454, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10510 AdministratorUids: [] RequestorUid: 10510 RequestorPackageName: in.canews.movieroar] ] with score 60 and providerId 6
05-14 19:36:58.979  1662  3820 D Ethernet: got request NetworkRequest [ TRACK_DEFAULT id=1454, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10510 AdministratorUids: [] RequestorUid: 10510 RequestorPackageName: in.canews.movieroar] ] with score 60 and providerId 6
05-14 19:36:59.301 30945  8192 D r_upgrade.Service: run: code=200
05-14 19:36:59.301 30945  8192 D r_upgrade.Service: run: maxLength:10232472
05-14 19:36:59.414   837  8650 D qc_adm  : ns 2627761 > expected_ns 2000000 (skipped 77)
05-14 19:36:59.423   837  8650 D qc_adm  : ns 2601875 > expected_ns 2000000 (skipped 77)
05-14 19:36:59.772 30945  8194 D r_upgrade.Service: handlerDownloadRunning: running queryTask: 下载中
05-14 19:36:59.772 30945  8194 D r_upgrade.Service: url: https://github.com/canewsin/test/releases/download/0/inc.patch
05-14 19:36:59.772 30945  8194 D r_upgrade.Service: ============>total:10232472,progress:1482203,14.17% , 1405.62kb/s , 预计:6s
05-14 19:36:59.800  5465  5465 D BoundBrokerSvc: onUnbind: Intent { act=com.google.android.gms.measurement.START pkg=com.google.android.gms }
05-14 19:36:59.853 20248 20287 D QCNEJ/WlanStaInfoRelay: Received action: android.net.wifi.RSSI_CHANGED
05-14 19:36:59.856  4308  6985 D QCNEJ/WlanStaInfoRelay: Received action: android.net.wifi.RSSI_CHANGED
05-14 19:36:59.911 10427 10484 I CarrierServices: [8038] bze.e: (PEv2-SM-130103966): DisabledState: event Connectivity event [null]
05-14 19:36:59.911 10427 10500 I CarrierServices: [8040] bsw.d: Connected state: [1], networkType: [WIFI]
05-14 19:36:59.926 10427 10502 I CarrierServices: [8041] cfn.m: No RCS Configuration was found in Bugle for simID: redacted-pii:sim_id[20-chars]
05-14 19:36:59.986  1662  1662 D NotificationService: 0|in.canews.movieroar|2|null|10510: granting content://settings/system/notification_sound
05-14 22:09:00.689     0     0 I         : Alarmtimer { AlarmManager', '44710671'}
05-14 19:37:00.272   854  1486 I SDM     : HWCDisplayBuiltIn::parseOutputBuffer: w 1080 h 2340 stride 1088 size 10186752 Bpp 4
05-14 19:37:00.273 30945  8194 D r_upgrade.Service: handlerDownloadRunning: running queryTask: 下载中
05-14 19:37:00.273 30945  8194 D r_upgrade.Service: url: https://github.com/canewsin/test/releases/download/0/inc.patch
05-14 19:37:00.273 30945  8194 D r_upgrade.Service: ============>total:10232472,progress:3464667,33.66% , 3870.97kb/s , 预计:2s
05-14 19:37:00.771 30945  8194 D r_upgrade.Service: handlerDownloadRunning: running queryTask: 下载中
05-14 19:37:00.771 30945  8194 D r_upgrade.Service: url: https://github.com/canewsin/test/releases/download/0/inc.patch
05-14 19:37:00.771 30945  8194 D r_upgrade.Service: ============>total:10232472,progress:5529051,53.96% , 4080.97kb/s , 预计:1s
05-14 19:37:01.271 30945  8194 D r_upgrade.Service: handlerDownloadRunning: running queryTask: 下载中
05-14 19:37:01.271 30945  8194 D r_upgrade.Service: url: https://github.com/canewsin/test/releases/download/0/inc.patch
05-14 19:37:01.271 30945  8194 D r_upgrade.Service: ============>total:10232472,progress:7773659,75.97% , 4428.28kb/s , 预计:1s
05-14 19:37:01.773 30945  8194 D r_upgrade.Service: handlerDownloadRunning: running queryTask: 下载中
05-14 19:37:01.773 30945  8194 D r_upgrade.Service: url: https://github.com/canewsin/test/releases/download/0/inc.patch
05-14 19:37:01.773 30945  8194 D r_upgrade.Service: ============>total:10232472,progress:9838043,95.99% , 4024.14kb/s , 预计:0s
05-14 19:37:01.858 30945  8192 D r_upgrade.Service: handlerDownloadFinish: finish
05-14 19:36:59.990  1662  1662 D NotificationService: 0|in.canews.movieroar|2|null|10510: granting content://settings/system/notification_sound
05-14 19:37:02.333  5465  5465 D BoundBrokerSvc: onBind: Intent { act=com.google.android.gms.measurement.START pkg=com.google.android.gms }
05-14 19:37:02.333  5465  5465 D BoundBrokerSvc: Loading bound service for intent: Intent { act=com.google.android.gms.measurement.START pkg=com.google.android.gms }
05-14 19:37:02.376  1173  8074 I iorapd  : Perfetto TraceBuffer saved to file: /data/misc/iorapd/in.canews.movieroar/1/in.canews.movieroar.MainActivity/raw_traces/1621001222375156961.perfetto_trace.pb
05-14 19:37:02.401  8366  8403 W FA      : Analytics storage consent denied; will not get app instance id
05-14 19:37:02.483  8366  8430 W System.err: java.io.FileNotFoundException: /jacoco.exec: open failed: EROFS (Read-only file system)
05-14 19:37:02.483  8366  8430 W System.err:    at libcore.io.IoBridge.open(IoBridge.java:492)
05-14 19:37:02.483  8366  8430 W System.err:    at java.io.FileOutputStream.<init>(FileOutputStream.java:236)
05-14 19:37:02.483  8366  8430 W System.err:    at w.c.a.a.b.h.a.a(SourceFile:1)
05-14 19:37:02.483  8366  8430 W System.err:    at w.c.a.a.b.h.a.startup(SourceFile:6)
05-14 19:37:02.483  8366  8430 W System.err:    at w.c.a.a.b.a.startup(SourceFile:5)
05-14 19:37:02.483  8366  8430 W System.err:    at w.c.a.a.b.a.getInstance(SourceFile:3)
05-14 19:37:02.483  8366  8430 W System.err:    at w.c.a.a.b.e.<clinit>(SourceFile:2)
05-14 19:37:02.483  8366  8430 W System.err:    at w.c.a.a.b.e.getProbes(SourceFile:1)
05-14 19:37:02.483  8366  8430 W System.err:    at e.m.b.c.j2.n0.a(Unknown Source:13)
05-14 19:37:02.483  8366  8430 W System.err:    at e.m.b.c.j2.n0.<clinit>(Unknown Source:0)
05-14 19:37:02.483  8366  8430 W System.err:    at e.m.b.c.j2.n0.getUserAgent(Unknown Source:0)
05-14 19:37:02.483  8366  8430 W System.err:    at com.wynk.atvdownloader.download.ATVDownloadHelper.<init>(SourceFile:3)
05-14 19:37:02.484  8366  8430 W System.err:    at com.wynk.atvdownloader.download.ATVDownloadHelper$Companion$1.invoke(SourceFile:1)
05-14 19:37:02.484  8366  8430 W System.err:    at com.wynk.atvdownloader.download.ATVDownloadHelper$Companion$1.invoke(SourceFile:2)
05-14 19:37:02.484  8366  8430 W System.err:    at e.w.a.e.a.getInstance(SourceFile:4)
05-14 19:37:02.484  8366  8430 W System.err:    at tv.accedo.wynk.android.airtel.WynkApplication.e(SourceFile:1)
05-14 19:37:02.484  8366  8430 W System.err:    at tv.accedo.wynk.android.airtel.WynkApplication.access$initAtvDownloader(SourceFile:1)
05-14 19:37:02.484  8366  8430 W System.err:    at tv.accedo.wynk.android.airtel.WynkApplication$initLibraries$1.invokeSuspend(SourceFile:22)
05-14 19:37:02.484  8366  8430 W System.err:    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(SourceFile:3)
05-14 19:37:02.484  8366  8430 W System.err:    at r.a.u0.run(SourceFile:18)
05-14 19:37:02.484  8366  8430 W System.err:    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(SourceFile:1)
05-14 19:37:02.484  8366  8430 W System.err:    at kotlinx.coroutines.scheduling.CoroutineScheduler$b.a(SourceFile:17)
05-14 19:37:02.484  8366  8430 W System.err:    at kotlinx.coroutines.scheduling.CoroutineScheduler$b.d(SourceFile:4)
05-14 19:37:02.484  8366  8430 W System.err:    at kotlinx.coroutines.scheduling.CoroutineScheduler$b.run(SourceFile:1)
05-14 19:37:02.484  8366  8430 W System.err: Caused by: android.system.ErrnoException: open failed: EROFS (Read-only file system)
05-14 19:37:02.484  8366  8430 W System.err:    at libcore.io.Linux.open(Native Method)
05-14 19:37:02.484  8366  8430 W System.err:    at libcore.io.ForwardingOs.open(ForwardingOs.java:166)
05-14 19:37:02.484  8366  8430 W System.err:    at libcore.io.BlockGuardOs.open(BlockGuardOs.java:254)
05-14 19:37:02.484  8366  8430 W System.err:    at libcore.io.ForwardingOs.open(ForwardingOs.java:166)
05-14 19:37:02.484  8366  8430 W System.err:    at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7542)
05-14 19:37:02.484  8366  8430 W System.err:    at libcore.io.IoBridge.open(IoBridge.java:478)
05-14 19:37:02.484  8366  8430 W System.err:    ... 23 more
05-14 22:09:03.212     0     0 I IRQ 6   : no longer affine to CPU6
05-14 22:09:03.246     0     0 I         : Alarmtimer { AlarmManager', '44710671'}
05-14 22:09:03.248     0     0 I         : Alarmtimer { Binder:1662_5', '44710671'}
05-14 22:09:03.248     0     0 I         : Alarmtimer { AlarmManager', '44710671'}
05-14 22:09:03.271     0     0 I         : Alarmtimer { system_server', '44710671'}
05-14 19:37:02.592  1662  3772 D WifiNetworkFactory: got request NetworkRequest [ TRACK_DEFAULT id=1455, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10452 AdministratorUids: [] RequestorUid: 10452 RequestorPackageName: tv.accedo.airtel.wynk] ] with score 60 and providerId 6
05-14 19:37:02.592  1662  3772 D UntrustedWifiNetworkFactory: got request NetworkRequest [ TRACK_DEFAULT id=1455, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10452 AdministratorUids: [] RequestorUid: 10452 RequestorPackageName: tv.accedo.airtel.wynk] ] with score 60 and providerId 6
05-14 19:37:02.593  1662  3819 D WIFI_AWARE_FACTORY: got request NetworkRequest [ TRACK_DEFAULT id=1455, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10452 AdministratorUids: [] RequestorUid: 10452 RequestorPackageName: tv.accedo.airtel.wynk] ] with score 60 and providerId 6
05-14 19:37:02.593  1662  3820 D Ethernet: got request NetworkRequest [ TRACK_DEFAULT id=1455, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10452 AdministratorUids: [] RequestorUid: 10452 RequestorPackageName: tv.accedo.airtel.wynk] ] with score 60 and providerId 6
05-14 19:37:02.593  4391  4391 D PhoneSwitcherNetworkRequstListener: got request NetworkRequest [ TRACK_DEFAULT id=1455, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10452 AdministratorUids: [] RequestorUid: 10452 RequestorPackageName: tv.accedo.airtel.wynk] ] with score 60 and providerId 6
05-14 19:37:02.614  4391  4391 D PhoneSwitcherNetworkRequstListener: got request NetworkRequest [ TRACK_DEFAULT id=1456, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10452 AdministratorUids: [] RequestorUid: 10452 RequestorPackageName: tv.accedo.airtel.wynk] ] with score 60 and providerId 6
05-14 19:37:02.615  1662  3819 D WIFI_AWARE_FACTORY: got request NetworkRequest [ TRACK_DEFAULT id=1456, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10452 AdministratorUids: [] RequestorUid: 10452 RequestorPackageName: tv.accedo.airtel.wynk] ] with score 60 and providerId 6
05-14 19:37:02.615  1662  3772 D WifiNetworkFactory: got request NetworkRequest [ TRACK_DEFAULT id=1456, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10452 AdministratorUids: [] RequestorUid: 10452 RequestorPackageName: tv.accedo.airtel.wynk] ] with score 60 and providerId 6
05-14 19:37:02.615  1662  3772 D UntrustedWifiNetworkFactory: got request NetworkRequest [ TRACK_DEFAULT id=1456, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10452 AdministratorUids: [] RequestorUid: 10452 RequestorPackageName: tv.accedo.airtel.wynk] ] with score 60 and providerId 6
05-14 19:37:02.615  1662  3820 D Ethernet: got request NetworkRequest [ TRACK_DEFAULT id=1456, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10452 AdministratorUids: [] RequestorUid: 10452 RequestorPackageName: tv.accedo.airtel.wynk] ] with score 60 and providerId 6
05-14 19:37:02.619  5556  5556 W AppIndexingScheduler: [main] Full index started
05-14 19:37:02.661  1662  3987 W ActivityManager: Foreground service started from background can not have location/camera/microphone access: service tv.accedo.airtel.wynk/tv.accedo.wynk.android.blocks.service.download.AppDownloadService
05-14 19:37:02.772  8366  8396 W FA      : Value is too long; discarded. Value kind, name, value length: user property, productId, 68
05-14 19:37:02.703  1662  3987 W ActivityManager: Foreground service started from background can not have location/camera/microphone access: service tv.accedo.airtel.wynk/tv.accedo.wynk.android.blocks.service.download.AppDownloadService
05-14 19:37:02.863  1662  1662 D NotificationService: 0|tv.accedo.airtel.wynk|1|null|10452: granting content://settings/system/notification_sound05-14 19:37:03.024   854  1486 I SDM     : HWCDisplayBuiltIn::parseOutputBuffer: w 1080 h 2340 stride 1088 size 10186752 Bpp 4
05-14 22:09:04.836     0     0 I chatty  : uid=0(root) logd identical 5 lines
05-14 22:09:04.836     0     0 E msm_bus_device 16e0000.ad-hoc-bus: TCS Busy, retrying RPMH message send
05-14 22:09:04.893     0     0 I IRQ 6   : no longer affine to CPU5
05-14 22:09:04.953     0     0 I FG      : soc_work_fn: adjust_soc: s 34 r 134521 i -1264 v 3978 t 382 cc 417 m 0x56
05-14 19:37:04.344  4662  5961 W CCTFlatFileLogStore: Excessive logging: 2048 events, 462165 bytes from log source PEOPLE_AUTOCOMPLETE last 653s
05-14 22:09:06.233     0     0 I FG      : fg_battery_soc_smooth_tracking: soc:34, last_soc:34, raw_soc:34, soc_changed:1.
05-14 22:09:06.233     0     0 I FG      : soc_monitor_work: soc:34, raw_soc:34, c:-1276366, s:1
05-14 19:37:05.716   863  3834 I WifiHAL : event received NL80211_CMD_VENDOR, vendor_id = 0x1374, subcmd = 0xd
05-14 19:37:05.717  1356  1356 I cnss-daemon: nl80211 response handler invoked
05-14 19:37:05.717  1356  1356 I cnss-daemon: nl80211_response_handler: cmd 103, vendorID 4980, subcmd 13  received
05-14 19:37:05.731  1662  2225 W InputDispatcher: channel '617baf1 in.canews.movieroar/in.canews.movieroar.MainActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
05-14 19:37:05.732  1662  2225 E InputDispatcher: channel '617baf1 in.canews.movieroar/in.canews.movieroar.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
05-14 19:37:02.864  1662  1662 I chatty  : uid=1000 system_server identical 5 lines
05-14 19:37:02.864  1662  1662 D NotificationService: 0|tv.accedo.airtel.wynk|1|null|10452: granting content://settings/system/notification_sound05-14 19:37:05.739  1662  4702 D ConnectivityService: ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ TRACK_DEFAULT id=1453, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10510 AdministratorUids: [] RequestorUid: 10510 RequestorPackageName: in.canews.movieroar] ], android.os.BinderProxy@3dd784a)
05-14 19:37:05.739  1662  4685 D ConnectivityService: ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ TRACK_DEFAULT id=1454, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10510 AdministratorUids: [] RequestorUid: 10510 RequestorPackageName: in.canews.movieroar] ], android.os.BinderProxy@32ef3bb)
05-14 19:37:05.740  1662  5660 I ActivityManager: Process in.canews.movieroar (pid 30945) has died: fg  TOP
05-14 19:37:05.743  1662  5660 W ActivityManager: Scheduling restart of crashed service in.canews.movieroar/com.example.r_upgrade.common.UpgradeService in 1000ms for start-requested
05-14 19:37:05.744  8131  8131 I cr_ChildProcessService: Destroying ChildProcessService pid=8131
05-14 19:37:05.745   771   771 I Zygote  : Process 30945 exited cleanly (1)
05-14 19:37:05.746  8131  8131 I ocessService0:: System.exit called, status: 0
05-14 19:37:05.746  8131  8131 I AndroidRuntime: VM exiting with result code 0, cleanup skipped.
05-14 19:37:05.747  1662  5658 I WindowManager: WIN DEATH: Window{617baf1 u0 in.canews.movieroar/in.canews.movieroar.MainActivity}
05-14 19:37:05.748  1662  5658 W InputDispatcher: Attempted to unregister already unregistered input channel '617baf1 in.canews.movieroar/in.canews.movieroar.MainActivity (server)'
05-14 19:37:05.760  1662  5660 W ActivityTaskManager: Force removing ActivityRecord{14febd6 u0 in.canews.movieroar/.MainActivity t469}: app died, no saved state
05-14 19:37:05.781  1662  5660 I ActivityManager: Killing 8131:com.google.android.webview:sandboxed_process0:org.chromium.content.app.SandboxedProcessService0:0/u0a510i75 (adj 0): isolated not needed
05-14 19:37:05.785  1662  1896 I libprocessgroup: Successfully killed process cgroup uid 10510 pid 30945 in 44ms
05-14 19:37:05.785  1662  1896 I libprocessgroup: Successfully killed process cgroup uid 99075 pid 8131 in 0ms
05-14 19:37:05.789  1662  1866 W ActivityManager: setHasOverlayUi called on unknown pid: 30945
05-14 19:37:05.790  3754  3970 I BtGatt.ScanManager: msg.what = 6
05-14 19:37:05.814  4205  4205 I Zygote  : Process 8131 exited cleanly (0)

Security issue needs your help during Google Store's reviewing

Hello,
It's great to have r_upgrade rich APIs on APP upgrading. It's the best solution I found.
But it's pity we have to remove it before since there's security issue on unsafe implementation of the X509TrustManager interface with the Apache HTTP client during Google Store's reviewing.
More information will be provided as below. May I know whether you will fix this issue ? Thanks !


"Your application has a security issue because it uses a potentially unsafe implementation of the X509TrustManager interface with the Apache HTTP client. For more information and the date by which the vulnerability should be addressed, see this Google Help Center article.
Classes with vulnerabilities:
• com.example.r_upgrade.common.UpgradeService$b

WIFI网络断开报错,Android11,RedMi K30i,网络恢复下载没有自动恢复,求助大佬!

I/flutter (25524): 34.31--DownloadStatus(2)
W/System.err(25524): java.net.SocketException: Software caused connection abort
W/System.err(25524): at java.net.SocketInputStream.socketRead0(Native Method)
W/System.err(25524): at java.net.SocketInputStream.socketRead(SocketInputStream.java:119)
W/System.err(25524): at java.net.SocketInputStream.read(SocketInputStream.java:176)
W/System.err(25524): at java.net.SocketInputStream.read(SocketInputStream.java:144)
W/System.err(25524): at com.android.org.conscrypt.ConscryptEngineSocket$SSLInputStream.readFromSocket(ConscryptEngineSocket.java:936)
W/System.err(25524): at com.android.org.conscrypt.ConscryptEngineSocket$SSLInputStream.processDataFromSocket(ConscryptEngineSocket.java:900)
W/System.err(25524): at com.android.org.conscrypt.ConscryptEngineSocket$SSLInputStream.readUntilDataAvailable(ConscryptEngineSocket.java:815)
W/System.err(25524): at com.android.org.conscrypt.ConscryptEngineSocket$SSLInputStream.read(ConscryptEngineSocket.java:788)
W/System.err(25524): at com.android.okhttp.okio.Okio$2.read(Okio.java:138)
W/System.err(25524): at com.android.okhttp.okio.AsyncTimeout$2.read(AsyncTimeout.java:213)
W/System.err(25524): at com.android.okhttp.okio.RealBufferedSource.read(RealBufferedSource.java:51)
W/System.err(25524): at com.android.okhttp.internal.http.Http1xStream$FixedLengthSource.read(Http1xStream.java:395)
W/System.err(25524): at com.android.okhttp.okio.RealBufferedSource$1.read(RealBufferedSource.java:372)
W/System.err(25524): at java.io.InputStream.read(InputStream.java:101)
W/System.err(25524): at com.example.r_upgrade.common.UpgradeService$UpgradeRunnable.run(UpgradeService.java:492)
W/System.err(25524): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
W/System.err(25524): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
W/System.err(25524): at java.lang.Thread.run(Thread.java:923)
D/r_upgrade.Service(25524): handlerDownloadFailure: failure
I/flutter (25524): 0.0--DownloadStatus(4)

修改进度条提示成中文遇到一些问题,

  • flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, 1.21.0-10.0.pre.159, on Microsoft Windows [Version 10.0.18362.1016], locale zh-CN)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[!] Android Studio (version 4.0)
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
[!] IntelliJ IDEA Ultimate Edition (version 2019.3)
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
[√] Connected device (1 available)
  • pubspec.yml
  r_upgrade: ^0.3.1
  • 调用
    int id = await RUpgrade.upgrade('http://$ip/1.apk',
        fileName: '1.apk',
        isAutoRequestInstall: true,
        notificationStyle: NotificationStyle.speechAndPlanTime);
  • 配置文件
    文档上写的是project/android/app/main/res/r_upgrade_value.xml,我的flutter项目没有这个文件夹路径,在project/android/app/main/res/r_upgrade_value.xml以及project/android/app/src/main/res/r_upgrade_value.xml都新建了配置文件。
    image
    实际跑之后任务栏显示的还是英文版本100kb/s 300s left
    image
    想请教一下各位走过路过的大佬赐教一下我哪里配错了= =感谢。

Could not determine the dependencies of task ':app:processDebugResources'.

FAILURE: Build failed with an exception.

What went wrong:
Could not determine the dependencies of task ':app:processDebugResources'.
Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
Could not find :r_upgrade_lib-debug:.
Required by:
project :app > project :r_upgrade

java.lang.RuntimeException

Some devices have a this problem:

Android: 11

java.lang.RuntimeException:
at android.app.ActivityThread.handleStopService (ActivityThread.java:4476)
at android.app.ActivityThread.access$2100 (ActivityThread.java:250)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2032)
at android.os.Handler.dispatchMessage (Handler.java:106)
at android.os.Looper.loop (Looper.java:236)
at android.app.ActivityThread.main (ActivityThread.java:7864)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:620)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1011)
Caused by: java.lang.NullPointerException:
at com.example.r_upgrade.common.UpgradeService$UpgradeRunnable.handlerDownloadPause (UpgradeService.java:57)
at com.example.r_upgrade.common.UpgradeService$UpgradeRunnable.access$1100 (UpgradeService.java)
at com.example.r_upgrade.common.UpgradeService.onDestroy (UpgradeService.java:7)
at android.app.ActivityThread.handleStopService (ActivityThread.java:4451)
at android.app.ActivityThread.access$2100 (ActivityThread.java:250)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2032)
at android.os.Handler.dispatchMessage (Handler.java:106)
at android.os.Looper.loop (Looper.java:236)
at android.app.ActivityThread.main (ActivityThread.java:7864)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:620)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1011)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.