柬埔寨通 v6.1.5版本的 MD5 值为:9b68581ac30883219d6a25858a099d6b
以下内容为反编译后的 SiteConfig.java 源代码,内容仅作参考
package net.duohuo.magappx;
import android.graphics.Bitmap;
import android.text.TextUtils;
import android.util.Base64;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import com.facebook.drawee.backends.pipeline.Fresco;
import com.huawei.hms.support.hianalytics.HiAnalyticsConstant;
import com.jianpuzhaitong.forum.R;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import net.duohuo.core.fresco.FrescoImageView;
import net.duohuo.core.ioc.Ioc;
import net.duohuo.core.net.Net;
import net.duohuo.core.net.Result;
import net.duohuo.core.net.Task;
import net.duohuo.core.util.BeanUtil;
import net.duohuo.core.util.FileUtil;
import net.duohuo.core.util.PhotoUtil;
import net.duohuo.core.util.Preference;
import net.duohuo.core.util.SafeJsonUtil;
import net.duohuo.core.util.StrUtil;
import net.duohuo.magappx.API;
import net.duohuo.magappx.chat.util.LocalFilePath;
import net.duohuo.magappx.main.login.UserApi;
public class SiteConfig extends Preference {
public static final String FRIEND_CIRCLE_ICON_TYPE = "friend_circle";
public static final String QQ_ICON_TYPE = "qq";
public static final String QQ_ZONE_ICON_TYPE = "qq_zone";
public static final String WECHAT_FRIEND_ICON_TYPE = "wechat_friend";
public static final String WEIBO_ICON_TYPE = "weibo";
public String appInfo;
@JSONField(name = "appreciate_button_text")
public String appreciate_button_text;
@JSONField(name = "appreciate_enter_replace_text")
public String appreciate_enter_replace_text;
private JSONObject attachJson;
public String by_app_secret;
public String change_post_is_go_tree;
public String chat_safe_keyword_remain_word;
public String chat_safe_remain_word;
public String choose_topic_max;
public String cms_oc_tip;
public String community_wap_url;
@JSONField(name = "country_code")
public String countryCode;
@JSONField(name = "default_forum")
public JSONObject defaultForum;
@JSONField(name = "default_show")
public JSONObject defaultShow;
@JSONField(name = "domain_black_list")
public List<JSONObject> domainBlackList;
@JSONField(name = "domain_cooperation")
public List<String> domainCooperation;
@JSONField(name = "domain_white")
public List<String> domainWhite;
public int feature_pack_time;
@JSONField(name = "feeds_focus_title")
public String feedsFocusTitle;
@JSONField(name = "feeds_forward_type")
public String feedsForwardType;
@JSONField(name = "feeds_name")
public String feedsName;
@JSONField(name = "feeds_near_title")
public String feedsNearTitle;
@JSONField(name = "feeds_recommend_title")
public String feedsRecommendTitle;
@JSONField(name = "find_person_link")
public String findPersonLink;
public String find_wap_url;
@JSONField(name = "flashimage")
public FlashPicConfig flashPicConfig;
@JSONField(name = "global_circle_senior_shoot_voice")
public String globalCirlceSeniorShootVoice;
@JSONField(name = "global_default_publish_type")
public String globalDefaultPublishType;
@JSONField(name = "global_pswd_link")
public String globalPswdLink;
@JSONField(name = "global_quick_publish_config")
public String globalQuickPublishConfig;
@JSONField(name = "global_user_write_off_url")
public String globalUserWriteOffurl;
@JSONField(name = "global_username_change_thread_url")
public String globalUsernameChangeThreadUrl;
@JSONField(name = "global_voice_broadcast_open")
public String globalVoiceBroadcastOpen;
public String global_app_age_register_max;
public String global_app_age_register_min;
public String global_app_age_register_tip;
public String global_circle_regular_expression;
public String global_cloud_ad_close_open;
public String global_cloud_ad_close_txt;
public int global_coding_open_status;
public String global_invite_register_tip;
public String global_is_open_senior_shoot;
public String global_is_open_share_red_packet;
public String global_is_open_topic;
public String global_pswd_tip;
public String global_thread_regular_expression;
public String global_video_force_compress;
@JSONField(name = "groups_is_open_user_create")
public String groupOpenUserCreate;
@JSONField(name = "help_url")
public String helpUrl;
@JSONField(name = "global_user_home_regular_expression")
public String homeEep;
public String im_msg_read_status_io;
public int index_sign_open;
public String invite;
public String invite_code_txt;
@JSONField(name = "is_open_cert")
public boolean isOpenCert;
@JSONField(name = "user_is_open_more_data")
public int isOpenMoreData;
@JSONField(name = "is_open_my_tag")
public boolean isOpenMyTag;
@JSONField(name = "is_open_top_thread_bg_highlight")
public String isOpenTopThreadBgHighlight;
@JSONField(name = "global_user_security_login")
public String isShowLoginCode;
@JSONField(name = "global_user_security_regist")
public String isShowRegistCode;
public int is_open_index_multi_column;
public String is_open_message;
public String is_open_share_task;
public String job_domain;
public String job_message_list;
public String jump_to_circle;
public String jump_to_forum;
@JSONField(name = "kdh_app_key")
public String kdhAppKey;
@JSONField(name = "kdh_app_secret")
public String kdhAppSecret;
public String ksw_app_key;
@JSONField(name = "live_admin_id")
public String live_admin_id;
public String local_circle_wap_url;
@JSONField(name = "video_watermark_pic")
public VideoWatermarkPic mVideoWatermarkPic;
public String mag_shop_coupon_url;
public String magapp_collect_domain;
public String make_friends_domain;
public String mall;
@JSONField(name = "mall_home_link")
public String mallHomeLink;
@JSONField(name = "message_notification_default_status")
public int message_notification_default_status;
@JSONField(name = "nearby_page_name")
public String nearbyPagename;
@JSONField(name = "global_notify_icons_config")
public JSONArray notifyIconsArray;
public String open_invite_register;
@JSONField(name = "oss_txt_watermark")
public String ossTxtWatermark;
@JSONField(name = "oss_url")
public String ossUrl;
@JSONField(name = "oss_watermark")
public String ossWatermark;
@JSONField(name = "pic_watermark")
public String picWatermark;
@JSONField(name = "pics_is_open_recommend")
public String picsIsOpenRecommend;
public String post_config;
public String post_user_post_txt;
public String post_vote_icon;
@JSONField(name = "qi_niu_txt_watermark")
public String qiNiuTxtWatermark;
@JSONField(name = "qi_niu_upload_url")
public String qiNiuUploadUrl;
@JSONField(name = "qi_niu_watermark")
public String qiNiuWatermark;
@JSONField(name = "qiniu_url")
public String qiniuUrl;
@JSONField(name = "qkis_ccl")
public int qkisCcl;
@JSONField(name = "global_is_qq_login")
public String qqLoginAble;
@JSONField(name = "global_is_qqwap_login")
public String qqWapLoginAble;
@JSONField(name = "read_circle_content_second")
public int readCircleContentSecond;
@JSONField(name = "read_content_second")
public int readContentSecond;
@JSONField(name = "recommend_page_name")
public String recommendPagename;
public String register_invite_code_required;
private String removeWatermarkSuffixUrl;
public String reply_red_packet_open;
@JSONField(name = "rwrd_txt")
public String rewardTitle;
public String sec_pca;
@JSONField(name = "seek_exp")
public String seekExp;
@JSONField(name = "seek_url")
public String seekUrl;
@JSONField(name = "global_share_icons_config")
public JSONArray shareIconsArray;
public String share_task_rule_link;
@JSONField(name = "show_attach_default_icon")
public String showAttachDefaultIcon;
@JSONField(name = "show_attach_ff_icon")
public String showAttachFFIcon;
@JSONField(name = "show_attach_icons")
public String showAttachIcons;
public int show_user_active_time;
public int show_user_distance;
public String signin;
@JSONField(name = "global_is_code_login")
public String smsLoginAble;
@JSONField(name = "tab_content")
public JSONObject tabcontent;
public int title_is_must;
@JSONField(name = "tprvp")
public int tprvp;
@JSONField(name = "global_user_registered_close_msg")
public String unregistAbleTips;
@JSONField(name = "global_is_user_login")
public String userNameLoginAble;
public String user_chat_allow_send_card;
public String user_chat_allow_send_redpacket;
public String user_is_open_big_pic;
public String usertask;
@JSONField(name = "video_watermark")
public String videoWatermark;
@JSONField(name = "vir_name")
public String virName;
@JSONField(name = "watch_small_video_second")
public int watchSmallVideoSecond;
@JSONField(name = "watch_video_second")
public int watchVideoSecond;
@JSONField(name = "watermark_txt_word")
public String watermarkTxtWord;
@JSONField(name = "global_is_weixin_login")
public String wxLoginAble;
public String xyg_app_key;
@JSONField(name = "res_key")
public String resKey = "ooo";
public String dz_domain = "";
public String global_aka = "1";
public String short_video_status = "";
@JSONField(name = "video_size")
public int videoSize = 5;
@JSONField(name = "global_user_registered")
public String registAble = "1";
public String global_pic_compression_ratio = "0.95";
public String global_video_compression_ratio = "0.6";
public String global_video_shoot_ratio = "2";
public String global_shoot_video_time = "15";
public String global_editor_video_time = "15";
public String pay_column_domain = "https://app.jpztong.com/";
public int global_clw = 2;
@JSONField(name = "global_username_change_open")
public String globalUsernameChangeOpen = "-1";
@JSONField(name = "global_username_change_rule_txt")
public List<String> globalUsernameChangeRuleTxt = new ArrayList();
@JSONField(name = "global_user_write_off_txt")
public List<String> globalUserWriteOffTxt = new ArrayList();
@JSONField(name = "global_user_write_off_open")
public String globalUserwrite0ffOpen = "-1";
@JSONField(name = "quick_post_style")
public int quickPostStyle = 1;
@JSONField(name = "group_manage_list_load_way")
public String groupManageListLoadWay = "1";
@JSONField(name = "register_type_config")
public String registerTypeConfig = "phone";
@JSONField(name = "pic_quality")
public int picQuality = 75;
public int feeds_focus_user_more = 1;
@JSONField(name = "global_rgst_need_pawd")
public String globalRgstNeedPawd = "1";
@JSONField(name = "tourist_can_use")
public String touristCanUse = "1";
@JSONField(name = "feeds_repeat_open")
public String feedsRepeatOpen = "1";
public String app_rendering = "1";
@JSONField(name = "global_single_pic_style")
public String globalSinglePicStyle = "1";
@JSONField(name = "global_pic_open_force_compress")
public String globalPicOpenForceCompress = "1";
private final String replaceName = "{username}";
private final String replaceTxt = "{water_txt}";
public static class FlashPicConfig {
public int flashimage_screen_shot_ban_day;
public String flashimage_screen_shot_ban_tips;
public int flashimage_screen_shot_io;
public int flashimage_screen_shot_max;
public String flashimage_screen_shot_tips;
public int flashimage_show_seconds;
}
public static class VideoWatermarkPic {
public int height;
public String url;
public int width;
}
public boolean isVideoClose() {
return "1".equals(this.short_video_status);
}
public String getChat_safe_remain_word() {
return this.chat_safe_remain_word;
}
public void setChat_safe_remain_word(String str) {
this.chat_safe_remain_word = str;
}
public String getChat_safe_keyword_remain_word() {
return this.chat_safe_keyword_remain_word;
}
public void setChat_safe_keyword_remain_word(String str) {
this.chat_safe_keyword_remain_word = str;
}
public String getMallHomeLink() {
return this.mallHomeLink;
}
public void setMallHomeLink(String str) {
this.mallHomeLink = str;
}
public boolean isFrameworkGrey() {
return AppAbilitySplit.judgeGreyable() && "2".equals(this.app_rendering);
}
public boolean isGlobeGrey() {
return AppAbilitySplit.judgeGreyable() && "3".equals(this.app_rendering);
}
public boolean getFeedsRepeatOpen() {
return this.feedsRepeatOpen.equals("1");
}
public boolean getLimitTouristVisit() {
return (UserApi.checkLogin() || SafeJsonUtil.getBoolean(this.touristCanUse) || this.global_aka.equals("1")) ? false : true;
}
public String getRewardTitle() {
if (TextUtils.isEmpty(this.rewardTitle)) {
this.rewardTitle = "打赏";
}
return this.rewardTitle;
}
public boolean getGlobalRgstNeedPawd() {
return SafeJsonUtil.getBoolean(this.globalRgstNeedPawd);
}
public String getFeedsFocusTitle() {
return TextUtils.isEmpty(this.feedsFocusTitle) ? "关注" : this.feedsFocusTitle;
}
public void setFeedsFocusTitle(String str) {
this.feedsFocusTitle = str;
}
public String getFeedsRecommendTitle() {
return TextUtils.isEmpty(this.feedsRecommendTitle) ? "推荐" : this.feedsRecommendTitle;
}
public String getRecommendPagename() {
return TextUtils.isEmpty(this.recommendPagename) ? "找人" : this.recommendPagename;
}
public String getNearbyPagename() {
return TextUtils.isEmpty(this.nearbyPagename) ? "找人" : this.nearbyPagename;
}
public void setFeedsRecommendTitle(String str) {
this.feedsRecommendTitle = str;
}
public String getFeedsNearTitle() {
return TextUtils.isEmpty(this.feedsNearTitle) ? "附近" : this.feedsNearTitle;
}
public void setFeedsNearTitle(String str) {
this.feedsNearTitle = str;
}
public String getFeedsName() {
return TextUtils.isEmpty(this.feedsName) ? "动态" : this.feedsName;
}
public void setFeedsName(String str) {
this.feedsName = str;
}
public int getReadCircleContentSecond() {
return this.readCircleContentSecond;
}
public int getWatchSmallVideoSecond() {
return this.watchSmallVideoSecond;
}
public int getReadContentSecond() {
return this.readContentSecond;
}
public void setReadContentSecond(int i) {
this.readContentSecond = i;
}
public int getWatchVideoSecond() {
return this.watchVideoSecond;
}
public void setWatchVideoSecond(int i) {
this.watchVideoSecond = i;
}
public String getGlobalVoiceBroadcastOpen() {
return this.globalVoiceBroadcastOpen;
}
public void setGlobalVoiceBroadcastOpen(String str) {
this.globalVoiceBroadcastOpen = str;
}
public String getShareIconUrlByType(String str) {
if (this.shareIconsArray == null) {
return "";
}
for (int i = 0; i < this.shareIconsArray.size(); i++) {
JSONObject jSONObjectFromArray = SafeJsonUtil.getJSONObjectFromArray(this.shareIconsArray, i);
if (str.equals(SafeJsonUtil.getString(jSONObjectFromArray, "type"))) {
return SafeJsonUtil.getString(jSONObjectFromArray, "pic_url");
}
}
return "";
}
public String getNotifyIconsUrlByType(String str) {
if (this.notifyIconsArray == null) {
return "";
}
for (int i = 0; i < this.notifyIconsArray.size(); i++) {
JSONObject jSONObjectFromArray = SafeJsonUtil.getJSONObjectFromArray(this.notifyIconsArray, i);
if (str.equals(SafeJsonUtil.getString(jSONObjectFromArray, "type"))) {
return SafeJsonUtil.getString(jSONObjectFromArray, "pic_url");
}
}
return "";
}
public String getKdhAppKey() {
return this.kdhAppKey;
}
public void setKdhAppKey(String str) {
this.kdhAppKey = str;
}
public String getKdhAppSecret() {
return this.kdhAppSecret;
}
public void setKdhAppSecret(String str) {
this.kdhAppSecret = str;
}
public boolean getIsOpenTopThreadBgHighlight() {
return SafeJsonUtil.getBoolean(this.isOpenTopThreadBgHighlight);
}
public boolean getPicsIsOpenRecommend() {
return SafeJsonUtil.getBoolean(this.picsIsOpenRecommend);
}
public void refresh() {
load();
Net url = Net.url(API.Common.config);
url.showProgress(false);
url.get(new Task<Result>() {
@Override
public void onResult(Result result) {
if (result.success()) {
try {
SiteConfig siteConfig = (SiteConfig) JSON.parseObject(result.getData().toJSONString(), SiteConfig.class);
FrescoImageView.setOssUrlAndQiniuUrl(siteConfig.ossUrl, siteConfig.qiniuUrl, siteConfig.picQuality);
if (!"ooo".equals(SiteConfig.this.resKey) && !siteConfig.resKey.equals(SiteConfig.this.resKey)) {
FileUtil.deleteDir(FileUtil.getDir("web_response"));
Fresco.getImagePipeline().clearCaches();
}
BeanUtil.copyBean(SiteConfig.this, siteConfig);
SiteConfig.this.commit();
AppAbilitySplit.loadConfig();
} catch (Exception unused) {
}
}
}
});
}
public int getPicCompressRatio() {
int i;
try {
i = (int) (Double.parseDouble(this.global_pic_compression_ratio) * 100.0d);
} catch (Exception unused) {
i = 95;
}
if (i <= 0 || i > 100) {
return 95;
}
return i;
}
public void saveVideoWatermarkPic(String str, String str2, Task task) {
if (TextUtils.isEmpty(str) || "-1".equals(str2) || new File(str).exists()) {
return;
}
File externalFilesDir = FileUtil.getExternalFilesDir();
String substring = str.substring(str.length() - 10, str.length());
File file = new File(externalFilesDir + LocalFilePath.videoWaterMarkPicPath);
if (!file.exists()) {
file.mkdirs();
}
String str3 = file + "/PIC_" + substring + ".png";
File file2 = new File(str3);
if (file2.exists()) {
if (task != null) {
task.onResult(file2);
}
} else {
Net url = Net.url(str);
url.showProgress(false);
url.download(str3, task);
}
}
public Bitmap getBitmap(String str, int i, int i2) {
if (TextUtils.isEmpty(str)) {
return null;
}
if (i <= 0 || i2 <= 0) {
i = 400;
i2 = 200;
} else if (i > 500 || i2 > 500) {
i /= 2;
i2 /= 2;
}
File externalFilesDir = FileUtil.getExternalFilesDir();
String substring = str.substring(str.length() - 10, str.length());
File file = new File(externalFilesDir + LocalFilePath.videoWaterMarkPicPath);
if (!file.exists()) {
return null;
}
return PhotoUtil.getLocalImage(new File(file + "/PIC_" + substring + ".png"), i, i2);
}
public JSONObject getAttachJson() {
if (this.attachJson == null) {
this.attachJson = SafeJsonUtil.parseJSONObject(this.showAttachIcons);
}
return this.attachJson;
}
public String getFileIcon(String str) {
if (TextUtils.isEmpty(str)) {
return this.showAttachDefaultIcon;
}
if (getAttachJson() != null && getAttachJson().containsKey(str.toLowerCase())) {
return getAttachJson().getString(str.toLowerCase());
}
return this.showAttachDefaultIcon;
}
public String getQiNiuWatermark() {
return !TextUtils.isEmpty(this.qiNiuWatermark) ? this.qiNiuWatermark : "";
}
public String getOssWatermark() {
return !TextUtils.isEmpty(this.ossWatermark) ? this.ossWatermark : "";
}
public String getSuffixUrl(int i, boolean z, String str) {
return getSuffixUrl(i, z, str, false);
}
public String getSuffixUrl(int i, boolean z, String str, boolean z2) {
String replace;
String replace2;
String qiNiuWatermark = getQiNiuWatermark();
String ossWatermark = getOssWatermark();
if (str == null) {
str = "";
}
StringBuilder sb = new StringBuilder();
if (i == 1) {
if (z || z2) {
return getRemoveWatermarkSuffixUrl(i);
}
if ("2".equals(this.picWatermark) && !TextUtils.isEmpty(this.qiNiuTxtWatermark)) {
if (TextUtils.isEmpty(str)) {
replace2 = StrUtil.substringAfterLast(getWatermarkTxtWord(), "{username}");
} else {
replace2 = getWatermarkTxtWord().replace("{username}", str);
}
try {
if (TextUtils.isEmpty(replace2)) {
replace2 = Ioc.getApplication().getResources().getString(R.string.app_name);
}
qiNiuWatermark = this.qiNiuTxtWatermark.replace("{water_txt}", Base64.encodeToString(replace2.getBytes(), 8));
} catch (AssertionError unused) {
}
}
sb.append("imageView2/3");
sb.append(HiAnalyticsConstant.REPORT_VAL_SEPARATOR);
sb.append(qiNiuWatermark);
sb.append(TextUtils.isEmpty(qiNiuWatermark) ? "" : HiAnalyticsConstant.REPORT_VAL_SEPARATOR);
sb.append("imageslim");
} else {
if (z || z2) {
return getRemoveWatermarkSuffixUrl(i);
}
if ("2".equals(this.picWatermark) && !TextUtils.isEmpty(this.ossTxtWatermark)) {
if (TextUtils.isEmpty(str)) {
replace = StrUtil.substringAfterLast(getWatermarkTxtWord(), "{username}");
} else {
replace = getWatermarkTxtWord().replace("{username}", str);
}
try {
if (TextUtils.isEmpty(replace)) {
replace = Ioc.getApplication().getResources().getString(R.string.app_name);
}
ossWatermark = this.ossTxtWatermark.replace("{water_txt}", Base64.encodeToString(replace.getBytes(), 8));
} catch (AssertionError unused2) {
}
}
sb.append("x-oss-process=image");
sb.append("/");
sb.append(ossWatermark);
}
return sb.toString();
}
public String getRemoveWatermarkSuffixUrl(int i) {
if (!TextUtils.isEmpty(this.removeWatermarkSuffixUrl)) {
return this.removeWatermarkSuffixUrl;
}
if (i != 1) {
return "";
}
return "imageView2/3|imageslim";
}
public String getWatermarkTxtWord() {
if (StrUtil.isBlank(this.watermarkTxtWord)) {
return Ioc.getApplication().getResources().getString(R.string.app_name);
}
return this.watermarkTxtWord;
}
}