Skip to content

Commit f9edfa7

Browse files
committed
Modify merge into new way of implementation since API 1.1.0
1 parent 74d12c0 commit f9edfa7

File tree

4 files changed

+40
-30
lines changed

4 files changed

+40
-30
lines changed

src/content/index.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,22 +141,22 @@
141141
</div>
142142
<div class="mdui-textfield mdui-textfield-floating-label">
143143
<i class="mdui-icon material-icons">local_offer</i>
144-
<label class="mdui-textfield-label i18n">{{debugTagName}}</label>
145-
<input class="mdui-textfield-input" id="debug_tag_name_text"/>
144+
<label class="mdui-textfield-label i18n">{{debugLogTagName}}</label>
145+
<input class="mdui-textfield-input" id="debug_log_tag_name_text"/>
146146
</div>
147147
<div class="mdui-textfield">
148-
<i class="mdui-icon material-icons">bug_report</i>
149-
<label class="mdui-textfield-label i18n">{{enableDebugMode}}</label>
150-
<select class="mdui-select" id="enable_debug_select">
148+
<i class="mdui-icon material-icons">pageview</i>
149+
<label class="mdui-textfield-label i18n">{{enableDebugLog}}</label>
150+
<select class="mdui-select" id="enable_debug_log_select">
151151
<option class="i18n" value="0">{{notConfigureDefYes}}</option>
152152
<option class="i18n" value="1">{{yesOfConfigure}}</option>
153153
<option class="i18n" value="2">{{noOfConfigure}}</option>
154154
</select>
155155
</div>
156156
<div class="mdui-textfield">
157-
<i class="mdui-icon material-icons">pageview</i>
158-
<label class="mdui-textfield-label i18n">{{enablePrintLogcat}}</label>
159-
<select class="mdui-select" id="enable_print_logcat_select">
157+
<i class="mdui-icon material-icons">bug_report</i>
158+
<label class="mdui-textfield-label i18n">{{enableDebugMode}}</label>
159+
<select class="mdui-select" id="enable_debug_select">
160160
<option class="i18n" value="0">{{notConfigureDefYes}}</option>
161161
<option class="i18n" value="1">{{yesOfConfigure}}</option>
162162
<option class="i18n" value="2">{{noOfConfigure}}</option>

src/content/render.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ const projectConfigs = {
6767
},
6868
yukiHookApiConfig: {
6969
entryClassName: '',
70-
debugTagName: '',
70+
debugLogTagName: '',
7171
supportResourcesHook: 0,
7272
enableDebug: 0,
73-
enablePrintLogcat: 0,
73+
enableDebugLog: 0,
7474
enableYPrefsCache: 0,
7575
enableResourcesCache: 0,
7676
enableModuleStatus: 0,
@@ -301,13 +301,13 @@ const configForm = {
301301
appTargetApiText: () => $('#app_target_api_text').val(),
302302
xposedMinApiText: () => $('#xposed_min_api_text').val(),
303303
entryClassNameText: () => $('#entry_class_name_text').val(),
304-
debugTagNameText: () => $('#debug_tag_name_text').val(),
304+
debugLogTagNameText: () => $('#debug_log_tag_name_text').val(),
305305
compomentSelect: () => valUtils.integerOf($('#compoment_select option:selected').val()),
306306
targetXposedPlatformSelect: () => valUtils.integerOf($('#target_xposed_platform_select option:selected').val()),
307307
newXSharePrefsSelect: () => valUtils.integerOf($('#new_xshare_prefs_select option:selected').val()),
308308
supportResourcesHookSelect: () => valUtils.integerOf($('#support_resources_hook_select option:selected').val()),
309309
enableDebugSelect: () => valUtils.integerOf($('#enable_debug_select option:selected').val()),
310-
enablePrintLogcatSelect: () => valUtils.integerOf($('#enable_print_logcat_select option:selected').val()),
310+
enableDebugLogSelect: () => valUtils.integerOf($('#enable_debug_log_select option:selected').val()),
311311
enableYPrefsCacheSelect: () => valUtils.integerOf($('#enable_yprefs_cache_select option:selected').val()),
312312
enableResourcesCacheSelect: () => valUtils.integerOf($('#enable_resources_cache_select option:selected').val()),
313313
enableModuleStatusSelect: () => valUtils.integerOf($('#enable_module_status_select option:selected').val()),
@@ -343,10 +343,10 @@ const build = {
343343
projectConfigs.basicConfig.newXSharePrefs = configForm.newXSharePrefsSelect();
344344
projectConfigs.basicConfig.moduleScopes = moduleScope.moduleScopesData();
345345
projectConfigs.yukiHookApiConfig.entryClassName = configForm.entryClassNameText();
346-
projectConfigs.yukiHookApiConfig.debugTagName = configForm.debugTagNameText();
346+
projectConfigs.yukiHookApiConfig.debugLogTagName = configForm.debugLogTagNameText();
347347
projectConfigs.yukiHookApiConfig.supportResourcesHook = configForm.supportResourcesHookSelect();
348348
projectConfigs.yukiHookApiConfig.enableDebug = configForm.enableDebugSelect();
349-
projectConfigs.yukiHookApiConfig.enablePrintLogcat = configForm.enablePrintLogcatSelect();
349+
projectConfigs.yukiHookApiConfig.enableDebugLog = configForm.enableDebugLogSelect();
350350
projectConfigs.yukiHookApiConfig.enableYPrefsCache = configForm.enableYPrefsCacheSelect();
351351
projectConfigs.yukiHookApiConfig.enableResourcesCache = configForm.enableResourcesCacheSelect();
352352
projectConfigs.yukiHookApiConfig.enableModuleStatus = configForm.enableModuleStatusSelect();
@@ -615,13 +615,13 @@ const configTemplate = {
615615
$('#app_target_api_text').val(data.basicConfig.appTargetApi);
616616
$('#xposed_min_api_text').val(data.basicConfig.xposedMinApi);
617617
$('#entry_class_name_text').val(data.yukiHookApiConfig.entryClassName);
618-
$('#debug_tag_name_text').val(data.yukiHookApiConfig.debugTagName);
618+
$('#debug_log_tag_name_text').val(data.yukiHookApiConfig.debugLogTagName);
619619
$('#compoment_select').val(data.basicConfig.moduleCompoment);
620620
$('#target_xposed_platform_select').val(data.basicConfig.targetXposedPlatform);
621621
$('#new_xshare_prefs_select').val(data.basicConfig.newXSharePrefs);
622622
$('#support_resources_hook_select').val(data.yukiHookApiConfig.supportResourcesHook);
623623
$('#enable_debug_select').val(data.yukiHookApiConfig.enableDebug);
624-
$('#enable_print_logcat_select').val(data.yukiHookApiConfig.enablePrintLogcat);
624+
$('#enable_debug_log_select').val(data.yukiHookApiConfig.enableDebugLog);
625625
$('#enable_yprefs_cache_select').val(data.yukiHookApiConfig.enableYPrefsCache);
626626
$('#enable_resources_cache_select').val(data.yukiHookApiConfig.enableResourcesCache);
627627
$('#enable_module_status_select').val(data.yukiHookApiConfig.enableModuleStatus);

src/libs/locale.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ const locale = {
121121
"addApps": "Add apps",
122122
"entryClassName": "Entry class name (When blank use the default value)",
123123
"addResourcesHookSupport": "Add Resources Hook support",
124-
"debugTagName": "Debug TAG name (Default is YukiHookAPI)",
124+
"debugLogTagName": "Debug log TAG name (Default is YukiHookAPI)",
125125
"enableDebugMode": "Enable debug mode",
126-
"enablePrintLogcat": "Enable debug log output",
126+
"enableDebugLog": "Enable debug log output",
127127
"enableYukiHookModulePrefsCache": "Enable YukiHookModulePrefs key-value caching",
128128
"enableModuleResourcesCache": "Enable module Resources caching",
129129
"enableModuleStatus": "Enable module activation status listening",
@@ -256,9 +256,9 @@ const locale = {
256256
"addApps": "添加应用",
257257
"entryClassName": "入口类名 (不填使用默认值生成)",
258258
"addResourcesHookSupport": "添加 Resources Hook 支持",
259-
"debugTagName": "Debug TAG 名称 (不填默认为 YukiHookAPI)",
259+
"debugLogTagName": "调试日志 TAG 名称 (不填默认为 YukiHookAPI)",
260260
"enableDebugMode": "启用 Debug 模式",
261-
"enablePrintLogcat": "启用调试日志输出功能",
261+
"enableDebugLog": "启用调试日志输出功能",
262262
"enableYukiHookModulePrefsCache": "启用 YukiHookModulePrefs 键值缓存功能",
263263
"enableModuleResourcesCache": "启用模块 Resources 缓存功能",
264264
"enableModuleStatus": "启用模块激活状态监听功能",
@@ -391,9 +391,9 @@ const locale = {
391391
"addApps": "アプリを追加",
392392
"entryClassName": "エントリクラス名(デフォルトを使用するには空)",
393393
"addResourcesHookSupport": "リソースフックのサポートを追加",
394-
"debugTagName": "デバッグタグ名(デフォルトはYukiHookAPI)",
394+
"debugLogTagName": "デバッググロタグ名(デフォルトはYukiHookAPI)",
395395
"enableDebugMode": "デバッグモードを有効にする",
396-
"enablePrintLogcat": "デバッグログ出力を有効にする",
396+
"enableDebugLog": "デバッグログ出力を有効にする",
397397
"enableYukiHookModulePrefsCache": "YukiHookModulePrefsのKey-Valueキャッシングを有効にする",
398398
"enableModuleResourcesCache": "モジュールリソースのキャッシュを有効にする",
399399
"enableModuleStatus": "モジュールのアクティブ化ステータスの監視を有効にする",

src/transaction.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,11 @@ const transaction = {
210210
supportResourcesHook: (isEnabled) => 'isUsingResourcesHook = ' + (isEnabled ? 'true' : 'false')
211211
},
212212
configs: {
213-
debugTagName: (name) => 'debugTag = "' + name + '"',
213+
debugLog: {
214+
tagName: (name) => 'tag = "' + name + '"',
215+
enable: (isEnabled) => 'isEnable = ' + (isEnabled ? 'true' : 'false')
216+
},
214217
enableDebug: (isEnabled) => 'isDebug = ' + (isEnabled ? 'true' : 'false'),
215-
enablePrintLogcat: (isEnabled) => 'isAllowPrintingLogs = ' + (isEnabled ? 'true' : 'false'),
216218
enableYPrefsCache: (isEnabled) => 'isEnableModulePrefsCache = ' + (isEnabled ? 'true' : 'false'),
217219
enableResourcesCache: (isEnabled) => 'isEnableModuleAppResourcesCache = ' + (isEnabled ? 'true' : 'false'),
218220
enableModuleStatus: (isEnabled) => 'isEnableHookModuleStatus = ' + (isEnabled ? 'true' : 'false'),
@@ -331,15 +333,23 @@ const transaction = {
331333
hookEntryAnnotationCode.trim().substring(0, hookEntryAnnotationCode.trim().lastIndexOf(',')) :
332334
hookEntryAnnotationCode.trim()) + ')';
333335
let hookEntryConfigsCode = '';
334-
if (configs.yukiHookApiConfig.debugTagName !== '')
335-
hookEntryConfigsCode = codeFiles.append(hookEntryConfigsCode,
336-
codeFiles['HookEntry.kt'].configs.debugTagName(configs.yukiHookApiConfig.debugTagName));
336+
if (configs.yukiHookApiConfig.debugLogTagName !== '' || configs.yukiHookApiConfig.enableDebugLog !== 0) {
337+
hookEntryConfigsCode += 'debugLog {\n';
338+
hookEntryConfigsCode += codeFiles.space(12);
339+
if (configs.yukiHookApiConfig.debugLogTagName !== '') {
340+
hookEntryConfigsCode = codeFiles.append(hookEntryConfigsCode,
341+
codeFiles['HookEntry.kt'].configs.debugLog.tagName(configs.yukiHookApiConfig.debugLogTagName));
342+
if (configs.yukiHookApiConfig.enableDebugLog !== 0) hookEntryConfigsCode += codeFiles.space(4);
343+
}
344+
if (configs.yukiHookApiConfig.enableDebugLog !== 0)
345+
hookEntryConfigsCode = codeFiles.append(hookEntryConfigsCode,
346+
codeFiles['HookEntry.kt'].configs.debugLog.enable(configs.yukiHookApiConfig.enableDebugLog === 1));
347+
hookEntryConfigsCode += '}\n';
348+
hookEntryConfigsCode += codeFiles.space(8);
349+
}
337350
if (configs.yukiHookApiConfig.enableDebug !== 0)
338351
hookEntryConfigsCode = codeFiles.append(hookEntryConfigsCode,
339352
codeFiles['HookEntry.kt'].configs.enableDebug(configs.yukiHookApiConfig.enableDebug === 1));
340-
if (configs.yukiHookApiConfig.enablePrintLogcat !== 0)
341-
hookEntryConfigsCode = codeFiles.append(hookEntryConfigsCode,
342-
codeFiles['HookEntry.kt'].configs.enablePrintLogcat(configs.yukiHookApiConfig.enablePrintLogcat === 1));
343353
if (configs.yukiHookApiConfig.enableYPrefsCache !== 0)
344354
hookEntryConfigsCode = codeFiles.append(hookEntryConfigsCode,
345355
codeFiles['HookEntry.kt'].configs.enableYPrefsCache(configs.yukiHookApiConfig.enableYPrefsCache === 1));

0 commit comments

Comments
 (0)