首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何找出哪个颤振依赖使用特定的google包(在find上被封锁)?

如何找出哪个颤振依赖使用特定的google包(在find上被封锁)?
EN

Stack Overflow用户
提问于 2022-09-25 17:10:43
回答 1查看 173关注 0票数 3

我试图提交一个颤振应用程序的F-机器人。

不幸的是,我收到了一条信息,即使用了来自Google的区块列表包:

代码语言:javascript
复制
2022-09-25 16:57:05,704 DEBUG: Found class 'com/google/android/play/core/assetpacks/o2'
2022-09-25 16:57:05,706 DEBUG: Found class 'com/google/android/play/core/assetpacks/f2'
2022-09-25 16:57:05,707 DEBUG: Found class 'com/google/android/play/core/assetpacks/r0'
2022-09-25 16:57:05,707 DEBUG: Found class 'com/google/android/play/core/review/d'
2022-09-25 16:57:05,707 DEBUG: Found class 'com/google/android/play/core/assetpacks/y'
2022-09-25 16:57:05,708 DEBUG: Found class 'com/google/android/play/core/assetpacks/k2'
2022-09-25 16:57:05,708 DEBUG: Found class 'com/google/android/play/core/assetpacks/e1'
2022-09-25 16:57:05,708 DEBUG: Found class 'com/google/android/gms/common/api/internal/j'
2022-09-25 16:57:05,708 DEBUG: Found class 'com/google/android/gms/common/internal/p'
2022-09-25 16:57:05,709 DEBUG: Found class 'com/google/android/play/core/review/b'
2022-09-25 16:57:05,709 DEBUG: Found class 'com/google/android/play/core/assetpacks/p0'
2022-09-25 16:57:05,709 DEBUG: Found class 'com/google/android/gms/common/internal/v/c'
2022-09-25 16:57:05,709 DEBUG: Found class 'com/google/android/gms/common/api/internal/x'
2022-09-25 16:57:05,710 DEBUG: Found class 'com/google/android/gms/common/api/internal/v'
2022-09-25 16:57:05,710 DEBUG: Found class 'com/google/android/gms/common/internal/s'
2022-09-25 16:57:05,710 DEBUG: Found class 'com/google/android/gms/common/api/internal/h'
2022-09-25 16:57:05,710 DEBUG: Found class 'com/google/android/gms/common/api/internal/e0'

诸若此类。

我的耻骨是这样的:

代码语言:javascript
复制
dependencies:
  flutter:
    sdk: flutter


  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.2
  trufi_core:
    git:
      url: https://github.com/AddisMap/trufi-core.git
      ref: translation-am

trufi_core的公共规范如下:

代码语言:javascript
复制
dependencies:
  app_review: ^2.1.1+1
  async_executor: ^0.0.2
  flare_flutter: ^3.0.2
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter 
  flutter_map: ^0.14.0
  device_info_plus: ^3.2.4
  diff_match_patch: ^0.4.1
  latlong2: ^0.8.1
  routemaster: ^0.9.5
  geolocator: ^8.0.3
  graphql: ^5.0.0
  path_provider: ^2.0.8
  flutter_bloc: ^8.0.0
  flutter_svg: ^1.0.0 
  equatable: ^2.0.3
  provider: ^6.0.1
  package_info_plus: ^1.3.0
  rxdart: ^0.27.3
  share_plus: ^4.0.10+1
  synchronized: ^3.0.0
  cached_network_image: ^3.2.0
  uni_links: ^0.5.1
  # Workaround fix version errors for device_info_plus
  device_info_plus_platform_interface: '2.3.0+1'

有命令列出使用这些类的包吗?

我试过梯度,没有运气:

代码语言:javascript
复制
android$ ./gradlew -q dependencies

------------------------------------------------------------
Root project
------------------------------------------------------------

No configurations

我也试过

代码语言:javascript
复制
$ find -name "*play*"

在“我的项目”文件夹中,该文件夹不生成与这些类相关的任何内容。

编辑:通过猜测,我发现app_review正在引入play商店的依赖关系。

仍然存在gms服务。

我还发现,我可以在本地检查APK,而不必像这样使用F-droid构建:

~/Android/Sdk/build-tools/33.0.0/dexdump build/app/outputs/flutter-apk/app-release.apk |grep gms/location

不过,我还是得猜一下那些“颤栗”包裹。

这些是其余的包/类:

代码语言:javascript
复制
 cat /tmp/classes.txt | cut -d " " -f 6|rev|cut -d/ -f2-|rev|sort|uniq
'com/google/android/gms/auth/api/signin
'com/google/android/gms/auth/api/signin/a
'com/google/android/gms/common/annotation
'com/google/android/gms/common/api
'com/google/android/gms/common/api/internal
'com/google/android/gms/common/internal
'com/google/android/gms/common/internal/v
'com/google/android/gms/common/util
'com/google/android/gms/dynamite
'com/google/android/gms/location
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-10-03 08:10:34

包被下载到颤振缓存中。在我的例子中,因为我使用的是一个快速安装的颤振,这是在~/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org -另一个可能的位置是~/.pub-cache/hosted/pub.dartlang.org

因此,您可以在这些文件夹中为google库提供grep,并将它们与您的项目所需的包相匹配(如果您有许多抖动的项目,您可能希望清除项目上的缓存和flutter pub get,以便在其中只包含所需的包。另一种选择是将所需的包与缓存中的包匹配。

代码语言:javascript
复制
~/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org$ find -name "*.java" -exec grep -H 'import com\.google' {} \;

这将打印出需要任何google库的java文件,并且您可以识别包。

在上面的例子中,似乎是geolocator_android,github用户Zverik为它提供了一个修补的分支:

将其添加到公共规范中可能会有所帮助:

代码语言:javascript
复制
dependency_overrides:
  geolocator_android:
    git:
      url: https://github.com/Zverik/flutter-geolocator.git
      ref: floss
      path: geolocator_android
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73846381

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档