Skip to content

Commit 92b18fd

Browse files
committed
简化集成流程,更新中英文文档
1 parent a8cc0c0 commit 92b18fd

File tree

4 files changed

+16
-56
lines changed

4 files changed

+16
-56
lines changed

project/Libraries/DroidPlugin/AndroidManifest.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@
658658
</service>
659659
<provider
660660
android:name=".stub.ContentProviderStub$StubP00"
661-
android:authorities="@string/authority0"
661+
android:authorities="${authorityName}_P00"
662662
android:exported="false"
663663
android:label="@string/stub_name_povider" />
664664

@@ -1148,7 +1148,7 @@
11481148
</service>
11491149
<provider
11501150
android:name=".stub.ContentProviderStub$StubP01"
1151-
android:authorities="@string/authority1"
1151+
android:authorities="${authorityName}_P01"
11521152
android:exported="false"
11531153
android:label="@string/stub_name_povider"
11541154
android:process=":PluginP01" />
@@ -1636,7 +1636,7 @@
16361636
</service>
16371637
<provider
16381638
android:name=".stub.ContentProviderStub$StubP02"
1639-
android:authorities="@string/authority2"
1639+
android:authorities="${authorityName}_P02"
16401640
android:exported="false"
16411641
android:label="@string/stub_name_povider"
16421642
android:process=":PluginP02" />
@@ -2126,7 +2126,7 @@
21262126
</service>
21272127
<provider
21282128
android:name=".stub.ContentProviderStub$StubP03"
2129-
android:authorities="@string/authority3"
2129+
android:authorities="${authorityName}_P03"
21302130
android:exported="false"
21312131
android:label="@string/stub_name_povider"
21322132
android:process=":PluginP03" />
@@ -2615,7 +2615,7 @@
26152615
</service>
26162616
<provider
26172617
android:name=".stub.ContentProviderStub$StubP04"
2618-
android:authorities="@string/authority4"
2618+
android:authorities="${authorityName}_P04"
26192619
android:exported="false"
26202620
android:label="@string/stub_name_povider"
26212621
android:process=":PluginP04" />
@@ -3103,7 +3103,7 @@
31033103
</service>
31043104
<provider
31053105
android:name=".stub.ContentProviderStub$StubP05"
3106-
android:authorities="@string/authority5"
3106+
android:authorities="${authorityName}_P05"
31073107
android:exported="false"
31083108
android:label="@string/stub_name_povider"
31093109
android:process=":PluginP05" />
@@ -3593,7 +3593,7 @@
35933593
</service>
35943594
<provider
35953595
android:name=".stub.ContentProviderStub$StubP06"
3596-
android:authorities="@string/authority6"
3596+
android:authorities="${authorityName}_P06"
35973597
android:exported="false"
35983598
android:label="@string/stub_name_povider"
35993599
android:process=":PluginP06" />
@@ -4085,7 +4085,7 @@
40854085
</service>
40864086
<provider
40874087
android:name=".stub.ContentProviderStub$StubP07"
4088-
android:authorities="@string/authority7"
4088+
android:authorities="${authorityName}_P07"
40894089
android:exported="false"
40904090
android:label="@string/stub_name_povider"
40914091
android:process=":PluginP07" />
@@ -4574,7 +4574,7 @@
45744574
</service>
45754575
<provider
45764576
android:name=".stub.ContentProviderStub$StubP08"
4577-
android:authorities="@string/authority8"
4577+
android:authorities="${authorityName}_P08"
45784578
android:exported="false"
45794579
android:label="@string/stub_name_povider"
45804580
android:process=":PluginP08" />

project/Libraries/DroidPlugin/build.gradle

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,14 @@ android {
3030
}
3131

3232
defaultConfig{
33+
3334
// 建议改为自己的 packageName + .droidplugin_stub ,防止跟其它本插件使用者冲突
3435
def authorityName = "com.morgoo.droidplugin_stub"
36+
3537
buildConfigField "String", "AUTHORITY_NAME", "\"${authorityName}\""
36-
resValue "string", "authority0", "${authorityName}_P00"
37-
resValue "string", "authority1", "${authorityName}_P01"
38-
resValue "string", "authority2", "${authorityName}_P02"
39-
resValue "string", "authority3", "${authorityName}_P03"
40-
resValue "string", "authority4", "${authorityName}_P04"
41-
resValue "string", "authority5", "${authorityName}_P05"
42-
resValue "string", "authority6", "${authorityName}_P06"
43-
resValue "string", "authority7", "${authorityName}_P07"
44-
resValue "string", "authority8", "${authorityName}_P08"
38+
manifestPlaceholders = [
39+
authorityName:"${authorityName}",
40+
]
4541
}
4642

4743
}

readme.md

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -71,26 +71,7 @@ It is very simple integrate Droid Plugin to your proejct:
7171
super.attachBaseContext(base);
7272
}
7373

74-
4. **All** `provider`'s `authorities` value in DroidPlugin's `Libraries\DroidPlugin\AndroidManifest.xml`
75-
default to be `com.morgoo.droidplugin_stub_P00`, e.g. :
76-
77-
<provider
78-
android:name="com.morgoo.droidplugin.stub.ContentProviderStub$StubP00"
79-
android:authorities="com.morgoo.droidplugin_stub_P00"
80-
android:exported="false"
81-
android:label="@string/stub_name_povider" />
82-
83-
You'd better change it to avoid conflict with other instances, e.g.:
84-
85-
<provider
86-
android:name="com.morgoo.droidplugin.stub.ContentProviderStub$StubP00"
87-
android:authorities="com.example.droidplugin_stub_P00"
88-
android:exported="false"
89-
android:label="@string/stub_name_povider" />
90-
and change ```PluginManager.STUB_AUTHORITY_NAME``` to your value:
91-
92-
PluginManager.STUB_AUTHORITY_NAME="com.example.droidplugin_stub"
93-
74+
4. Modify the `authorityName` value in `Libraries\DroidPlugin\build.gradle` (suggested use your package name)
9475

9576
####Install、Uninstall or Upgrade the plugged app:
9677

readme_cn.md

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -68,24 +68,7 @@ DroidPlugin 是***360手机助手***在Android系统上实现了一种新的***
6868
super.attachBaseContext(base);
6969
}
7070

71-
4. 将插件中`Libraries\DroidPlugin\AndroidManifest.xml`**所有**`provider`对应的`authorities`修改成自己的,默认为`com.morgoo.droidplugin_stub_P00`,如下:
72-
73-
<provider
74-
android:name="com.morgoo.droidplugin.stub.ContentProviderStub$StubP00"
75-
android:authorities="com.morgoo.droidplugin_stub_P00"
76-
android:exported="false"
77-
android:label="@string/stub_name_povider" />
78-
79-
可以修改为自己的包名,如: `com.example.droidplugin_stub_P00` 防止跟其它本插件使用者冲突:
80-
81-
<provider
82-
android:name="com.morgoo.droidplugin.stub.ContentProviderStub$StubP00"
83-
android:authorities="com.example.droidplugin_stub_P00"
84-
android:exported="false"
85-
android:label="@string/stub_name_povider" />
86-
并且修改```PluginManager.STUB_AUTHORITY_NAME``` 为你的值:
87-
88-
PluginManager.STUB_AUTHORITY_NAME="com.example.droidplugin_stub"
71+
4. 修改 `Libraries\DroidPlugin\build.gradle` 的 defaultConfig 配置中 `authorityName` 的值(建议改为自己的包名+标识,防止跟其它本插件使用者冲突)
8972

9073
5. 集成完成。
9174

0 commit comments

Comments
 (0)