AOSP:调试EthernetManager SystemServices

时间:2017-10-23 15:18:17

标签: android service static ip android-source

我目前正尝试在Android设备的启动阶段为eth0设置静态IP。

我尝试使用java服务,没有脚本或别的东西来绕过java android服务。

通过使用EthernetServiceImpl和setConfiguration方法,我发现Android中存在黑客攻击。

我的代码非常简单。我得到ETHERNET_SERVICE(EthernetManager):

EthernetManager ethernetManager = (EthernetManager) context.getSystemService(Context.ETHERNET_SERVICE);
ethernetManager.setConfiguration(config);

这不起作用。它应该在“/ data / misc / ethernet”中创建“ipconfig.txt”。

当我调试我的服务时(我没有将其注册为系统服务,它是一个简单的服务),我看到在以太网托管中,值服务为空。但是这应该在构造函数中设置。

EthernetManager.java:

/**
 * Set Ethernet configuration.
 */
public void setConfiguration(IpConfiguration config) {
    if (mService == null) {
        return;
    }
    try {
        mService.setConfiguration(config);
    } catch (RemoteException e) {
    }
}

有没有人使用此服务取得成功?我做错了吗?

0 个答案:

没有答案
相关问题