给定一个xml,如下所示:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="SOMETHING.Presentation.Mobile.Droid" android:installLocation="auto" android:versionName="1.13.0" android:versionCode="15">
<uses-sdk android:minSdkVersion="15" />
<permission android:name=".permission.C2D_MESSAGE" android:protectionLevel="signature" />
<application android:label="SOME_NAME" android:largeHeap="true">
<meta-data android:name="com.google.android.geo.API_KEY" android:value="SOMETHING" />
<receiver android:name="com.google.android.gms.gcm.GcmReceiver" android:exported="true" android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="SOMETHING.Presentation.Mobile.Droid" />
</intent-filter>
</receiver>
</application>
</manifest>
我正在尝试使用powershell脚本来重写它。
当我搜索这样的包时:
$package = $xdoc.manifest.package
我得到它“SOMETHING.Presentation.Mobile.Droid”
当我搜索android:label(<application android:label="SOME_NAME" android:largeHeap="true">
)时我什么都没得到
我试过没有成功:
如何用“冒号”指向属性?
答案 0 :(得分:1)
试试这个:
$xml.manifest.application.label