CarrotChat v2.8.60.240131版本的 MD5 值为:2baf8b9f31830b86b5c5a85ae6b47e05
以下内容为反编译后的 N2MSetting.java 源代码,内容仅作参考
package org.pjsip.pjsua2.app;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Build;
import cn.tee3.avd.AVDEngine;
import cn.tee3.avd.MVideo;
import com.kinggrid.iapppdf.droids.mupdf.codec.cosobject.PdfBoolean;
import java.util.UUID;
public class N2MSetting {
public static final String Def_access_key = "F89EB5C71E494850A061CC0C5F42C177";
private static final String Def_oemName = "qiniu.com";
public static final String Def_secret_key = "DDDF7445961C4D27A7DCE106001BBB4F";
private static final String Def_serverUrl = "121.41.119.216:8080";
public static final String Key_DATA = "Data";
private static final String Key_autoAudio = "autoAudio";
private static final String Key_autoVideo = "autoVideo";
private static final String Key_dataChannelNet = "dataChannelNet";
private static final String Key_multiLive = "multiLive";
private static final String Key_oemName = "oemName";
private static final String Key_roomId = "roomId";
private static final String Key_serverUrl = "serverurl";
private static final String Key_uiStype = "uiStype";
private static final String Key_userId = "userId";
private static final String Key_userName = "userName";
private static final String Key_videoCodec = "videoCodec";
private static final String Key_videoResolution = "videoResolution";
private static final String Key_videoShow = "videoShow";
private static N2MSetting instance;
String baseUrl;
Context context;
MVideo.CameraType currCameraType = MVideo.CameraType.front;
SharedPreferences sharedPref;
SharedPreferences.Editor sharedPrefEditor;
private N2MSetting() {
}
private void createEditor() {
if (this.sharedPrefEditor == null) {
this.sharedPrefEditor = this.sharedPref.edit();
}
}
public static N2MSetting getInstance() {
if (instance == null) {
instance = new N2MSetting();
}
return instance;
}
public String getBaseUrl() {
if (this.baseUrl == null) {
this.baseUrl = AVDEngine.instance().getOption(AVDEngine.Option.eo_demo_urlbase_liverecord);
this.baseUrl = "http://" + this.baseUrl;
}
return this.baseUrl;
}
public MVideo.CameraType getCurrCameraType() {
return this.currCameraType;
}
public int getDataChannelNet() {
return this.sharedPref.getInt(Key_dataChannelNet, 0);
}
public String getDataChannelNetOption() {
return 1 == getDataChannelNet() ? PdfBoolean.TRUE : "false";
}
public String getOEMName() {
return this.sharedPref.getString(Key_serverUrl, Def_oemName);
}
public String getRoomId() {
return this.sharedPref.getString(Key_roomId, "r2");
}
public String getRoomToken() {
return "dSC2IIrmjNXONzPvVgXZo0mI0AI83835NIuXQ3iD:KLoVj_CTp7q1uxLE8kdQ0-H5VkQ=:eyJyb29tX25hbWUiOiJxaW5pdTAwMSIsInVzZXJfaWQiOiJ1c2VyMiIsInBlcm0iOiJ1c2VyIiwiZXhwaXJlX2F0IjoxNDcwOTkwMjc3MTQwOTk4MjI1fQ==";
}
public String getServerUrl() {
return this.sharedPref.getString(Key_serverUrl, Def_serverUrl);
}
public int getUIStype() {
return this.sharedPref.getInt(Key_uiStype, 0);
}
public String getUserId() {
return this.sharedPref.getString(Key_userId, UUID.randomUUID().toString());
}
public String getUserName() {
String string = this.sharedPref.getString(Key_userName, "");
if (string.isEmpty()) {
return Build.MODEL + ":" + Build.VERSION.SDK_INT + "_" + Build.VERSION.RELEASE;
}
return string;
}
public int getVideoCodec() {
return this.sharedPref.getInt(Key_videoCodec, 1);
}
public String getVideoCodecOption() {
return 1 == getVideoCodec() ? "H264" : "VP8";
}
public int getVideoResolution() {
return this.sharedPref.getInt(Key_videoResolution, 1);
}
public String getVideoResolutionOption() {
int videoResolution = getVideoResolution();
return 1 == videoResolution ? "{\"width\":480,\"height\":640,\"maxFPS\":20}" : 2 == videoResolution ? "{\"width\":720,\"height\":1280,\"maxFPS\":15}" : "{\"width\":288,\"height\":352,\"maxFPS\":30}";
}
public int getVideoShow() {
return this.sharedPref.getInt(Key_videoShow, 0);
}
public void init(Context context) {
this.context = context;
this.sharedPref = context.getSharedPreferences(context.getPackageName(), 0);
}
public boolean isAudoVideo() {
return this.sharedPref.getBoolean(Key_autoVideo, false);
}
public boolean isAutoAudio() {
return this.sharedPref.getBoolean(Key_autoAudio, false);
}
public boolean isAutoTest() {
return false;
}
public boolean isMultiLive() {
return this.sharedPref.getBoolean(Key_multiLive, false);
}
public boolean isOEMTest() {
return false;
}
public void saveAutoAudio(boolean z) {
createEditor();
this.sharedPrefEditor.putBoolean(Key_autoAudio, z);
}
public void saveAutoVideo(boolean z) {
createEditor();
this.sharedPrefEditor.putBoolean(Key_autoVideo, z);
}
public void saveCommit() {
SharedPreferences.Editor editor = this.sharedPrefEditor;
if (editor != null) {
editor.commit();
}
}
public void saveDataChannelNet(int i) {
createEditor();
this.sharedPrefEditor.putInt(Key_dataChannelNet, i);
}
public void saveMultiLive(boolean z) {
createEditor();
this.sharedPrefEditor.putBoolean(Key_multiLive, z);
}
public void saveRoomId(String str) {
createEditor();
this.sharedPrefEditor.putString(Key_roomId, str);
}
public void saveServerUrl(String str) {
createEditor();
this.sharedPrefEditor.putString(Key_serverUrl, str);
}
public void saveUIStype(int i) {
createEditor();
this.sharedPrefEditor.putInt(Key_uiStype, i);
}
public void saveUserName(String str) {
createEditor();
this.sharedPrefEditor.putString(Key_userName, str);
}
public void saveVideoCodec(int i) {
createEditor();
this.sharedPrefEditor.putInt(Key_videoCodec, i);
}
public void saveVideoResolution(int i) {
createEditor();
this.sharedPrefEditor.putInt(Key_videoResolution, i);
}
public void saveVideoShow(int i) {
createEditor();
this.sharedPrefEditor.putInt(Key_videoShow, i);
}
public void setCurrCameraType(MVideo.CameraType cameraType) {
this.currCameraType = cameraType;
}
}