diff --git a/src/.vuepress/config.ts b/src/.vuepress/config.ts index 6208f4cb..f4768c69 100644 --- a/src/.vuepress/config.ts +++ b/src/.vuepress/config.ts @@ -7,16 +7,13 @@ export default defineUserConfig({ base: "/DailyNotes/", lang: "zh-CN", - title: "echo0d'notes", - description: "echo0d'notes-vuepress", + title: "echo0d-notes", + description: "echo0d-notes-vuepress", bundler: viteBundler(), // 主题配置 theme, - // Enable it with pwa // shouldPrefetch: false, // plugins: [ - // searchProPlugin({ - // }), // ], }); diff --git a/src/.vuepress/theme.ts b/src/.vuepress/theme.ts index ff70c602..33470df9 100644 --- a/src/.vuepress/theme.ts +++ b/src/.vuepress/theme.ts @@ -25,6 +25,7 @@ export default hopeTheme({ navbar: Navbar, // 侧边栏 sidebar: Sidebar, + sidebarSorter: ["readme", "order", "filename","title"], footer: "听君一席话,如听一席话", diff --git a/src/develop/Java/8_Native.md b/src/develop/Java/8_Native.md new file mode 100644 index 00000000..55be30f6 --- /dev/null +++ b/src/develop/Java/8_Native.md @@ -0,0 +1,30 @@ +# 8-Native关键字 + +在Java中,native关键字用于声明一个方法是由本地代码(通常是C或C++)实现的。这意味着该方法的具体实现不是用Java编写的,而是由底层的本地代码提供。 + +## native关键字的作用 + +- 与本地代码进行交互:通过native方法,Java程序可以与本地代码进行交互,调用本地库中的函数,实现更高效的操作,或者访问底层系统资源。 +- 提高性能:使用本地代码实现某些功能通常比纯Java代码更高效。通过native方法,可以利用底层系统资源和优化的算法,提高程序的性能。 + +## native关键字的使用方法 + +要声明一个native方法,只需在Java方法的声明中加上native关键字,并且不需要提供方法的实现。例如: +```java +public native void nativeMethod(); +``` + +在这个例子中,`nativeMethod()`是一个native方法,它的具体实现将在本地代码中提供。 + +为了使用native方法,必须在Java程序中加载本地库,并确保本地库中包含了所需的函数。本地库可以使用Java的JNI(Java Native Interface)来编写,并在程序运行时通过`System.loadLibrary()` 方法加载。下面是一个简单的示例: + +```java +public class NativeExample { + static { System.loadLibrary("nativeLibrary"); } + public native void nativeMethod(); + public static void main(String[] args) { new NativeExample().nativeMethod(); } +} +``` + + + diff --git a/src/develop/other/anti-debug.md b/src/develop/other/anti-debug.md index f77297e7..83eeb2e9 100644 --- a/src/develop/other/anti-debug.md +++ b/src/develop/other/anti-debug.md @@ -1,7 +1,7 @@ # 反调试 反调试技术用于检测和防止调试器附加到程序上,以保护程序免受逆向工程和调试。以下是几种编程语言中的常见反调试方法: -### Java +## Java ### 检查JVM启动参数 检查启动参数中是否包含调试相关选项。 @@ -173,6 +173,7 @@ bool isDebuggerAttached() { ``` + ## Python 1. **检查调试器模块**:检查是否加载了调试器模块。