Modify merge into new way of implementation since API 1.1.0

This commit is contained in:
2022-09-22 21:39:20 +08:00
parent 74d12c03b4
commit f9edfa7a93
4 changed files with 40 additions and 30 deletions

View File

@@ -141,22 +141,22 @@
</div>
<div class="mdui-textfield mdui-textfield-floating-label">
<i class="mdui-icon material-icons">local_offer</i>
<label class="mdui-textfield-label i18n">{{debugTagName}}</label>
<input class="mdui-textfield-input" id="debug_tag_name_text"/>
<label class="mdui-textfield-label i18n">{{debugLogTagName}}</label>
<input class="mdui-textfield-input" id="debug_log_tag_name_text"/>
</div>
<div class="mdui-textfield">
<i class="mdui-icon material-icons">bug_report</i>
<label class="mdui-textfield-label i18n">{{enableDebugMode}}</label>
<select class="mdui-select" id="enable_debug_select">
<i class="mdui-icon material-icons">pageview</i>
<label class="mdui-textfield-label i18n">{{enableDebugLog}}</label>
<select class="mdui-select" id="enable_debug_log_select">
<option class="i18n" value="0">{{notConfigureDefYes}}</option>
<option class="i18n" value="1">{{yesOfConfigure}}</option>
<option class="i18n" value="2">{{noOfConfigure}}</option>
</select>
</div>
<div class="mdui-textfield">
<i class="mdui-icon material-icons">pageview</i>
<label class="mdui-textfield-label i18n">{{enablePrintLogcat}}</label>
<select class="mdui-select" id="enable_print_logcat_select">
<i class="mdui-icon material-icons">bug_report</i>
<label class="mdui-textfield-label i18n">{{enableDebugMode}}</label>
<select class="mdui-select" id="enable_debug_select">
<option class="i18n" value="0">{{notConfigureDefYes}}</option>
<option class="i18n" value="1">{{yesOfConfigure}}</option>
<option class="i18n" value="2">{{noOfConfigure}}</option>

View File

@@ -67,10 +67,10 @@ const projectConfigs = {
},
yukiHookApiConfig: {
entryClassName: '',
debugTagName: '',
debugLogTagName: '',
supportResourcesHook: 0,
enableDebug: 0,
enablePrintLogcat: 0,
enableDebugLog: 0,
enableYPrefsCache: 0,
enableResourcesCache: 0,
enableModuleStatus: 0,
@@ -301,13 +301,13 @@ const configForm = {
appTargetApiText: () => $('#app_target_api_text').val(),
xposedMinApiText: () => $('#xposed_min_api_text').val(),
entryClassNameText: () => $('#entry_class_name_text').val(),
debugTagNameText: () => $('#debug_tag_name_text').val(),
debugLogTagNameText: () => $('#debug_log_tag_name_text').val(),
compomentSelect: () => valUtils.integerOf($('#compoment_select option:selected').val()),
targetXposedPlatformSelect: () => valUtils.integerOf($('#target_xposed_platform_select option:selected').val()),
newXSharePrefsSelect: () => valUtils.integerOf($('#new_xshare_prefs_select option:selected').val()),
supportResourcesHookSelect: () => valUtils.integerOf($('#support_resources_hook_select option:selected').val()),
enableDebugSelect: () => valUtils.integerOf($('#enable_debug_select option:selected').val()),
enablePrintLogcatSelect: () => valUtils.integerOf($('#enable_print_logcat_select option:selected').val()),
enableDebugLogSelect: () => valUtils.integerOf($('#enable_debug_log_select option:selected').val()),
enableYPrefsCacheSelect: () => valUtils.integerOf($('#enable_yprefs_cache_select option:selected').val()),
enableResourcesCacheSelect: () => valUtils.integerOf($('#enable_resources_cache_select option:selected').val()),
enableModuleStatusSelect: () => valUtils.integerOf($('#enable_module_status_select option:selected').val()),
@@ -343,10 +343,10 @@ const build = {
projectConfigs.basicConfig.newXSharePrefs = configForm.newXSharePrefsSelect();
projectConfigs.basicConfig.moduleScopes = moduleScope.moduleScopesData();
projectConfigs.yukiHookApiConfig.entryClassName = configForm.entryClassNameText();
projectConfigs.yukiHookApiConfig.debugTagName = configForm.debugTagNameText();
projectConfigs.yukiHookApiConfig.debugLogTagName = configForm.debugLogTagNameText();
projectConfigs.yukiHookApiConfig.supportResourcesHook = configForm.supportResourcesHookSelect();
projectConfigs.yukiHookApiConfig.enableDebug = configForm.enableDebugSelect();
projectConfigs.yukiHookApiConfig.enablePrintLogcat = configForm.enablePrintLogcatSelect();
projectConfigs.yukiHookApiConfig.enableDebugLog = configForm.enableDebugLogSelect();
projectConfigs.yukiHookApiConfig.enableYPrefsCache = configForm.enableYPrefsCacheSelect();
projectConfigs.yukiHookApiConfig.enableResourcesCache = configForm.enableResourcesCacheSelect();
projectConfigs.yukiHookApiConfig.enableModuleStatus = configForm.enableModuleStatusSelect();
@@ -615,13 +615,13 @@ const configTemplate = {
$('#app_target_api_text').val(data.basicConfig.appTargetApi);
$('#xposed_min_api_text').val(data.basicConfig.xposedMinApi);
$('#entry_class_name_text').val(data.yukiHookApiConfig.entryClassName);
$('#debug_tag_name_text').val(data.yukiHookApiConfig.debugTagName);
$('#debug_log_tag_name_text').val(data.yukiHookApiConfig.debugLogTagName);
$('#compoment_select').val(data.basicConfig.moduleCompoment);
$('#target_xposed_platform_select').val(data.basicConfig.targetXposedPlatform);
$('#new_xshare_prefs_select').val(data.basicConfig.newXSharePrefs);
$('#support_resources_hook_select').val(data.yukiHookApiConfig.supportResourcesHook);
$('#enable_debug_select').val(data.yukiHookApiConfig.enableDebug);
$('#enable_print_logcat_select').val(data.yukiHookApiConfig.enablePrintLogcat);
$('#enable_debug_log_select').val(data.yukiHookApiConfig.enableDebugLog);
$('#enable_yprefs_cache_select').val(data.yukiHookApiConfig.enableYPrefsCache);
$('#enable_resources_cache_select').val(data.yukiHookApiConfig.enableResourcesCache);
$('#enable_module_status_select').val(data.yukiHookApiConfig.enableModuleStatus);

View File

@@ -121,9 +121,9 @@ const locale = {
"addApps": "Add apps",
"entryClassName": "Entry class name (When blank use the default value)",
"addResourcesHookSupport": "Add Resources Hook support",
"debugTagName": "Debug TAG name (Default is YukiHookAPI)",
"debugLogTagName": "Debug log TAG name (Default is YukiHookAPI)",
"enableDebugMode": "Enable debug mode",
"enablePrintLogcat": "Enable debug log output",
"enableDebugLog": "Enable debug log output",
"enableYukiHookModulePrefsCache": "Enable YukiHookModulePrefs key-value caching",
"enableModuleResourcesCache": "Enable module Resources caching",
"enableModuleStatus": "Enable module activation status listening",
@@ -256,9 +256,9 @@ const locale = {
"addApps": "添加应用",
"entryClassName": "入口类名 (不填使用默认值生成)",
"addResourcesHookSupport": "添加 Resources Hook 支持",
"debugTagName": "Debug TAG 名称 (不填默认为 YukiHookAPI)",
"debugLogTagName": "调试日志 TAG 名称 (不填默认为 YukiHookAPI)",
"enableDebugMode": "启用 Debug 模式",
"enablePrintLogcat": "启用调试日志输出功能",
"enableDebugLog": "启用调试日志输出功能",
"enableYukiHookModulePrefsCache": "启用 YukiHookModulePrefs 键值缓存功能",
"enableModuleResourcesCache": "启用模块 Resources 缓存功能",
"enableModuleStatus": "启用模块激活状态监听功能",
@@ -391,9 +391,9 @@ const locale = {
"addApps": "アプリを追加",
"entryClassName": "エントリクラス名(デフォルトを使用するには空)",
"addResourcesHookSupport": "リソースフックのサポートを追加",
"debugTagName": "デバッグタグ名デフォルトはYukiHookAPI",
"debugLogTagName": "デバッググロタグ名デフォルトはYukiHookAPI",
"enableDebugMode": "デバッグモードを有効にする",
"enablePrintLogcat": "デバッグログ出力を有効にする",
"enableDebugLog": "デバッグログ出力を有効にする",
"enableYukiHookModulePrefsCache": "YukiHookModulePrefsのKey-Valueキャッシングを有効にする",
"enableModuleResourcesCache": "モジュールリソースのキャッシュを有効にする",
"enableModuleStatus": "モジュールのアクティブ化ステータスの監視を有効にする",

View File

@@ -210,9 +210,11 @@ const transaction = {
supportResourcesHook: (isEnabled) => 'isUsingResourcesHook = ' + (isEnabled ? 'true' : 'false')
},
configs: {
debugTagName: (name) => 'debugTag = "' + name + '"',
debugLog: {
tagName: (name) => 'tag = "' + name + '"',
enable: (isEnabled) => 'isEnable = ' + (isEnabled ? 'true' : 'false')
},
enableDebug: (isEnabled) => 'isDebug = ' + (isEnabled ? 'true' : 'false'),
enablePrintLogcat: (isEnabled) => 'isAllowPrintingLogs = ' + (isEnabled ? 'true' : 'false'),
enableYPrefsCache: (isEnabled) => 'isEnableModulePrefsCache = ' + (isEnabled ? 'true' : 'false'),
enableResourcesCache: (isEnabled) => 'isEnableModuleAppResourcesCache = ' + (isEnabled ? 'true' : 'false'),
enableModuleStatus: (isEnabled) => 'isEnableHookModuleStatus = ' + (isEnabled ? 'true' : 'false'),
@@ -331,15 +333,23 @@ const transaction = {
hookEntryAnnotationCode.trim().substring(0, hookEntryAnnotationCode.trim().lastIndexOf(',')) :
hookEntryAnnotationCode.trim()) + ')';
let hookEntryConfigsCode = '';
if (configs.yukiHookApiConfig.debugTagName !== '')
hookEntryConfigsCode = codeFiles.append(hookEntryConfigsCode,
codeFiles['HookEntry.kt'].configs.debugTagName(configs.yukiHookApiConfig.debugTagName));
if (configs.yukiHookApiConfig.debugLogTagName !== '' || configs.yukiHookApiConfig.enableDebugLog !== 0) {
hookEntryConfigsCode += 'debugLog {\n';
hookEntryConfigsCode += codeFiles.space(12);
if (configs.yukiHookApiConfig.debugLogTagName !== '') {
hookEntryConfigsCode = codeFiles.append(hookEntryConfigsCode,
codeFiles['HookEntry.kt'].configs.debugLog.tagName(configs.yukiHookApiConfig.debugLogTagName));
if (configs.yukiHookApiConfig.enableDebugLog !== 0) hookEntryConfigsCode += codeFiles.space(4);
}
if (configs.yukiHookApiConfig.enableDebugLog !== 0)
hookEntryConfigsCode = codeFiles.append(hookEntryConfigsCode,
codeFiles['HookEntry.kt'].configs.debugLog.enable(configs.yukiHookApiConfig.enableDebugLog === 1));
hookEntryConfigsCode += '}\n';
hookEntryConfigsCode += codeFiles.space(8);
}
if (configs.yukiHookApiConfig.enableDebug !== 0)
hookEntryConfigsCode = codeFiles.append(hookEntryConfigsCode,
codeFiles['HookEntry.kt'].configs.enableDebug(configs.yukiHookApiConfig.enableDebug === 1));
if (configs.yukiHookApiConfig.enablePrintLogcat !== 0)
hookEntryConfigsCode = codeFiles.append(hookEntryConfigsCode,
codeFiles['HookEntry.kt'].configs.enablePrintLogcat(configs.yukiHookApiConfig.enablePrintLogcat === 1));
if (configs.yukiHookApiConfig.enableYPrefsCache !== 0)
hookEntryConfigsCode = codeFiles.append(hookEntryConfigsCode,
codeFiles['HookEntry.kt'].configs.enableYPrefsCache(configs.yukiHookApiConfig.enableYPrefsCache === 1));