⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 protectedchatapplication.java

📁 《透视Java》的源码
💻 JAVA
字号:
package covertjava.protect;import covertjava.chat.ChatApplication;import java.io.File;import covertjava.util.AppProperties;/** * <p>Alternative entry point into the Chat application that applies various * protection mechanisms</p> * <p>Copyright: Copyright (c) 2004 Sams Publishing</p> * @author Alex Kalinovsky * @version 1.0 */public class ProtectedChatApplication {    public static void main(String[] args) throws Exception {        // Verify that the license file is valid        LicenseManager licenseManager = new LicenseManager("conf/chat.license");        // Verify that the license manager class is not hacked        IntegrityProtector protector = new IntegrityProtector();        protector.assertClassSource(licenseManager.getClass(), "/lib/chat.jar");        // Read the checksum from configuration file and verify the current installation        String homePath = System.getProperty("chat.home");        String propPath = homePath + File.separator + "conf" + File.separator + "chat.properties";        AppProperties props = new AppProperties(propPath);        String checkSum = props.getProperty("chat.versionInfo");        String[] paths = protector.readFilePathsFromResource("ChatFileList.class");        protector.assertFilesIntegrity(paths, '\\', homePath, checkSum);        // Check license invormation        licenseManager.verifySerialNumber("conf/key_public.ser");        if (licenseManager.isHostAllowed() == false)            throw new Exception("Host is not allowed by the license");        if (licenseManager.isLicenseExpired() == true)            throw new Exception("The license is expired");        // Launch Chat application        ChatApplication.main(args);    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -