问题标签 [nativeapplication]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
47 浏览

java - Android 应用:如何让我的应用显示在音频输出建议中

示例:当我单击附加音频按钮时,我希望我的应用程序显示在应用程序建议中(以及录音机)。

0 投票
0 回答
462 浏览

reactjs - 如何为 windows 平台导出 React 本机代码

我正在响应在 iOS 和 Android 上运行的本机代码。我也使用了一些依赖项,如图像选择器或其他,但现在我必须在 Windows 手机中运行该应用程序,所以为此我按照此链接在 Windows 机器中设置虚拟应用程序 https://shift.infinite.red/getting -started-with-react-native-development-for-windows-ba23a4be90b6

它成功地完成了。没有问题,但是当我为现有的 React 本机应用程序运行时。它会抛出与 iOS 和 Android 都支持的依赖项相关的错误。

没问题,我现有的代码在 Windows 中运行良好,但 Windows 不支持这些第三方库。

截至目前,我已经使用这个库在 React 中为 Android 和 iOS 隐藏白屏 https://github.com/crazycodeboy/react-native-splash-screen

我的问题是,当将此库代码用于 Windows 应用程序时会引发错误,否则在 android 和 ios 中可以完美运行。(现有 react 本机代码中使用的所有第三方库在 Windows 中均不支持)

如何使用所有第三方库为 Windows Phone 运行本机现有代码。

0 投票
1 回答
558 浏览

android - 使用本机应用程序 (Android) 保护 Oauth2 中的身份验证代码

该问题与 AppLinks 几乎没有关系,assetlinks.json 似乎不用于验证

我正在 Android 上实现 Oauth2 应用程序。我想做 SSO(单点登录),我担心 AppLink 以保护 Autorization 代码。

原生应用通过浏览器发起授权请求,然后接收包含授权码的授权响应。根据RFC6749#section-4.1.2,代码在 URL 内传递:

授权码是一条敏感信息,因为它允许客户端获取访问令牌和刷新令牌,然后访问受保护的资源。

为了保护该代码,本机应用程序必须实现 https 方案重定向(RFC8252#section-7.2section-8.1)。在 Android 上,这必须使用assetlinks.json 文件来完成

但根据顶部链接的相关问题,Android 上的应用链接似乎不是 100% 安全的,因为操作系统可能不会验证 https 方案。

在这种情况下,我们应该如何实现 Oauth2 授权代码挂钩?

编辑

根据@benjamin anwser 的说法,AppLink 不是为了安全。但是,相关的威胁用例如下:安装了恶意应用程序并使用“SSO Cookie”获取Auth Code并交换AT+RT. 在我看来,这个过程中没有任何东西可以阻止这种情况:如果 applink 不是为了安全,授权服务器如何知道这个应用程序是恶意应用程序?

注意:我所说的 SSO-Cookie 是指使用CustomTab在 Android 上进行 SSO。

0 投票
0 回答
359 浏览

android - 无法在 Appium 的任一屏幕中定位任何元素

单击此处查看 UI 自动化屏幕截图
无法使用 Appium 处理 Android 本机应用程序屏幕之一上的任何元素。我使用 UIAutomator 来定位元素。对于其余屏幕,脚本运行良好。我只是在上述屏幕中遇到问题。

在屏幕截图中,发现了“立即跳过”按钮。请注意,在同一屏幕上对任何元素执行操作时会出现相同的异常。

Java 客户端 5.0.4
Selenium Server 3.14
Appium 版本 1.6.1

例外是

PS:我还在代码中添加了计时器和等待。

以下是用于定位“立即跳过”按钮的不同代码: 1. driver.findElement(By.id("ewc.ewcandroid:id/lay_reservation_bottom_btnCancel")).click();

  1. driver.findElement(By.xpath("//android.widget.ImageView[@index='0']")).click();
0 投票
0 回答
44 浏览

android - spown cmd enoent error while creating react native app

I followed the official doc to create app, but while running npm start it results in the spown cmd enoent error.

Expo version is 2.6.14

Error log:

Command line error: command line

0 投票
2 回答
552 浏览

powershell - 使用 AZ Powershell 模块注册本机应用程序

我需要使用 AZ Powershell 6 模块在 Azure Active Directory 上注册本机应用程序。可以使用 AzureAD 模块中的命令 New-AzureADApplication 将“PublicClient”字段的值设置为 true 来注册本机应用程序,但 powershell 6 不支持模块 AzureAD。

在 powershell 6 中,对应的命令似乎是 New-AzADApplication,它允许注册 Web 应用程序/API,但不能注册本机应用程序。

那么如何在 powershell 6 中使用模块 AZ 注册本机应用程序呢?

谢谢。

0 投票
0 回答
207 浏览

azure-active-directory - 如何在 PowerShell 6 中授予 AAD 本机应用程序权限?

我通过powershell 6(模块AzureAD.Standard.Preview)在Azure Active Directory上注册了一个本机应用程序,我需要使用powershell 6代码授予权限(设置>所需权限>授予权限)。我正在使用 AZ 模块。

我尝试使用此解决方案http://www.lieben.nu/liebensraum/2018/04/how-to-grant-oauth2-permissions-to-an-azure-ad-application-using-powershell-unattended-silently但这使用 powershell 5 和旧的 AzureRM 模块。它不适用于 AZ 模块,因为刷新令牌不存在。

如何向使用 PowerShell 6 和 AZ 模块在 AAD 上注册的本机应用程序授予权限?

0 投票
2 回答
1344 浏览

authentication - Should I use PKCE for OpenID Connect with Native Desktop Application?

I want to use OpenID Connect for my native windows and Linux desktop applications to authenticate my users.

As stated in "OAuth 2.0 for Native Apps" Section 7.3 I want to open a local TCP port to redirect from the Authentication Server to get the Authorization Code. I think there is no other option to use for native apps which work both for Windows and Linux.

So the flow would be like:

  • Native app starts and shows login button
  • When login button is pressed
  • native apps opens a ephemeral, local port
  • browser opens with login page of authentication provider (sending along the client id and secret, redirect URI and scope openid, response_type=code)
  • After successful authentication of user in browser
  • the authenication provider redirects to the redirect URI, which is the local open port
  • the local port should display something like "close browser now and go back to app" to user
  • Native application gets code from redirect and closes port
  • Native application asks the token endpoint to get the identity token using the code
  • validate the identity token using the signature
  • will be able to get the details of the user out of that identity token

My question now is do I need PKCE? I found this article which states it does not bring any extra safety apart from making sure that when another app on the same device has registered the same Private-Use URI Scheme Redirect.

Is my plan in any other way flawed or needs further improvements? I understand that the client id and secret can be seen as "public" because they ship with the software and could be reverse engineered. But my software will not be available on public web pages (hopefully) and only be given to trusted customers (which will all have different client id and secrets).

0 投票
1 回答
80 浏览

android - Android Native App Install 可以被视为 iOS Smart App Banners 吗?

我看到有关 Android 的“本机应用安装”功能的相互矛盾的信息。我还有以下问题。有人可以帮忙澄清一下吗?

  1. 我们可以说它是 Android 相当于 iOS Smart App Banner 吗?

  2. 它是否显示应用程序是否已安装?

  3. 它是否允许将任何上下文/数据从链接传递到应用程序(安装和启动后)。像“app-argument”(在 iOS 中)或“referrer url”(Android)?

0 投票
1 回答
282 浏览

android - 如何使用 Xamarin.forms 打开我的 Android 本机应用程序?

我一直在用 Android Studio 开发一个 Android 应用,现在我需要能够在 Visual Studio 中用 Xamarin.forms 打开它(这是我老师给我的一个任务,这是因为一个同学一直在创建 iOS 版本和现在我们将它们组合成一个项目)。

我不得不说我几乎是一个菜鸟,并且一直在寻找一些关于依赖服务和其他东西的教程,但似乎并没有完全涵盖我正在寻找的内容(或者,至少,不够清楚)。

如果您有一个精确的视频来简单地解释如何做到这一点,如果您与我分享,我将不胜感激。

感谢您抽出宝贵的时间,并祝您有美好的一天:)