मैं कॉर्डोवा के लिए एक प्लगइन बनाता हूं और मैं "एप्लिकेशन" टैग में एक विशेषता जोड़ने के लिए एंड्रॉइडमैनीफेस्ट को संपादित करना चाहता हूं। मुझे एक नया टैग जोड़ने के लिए config-file पता है लेकिन मुझे नहीं पता कि मैं एक मौजूदा टैग अपडेट कर सकता हूं या नहीं।एक कॉर्डोवा प्लगइन से AndroidManifest में "एप्लिकेशन" टैग पर एक विशेषता जोड़ें
उदाहरण के लिए, मैं इस AndroidManifest है:
<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="0.0.1" package="com.test.testCordova" xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="CordovaApp" android:theme="@android:style/Theme.Black.NoTitleBar" android:windowSoftInputMode="adjustResize">
<intent-filter android:label="@string/launcher_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="19" />
</manifest>
और मैं <application>
टैग में android:isGame=true
जोड़ना चाहते हैं।
अगर मैं प्लगइन.एक्सएमएल से ऐसा नहीं कर सकता, तो मैं अपने आप एंड्रॉइडमैनिफेस्ट को संपादित करने के लिए एक हुक बनाउंगा लेकिन मुझे उम्मीद है कि यह आवश्यक नहीं होगा।
मेरे मामले में, मैं मैनिफेस्ट को अपडेट करने के लिए "first_compile" हुक का उपयोग करता हूं। – Shimrra