WSO2EMM重建移动代理失败 [英] WSO2EMM rebuilding the mobile agent fails

查看:195
本文介绍了WSO2EMM重建移动代理失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用自定义密钥库(以允许SSL使用自己的SSL证书)和其他自定义项重建Android代理.如文档(product-emm 2.0.1),Android Studio(Android Studio 2.2,Androind 5.1.1,API 22)声称以下方法是未知的:

  • org.wso2.emm.agent.api.RuntimeInfo-Environment.getLegacyExternalStorageDirectory(第159行)
  • org.wso2.emm.agent.services.AlarmReceiver-intent.getExtra(第56行)
  • org.wso2.emm.agent.services.NetworkConnectedReceiver-context.startServiceAsUser(第42行)
  • org.wso2.emm.agent.utils.CommonUtils-context.startServiceAsUser(第432、445行)

我是否需要不同的API级别(根据文档应该可以),不同的工具或其他工具?根据此帖子,"startServiceAsUser"不是公共方法.

现在我看到要重建的项目应该是product-mdm(???).我假设MDM平台是(应该)是EMM的一部分,但是-代码库略有不同.似乎此问题与产品emm 2.2.0-SNAPSHOT

有关

解决方案

EMM 2.0.1已经过时了(至少是IMO半年了),此后进行了许多更改/错误修复,您可能想要有.

如果您对EMM Android代理源代码做出了任何贡献,那么您肯定需要针对最新的EMM(目前为2.2.0)进行编译.

我在编译EMM 2.2 android代理时也遇到相同的错误-这是因为它们使用了常规Android SDK中不提供的隐藏系统API,可以通过Reflection API(WSO2维护人员应采用这种方式)或通过"ASDK中的"extended" android.jar(包括隐藏的API).可以从设备上的系统jar中提取此类jar文件(您需要使用具有适当的Android API版本的带rooted的设备),也可以从AOSP构建中提取这些文件,在该AOSP构建中,将构建Android ROM,然后针对具有隐藏API的系统jar构建系统应用程序./p>

请参见如何操作我是否构建了具有可用的隐藏API和内部API的Android SDK?有关此问题的更多信息.

显然,WSO2维护者使用这种扩展"系统库来编译android代理.

已编辑:的确,WSO2维护人员可以使用具有隐藏API的ASDK进行编译,这是一个概念点,因为可以将代理部署到具有可用隐藏API的COPE设备.在此处查看更多信息: https://wso2.org/jira/browse/EMM-141

我个人的喜好是使用隐藏的API更新ASDK中的android.jar,可在此处下载:可访问Android隐藏API和内部资源的库

I'm trying to rebuild the Android agent with custom keystores (to allow SSL with own SSL certificates) and optionally other customizations. When building the project as described in the documentation (product-emm 2.0.1), the Android studio (Android studio 2.2, Androind 5.1.1, API 22) claims the following methods are unknow:

  • org.wso2.emm.agent.api.RuntimeInfo - Environment.getLegacyExternalStorageDirectory (line 159)
  • org.wso2.emm.agent.services.AlarmReceiver - intent.getExtra (line 56)
  • org.wso2.emm.agent.services.NetworkConnectedReceiver - context.startServiceAsUser (line 42)
  • org.wso2.emm.agent.utils.CommonUtils - context.startServiceAsUser (line 432, 445)

Do I need different API level (according the docs it should be ok), difference tools or something? According to this post, the "startServiceAsUser" is not a public method..

Edit: now I see the project to rebuild should be product-mdm (???) I assume the MDM platform is (should be) part of the EMM, however - the codebase is slightly differenct. Seems this issue concerns the product-emm 2.2.0-SNAPSHOT

解决方案

EMM 2.0.1 is quite outdated (IMO for a half of year at least), there were many changes / bug fixes since then, which you probably want to have.

And if you make any contribution to EMM Android agent source code then you definitely need to compile against the latest EMM (2.2.0 at the moment).

I also face the same errors compiling EMM 2.2 android agent - it's because they use hidden system API which are not available in regular Android SDK, this API can be accessed via Reflection API (WSO2 maintainers should go this way) or with "extended" android.jar from ASDK including hidden API. Such jars files can be extracted from system jars on devices (you need a rooted device with appropriate Android API version on board) or from AOSP build, where Android ROM is being built, and system apps are built against system jars with hidden APIs.

See How do I build the Android SDK with hidden and internal APIs available? for more info on the matter.

Apparently WSO2 maintainers compile android agent with such "extended" system libs.

EDITED: Indeed WSO2 maintainers compile against ASDK with hidden API, this is a conceptual point, since the agent can be deployed to COPE devices with hidden APIs available. See more info here: https://wso2.org/jira/browse/EMM-141

My personal preference is to update android.jar in ASDK with hidden API, can be downloaded here: library that provides access to Android hidden API and internal resources

这篇关于WSO2EMM重建移动代理失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆