android - 将 appbundle 上传到 Google Play 控制台后如何检测测试设备
问题描述
我的应用程序允许匿名用户单击调用我的 API 的按钮。我想过滤掉应用程序抓取的测试设备。它们似乎不是 Firebase 测试实验室的一部分。脚步:
- 在 Google Play Console 中开始新的应用发布。
- 在“Android App Bundles and APKs to add”部分上传应用程序包。
- 等待大约五分钟。请勿继续执行第 2 步“审查和推出”。
- 检查我的服务器日志。
- 在多个 IP 上
有来自 android MTC20F 的调用(由 dart:io Platform报告),例如
- 64.233.172.32
- 66.249.88.64
- 74.125.210.33
- Firebase测试实验室系统变量为空。
解决方案
如果它可以提供帮助,当应用程序在 Google Play 的测试服务器上进行审查/运行时,我注意到一个奇怪的副作用,即我无法访问缓存目录以在 Android 上列出:
FileSystemException: Directory listing failed, path = '/data/user/0/my.package.name/cache/random_folder/' (OS Error: Invalid argument, errno = 22)
导致此错误的代码是:
Future<List<File>> getFilesInDirectory(String directoryPath) async {
// `directoryPath` is fetched on Android side with `context.cacheDir`
final cacheDir = Directory(directoryPath);
final files = <File>[];
// This call succeeds, .. I still don't get why :D
if (!cacheDir.existsSync()) return files;
final completer = Completer();
// Tries to list all files in the folder
cacheDir.list(followLinks: false).listen(
(file) {
if (file is! File) {
return;
}
files.add(file as File);
},
onDone: () => completer.complete(),
onError: (err) {
log(err) // <---- This is where I get the error
}
);
await completer.future;
return files;
}
推荐阅读
- wpf - 是否可以在 Windows 10 的 PWA 中访问 wifi 直接 API 和其他 Windows API?
- powershell - 如何在 Windows PowerShell 中执行以下操作?
- reactjs - 有什么方法可以从 useSelector 获取数据并将其存储为 useState 的初始值?
- azure-eventhub - 验证超过 12 个 Azure 事件中心发布者?
- swift - 如何在编辑小部件视图中删除 displayImage 色调?
- python - 在我们连接之前,浏览器似乎已经退出。如果您在 FirefoxBinary 构造函数中指定了 log_file,请检查它以获取详细信息
- sql-server - SQL Server - 从可用信用中扣除
- pivot-table - 如何用百分比计算表格
- ios - 如何在 Swift 中确定变量是否为字符串?
- python - Python 中是否有包含 Internet 上注册域的完整列表的库?