一切都可以在上面找到https://android.googlesource.com https://android.googlesource.com.
清单模型未写入 .xsd 文件。相反,它被写成一组对象。树可以找到here https://android.googlesource.com/platform/tools/adt/idea/+/master/android/src/org/jetbrains/android/dom/manifest/
如果你从Manifest https://android.googlesource.com/platform/tools/adt/idea/+/master/android/src/org/jetbrains/android/dom/manifest/Manifest.java你可以看到,它引用了Application https://android.googlesource.com/platform/tools/adt/idea/+/master/android/src/org/jetbrains/android/dom/manifest/Application.java, List<UsesPermission> https://android.googlesource.com/platform/tools/adt/idea/+/master/android/src/org/jetbrains/android/dom/manifest/UsesPermission.java等。Application https://android.googlesource.com/platform/tools/adt/idea/+/master/android/src/org/jetbrains/android/dom/manifest/Application.java有参考android:name https://android.googlesource.com/platform/tools/adt/idea/+/master/android/src/org/jetbrains/android/dom/manifest/Application.java#69 and android:label https://android.googlesource.com/platform/tools/adt/idea/+/master/android/src/org/jetbrains/android/dom/manifest/Application.java#73 and List<Activity> https://android.googlesource.com/platform/tools/adt/idea/+/master/android/src/org/jetbrains/android/dom/manifest/Activity.java等等。
样本来自Activity
object:
@Attribute("name")
@Required
@Convert(PackageClassConverter.class)
@ExtendClass("android.app.Activity")
AndroidAttributeValue<PsiClass> getActivityClass();
正如你所看到的,这就是 Android Studio 所知道的方式activity
清单内的标签必须有名称。使用了两个注释:
@Attribute("name")
@Required
其中之一是 .xml 标记属性的名称,第二个通知该属性是必需的。
可以在清单中找到可以使用的标签名称here https://android.googlesource.com/platform/tools/base/+/master/common/src/main/java/com/android/xml/AndroidManifest.java#43
可以找到Android Studio用来获取manifest属性的辅助类here https://android.googlesource.com/platform/tools/adt/idea/+/b5197d2fb96e66e6fe50aa772eaadcbed6547cc1/android/src/com/android/tools/idea/model/ManifestInfo.java