Skip to content

Commit 8a1077d

Browse files
committed
feat: support YukiHookAPI 1.2.0
1 parent bde4dd2 commit 8a1077d

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

src/content/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
<i class="mdui-icon material-icons">photo_library</i>
135135
<label class="mdui-textfield-label i18n">{{addResourcesHookSupport}}</label>
136136
<select class="mdui-select" id="support_resources_hook_select">
137-
<option class="i18n" value="0">{{notConfigureDefYes}}</option>
137+
<option class="i18n" value="0">{{notConfigureDefNo}}</option>
138138
<option class="i18n" value="1">{{yesOfConfigure}}</option>
139139
<option class="i18n" value="2">{{noOfConfigure}}</option>
140140
</select>

src/libs/locale.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ const locale = {
178178
"later": "Later",
179179
"notConfigure": "Not Configured",
180180
"notConfigureDefYes": "Not Configured (Default Yes/Enabled)",
181+
"notConfigureDefNo": "Not Configured (Default No/Disabled)",
181182
"yesOfConfigure": "Yes/Enabled",
182183
"noOfConfigure": "No/Disabled",
183184
"version": "Version",
@@ -312,6 +313,7 @@ const locale = {
312313
"later": "稍后",
313314
"notConfigure": "未配置",
314315
"notConfigureDefYes": "未配置 (默认 是/Yes)",
316+
"notConfigureDefNo": "未配置 (默认 否/No)",
315317
"yesOfConfigure": "是/Yes",
316318
"noOfConfigure": "否/No",
317319
"version": "版本",
@@ -446,6 +448,7 @@ const locale = {
446448
"later": "後で",
447449
"notConfigure": "構成されていません",
448450
"notConfigureDefYes": "構成されていません (デフォルトは はい/Yes)",
451+
"notConfigureDefNo": "構成されていません (デフォルトは いいえ/No)",
449452
"yesOfConfigure": "はい/Yes",
450453
"noOfConfigure": "いいえ/No",
451454
"version": "バージョン",

src/transaction.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ const transaction = {
122122
'HookEntry.kt': {
123123
annotations: {
124124
entryClassName: (name) => 'entryClassName = "' + name + '"',
125-
supportResourcesHook: (isEnabled) => 'isUsingResourcesHook = ' + (isEnabled ? 'true' : 'false')
125+
supportResourcesHook: (isEnabled) => 'isUsingResourcesHook = ' + (isEnabled ? 'true' : 'false'),
126+
supportXposedModuleStatus: (isEnabled) => 'isUsingXposedModuleStatus = ' + (isEnabled ? 'true' : 'false')
126127
},
127128
configs: {
128129
debugLog: {
@@ -131,7 +132,6 @@ const transaction = {
131132
},
132133
enableDebug: (isEnabled) => 'isDebug = ' + (isEnabled ? 'true' : 'false'),
133134
enableResourcesCache: (isEnabled) => 'isEnableModuleAppResourcesCache = ' + (isEnabled ? 'true' : 'false'),
134-
enableModuleStatus: (isEnabled) => 'isEnableHookModuleStatus = ' + (isEnabled ? 'true' : 'false'),
135135
enableYChannel: (isEnabled) => 'isEnableDataChannel = ' + (isEnabled ? 'true' : 'false')
136136
}
137137
},
@@ -251,6 +251,11 @@ const transaction = {
251251
if (configs.yukiHookApiConfig.supportResourcesHook !== 0)
252252
hookEntryAnnotationCode = hookEntryAnnotationCode.concat(
253253
codeFiles['HookEntry.kt'].annotations.supportResourcesHook(configs.yukiHookApiConfig.supportResourcesHook === 1));
254+
if (configs.yukiHookApiConfig.supportResourcesHook !== 0 && configs.yukiHookApiConfig.enableModuleStatus !== 0)
255+
hookEntryAnnotationCode = hookEntryAnnotationCode.concat(', ');
256+
if (configs.yukiHookApiConfig.enableModuleStatus !== 0)
257+
hookEntryAnnotationCode = hookEntryAnnotationCode.concat(
258+
codeFiles['HookEntry.kt'].annotations.supportXposedModuleStatus(configs.yukiHookApiConfig.enableModuleStatus === 1));
254259
if (hookEntryAnnotationCode.trim() !== '')
255260
hookEntryAnnotationCode = '(' + (hookEntryAnnotationCode.trim().endsWith(',') ?
256261
hookEntryAnnotationCode.trim().substring(0, hookEntryAnnotationCode.trim().lastIndexOf(',')) :
@@ -276,9 +281,6 @@ const transaction = {
276281
if (configs.yukiHookApiConfig.enableResourcesCache !== 0)
277282
hookEntryConfigsCode = codeFiles.append(hookEntryConfigsCode,
278283
codeFiles['HookEntry.kt'].configs.enableResourcesCache(configs.yukiHookApiConfig.enableResourcesCache === 1));
279-
if (configs.yukiHookApiConfig.enableModuleStatus !== 0)
280-
hookEntryConfigsCode = codeFiles.append(hookEntryConfigsCode,
281-
codeFiles['HookEntry.kt'].configs.enableModuleStatus(configs.yukiHookApiConfig.enableModuleStatus === 1));
282284
if (configs.yukiHookApiConfig.enableYChannel !== 0)
283285
hookEntryConfigsCode = codeFiles.append(hookEntryConfigsCode,
284286
codeFiles['HookEntry.kt'].configs.enableYChannel(configs.yukiHookApiConfig.enableYChannel === 1));

0 commit comments

Comments
 (0)