cn.zhengzhanpeng.itchat4j.utils.Config Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of itchat4j Show documentation
Show all versions of itchat4j Show documentation
A application used to control wechat by java.
package cn.zhengzhanpeng.itchat4j.utils;
import cn.zhengzhanpeng.itchat4j.utils.enums.OsNameEnum;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
public class Config {
public static final String API_WXAPPID = "API_WXAPPID";
public static final String USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36";
public static final ArrayList API_SPECIAL_USER = new ArrayList(Arrays.asList("filehelper", "weibo",
"qqmail", "fmessage", "tmessage", "qmessage", "qqsync", "floatbottle", "lbsapp", "shakeapp", "medianote",
"qqfriend", "readerapp", "blogapp", "facebookapp", "masssendapp", "meishiapp", "feedsapp", "voip",
"blogappweixin", "brandsessionholder", "weixin", "weixinreminder", "officialaccounts", "wxitil",
"notification_messages", "wxid_novlwrv3lqwv11", "gh_22b87fa7cb3c", "userexperience_alarm"));
public static String getLocalPath() {
String localPath = null;
try {
localPath = new File("").getCanonicalPath();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return localPath;
}
/**
* 获取系统平台
*/
public static OsNameEnum getOsNameEnum() {
String os = System.getProperty("os.name").toUpperCase();
if (os.indexOf(OsNameEnum.DARWIN.toString()) >= 0) {
return OsNameEnum.DARWIN;
} else if (os.indexOf(OsNameEnum.WINDOWS.toString()) >= 0) {
return OsNameEnum.WINDOWS;
} else if (os.indexOf(OsNameEnum.LINUX.toString()) >= 0) {
return OsNameEnum.LINUX;
} else if (os.indexOf(OsNameEnum.MAC.toString()) >= 0) {
return OsNameEnum.MAC;
}
return OsNameEnum.OTHER;
}
}