Initial commit

This commit is contained in:
2025-05-13 19:24:51 +02:00
commit a950f49678
10604 changed files with 932663 additions and 0 deletions

View File

@@ -0,0 +1,71 @@
package com.ubt.jimu.base;
/* loaded from: classes.dex */
public class BaseEventModel {
private ErrorEntity mEntity;
private String url;
public static class ErrorEntity {
private String error;
private String message;
private String path;
private int status;
private long timestamp;
public String getError() {
return this.error;
}
public String getMessage() {
return this.message;
}
public String getPath() {
return this.path;
}
public int getStatus() {
return this.status;
}
public long getTimestamp() {
return this.timestamp;
}
public void setError(String str) {
this.error = str;
}
public void setMessage(String str) {
this.message = str;
}
public void setPath(String str) {
this.path = str;
}
public void setStatus(int i) {
this.status = i;
}
public void setTimestamp(long j) {
this.timestamp = j;
}
}
public ErrorEntity getEntity() {
return this.mEntity;
}
public String getUrl() {
return this.url;
}
public void setEntity(ErrorEntity errorEntity) {
this.mEntity = errorEntity;
}
public void setUrl(String str) {
this.url = str;
}
}

View File

@@ -0,0 +1,28 @@
package com.ubt.jimu.base;
import java.lang.ref.WeakReference;
/* loaded from: classes.dex */
public abstract class BasePresenter<V> {
private WeakReference<V> mViewRef;
public void attachView(V v) {
this.mViewRef = new WeakReference<>(v);
}
public void detachView() {
WeakReference<V> weakReference = this.mViewRef;
if (weakReference != null) {
weakReference.clear();
this.mViewRef = null;
}
}
public V getView() {
WeakReference<V> weakReference = this.mViewRef;
if (weakReference != null) {
return weakReference.get();
}
return null;
}
}

View File

@@ -0,0 +1,200 @@
package com.ubt.jimu.base;
import android.content.Context;
import android.text.TextUtils;
import com.ubt.jimu.base.data.Engine;
import com.ubt.jimu.base.data.Motor;
import com.ubt.jimu.base.data.Servo;
import com.ubt.jimu.base.data.ServoMode;
import com.ubt.jimu.base.db.diy.DiyDBModel;
import com.ubt.jimu.base.db.diy.DiyHelper;
import com.ubt.jimu.base.entities.RobotLite;
import com.ubt.jimu.base.util.PathHelper;
import com.ubt.jimu.connect.model.ModelMatchXmlFileManager;
import com.ubt.jimu.connect.model.PeripheralConnections;
import com.ubt.jimu.transport3.UnityFileOperator;
import com.ubtech.utils.XLog;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
/* loaded from: classes.dex */
public class EngineManager {
private Context mContext;
private PeripheralConnections mPeripheralConn;
private RobotLite mRobotLite;
private String mUserId;
public EngineManager(Context context, RobotLite robotLite) {
this.mContext = context.getApplicationContext();
this.mRobotLite = robotLite;
}
private ModelMatchXmlFileManager createMatchFileManager() {
ModelMatchXmlFileManager modelMatchXmlFileManager = new ModelMatchXmlFileManager();
modelMatchXmlFileManager.a(PathHelper.getDataRootDir(this.mContext, this.mRobotLite, false) + File.separator + this.mRobotLite.getModelId() + ".xml");
return modelMatchXmlFileManager;
}
private List<Engine> getEnginesFromMatchFile() {
ModelMatchXmlFileManager createMatchFileManager = createMatchFileManager();
ArrayList arrayList = new ArrayList();
List<Motor> motorsFromMatchFile = getMotorsFromMatchFile(createMatchFileManager);
if (motorsFromMatchFile != null && motorsFromMatchFile.size() > 0) {
arrayList.addAll(motorsFromMatchFile);
}
List<Servo> servosFromMatchFile = getServosFromMatchFile(createMatchFileManager);
if (servosFromMatchFile != null && servosFromMatchFile.size() > 0) {
arrayList.addAll(servosFromMatchFile);
}
return arrayList;
}
private List<Engine> getEnginesFromPeripheralFile() {
ArrayList arrayList = new ArrayList();
List<Motor> motorsFromPeripheralFile = getMotorsFromPeripheralFile();
if (motorsFromPeripheralFile != null && motorsFromPeripheralFile.size() > 0) {
arrayList.addAll(motorsFromPeripheralFile);
}
List<Servo> servosFromPeripheralFile = getServosFromPeripheralFile();
if (servosFromPeripheralFile != null && servosFromPeripheralFile.size() > 0) {
arrayList.addAll(servosFromPeripheralFile);
}
return arrayList;
}
private List<Motor> getMotorsFromMatchFile(ModelMatchXmlFileManager modelMatchXmlFileManager) {
List<Integer> a = modelMatchXmlFileManager.a();
if (a == null || a.size() <= 0) {
return null;
}
ArrayList arrayList = new ArrayList(a.size());
Iterator<Integer> it = a.iterator();
while (it.hasNext()) {
arrayList.add(new Motor(it.next().intValue()));
}
Collections.sort(arrayList);
return arrayList;
}
private List<Motor> getMotorsFromPeripheralFile() {
List<Integer> a = this.mPeripheralConn.a(10);
if (a == null || a.size() <= 0) {
return null;
}
ArrayList arrayList = new ArrayList(a.size());
Iterator<Integer> it = a.iterator();
while (it.hasNext()) {
arrayList.add(new Motor(it.next().intValue()));
}
Collections.sort(arrayList);
return arrayList;
}
private List<Servo> getServosFromMatchFile(ModelMatchXmlFileManager modelMatchXmlFileManager) {
List<Integer> b = modelMatchXmlFileManager.b();
if (b == null || b.size() <= 0) {
return null;
}
ArrayList arrayList = new ArrayList(b.size());
Iterator<Integer> it = b.iterator();
while (it.hasNext()) {
arrayList.add(new Servo(it.next().intValue(), ServoMode.SERVO_MODE_ANGLE));
}
Collections.sort(arrayList);
return arrayList;
}
private List<Servo> getServosFromPeripheralFile() {
HashMap<Integer, ServoMode> c = this.mPeripheralConn.c();
if (c == null || c.size() <= 0) {
return null;
}
ArrayList arrayList = new ArrayList(c.size());
Iterator<Integer> it = c.keySet().iterator();
while (it.hasNext()) {
int intValue = it.next().intValue();
arrayList.add(new Servo(intValue, c.get(Integer.valueOf(intValue))));
}
Collections.sort(arrayList);
return arrayList;
}
public void createPeripheralConn(String str) {
if (this.mPeripheralConn == null) {
this.mPeripheralConn = PeripheralConnections.a(this.mRobotLite.getModelId(), str, !this.mRobotLite.isOfficial());
} else if (!str.equals(this.mUserId)) {
this.mPeripheralConn = PeripheralConnections.a(this.mRobotLite.getModelId(), str, !this.mRobotLite.isOfficial());
}
this.mUserId = str;
}
public List<Engine> getEngineList(String str) {
if (this.mRobotLite == null || TextUtils.isEmpty(str)) {
return null;
}
createPeripheralConn(str);
if (this.mPeripheralConn != null) {
return getEnginesFromPeripheralFile();
}
XLog.b("woo", "Robot %s has no servos.txt", this.mRobotLite.getModelId());
return getEnginesFromMatchFile();
}
public List<Motor> getMotorList(String str) {
if (this.mRobotLite == null || TextUtils.isEmpty(str)) {
return null;
}
createPeripheralConn(str);
if (this.mPeripheralConn != null) {
return getMotorsFromPeripheralFile();
}
XLog.b("woo", "Robot %s has no servos.txt", this.mRobotLite.getModelId());
return getMotorsFromMatchFile(createMatchFileManager());
}
public List<Servo> getServoList(String str) {
if (this.mRobotLite == null || TextUtils.isEmpty(str)) {
return null;
}
createPeripheralConn(str);
if (this.mPeripheralConn != null) {
return getServosFromPeripheralFile();
}
XLog.b("woo", "Robot %s has no servos.txt", this.mRobotLite.getModelId());
return getServosFromMatchFile(createMatchFileManager());
}
public ServoMode getServoMode(int i) {
PeripheralConnections peripheralConnections = this.mPeripheralConn;
return (peripheralConnections == null || i <= 0) ? ServoMode.SERVO_MODE_ANGLE : peripheralConnections.a(Integer.valueOf(i));
}
public void reloadPeripheralConn() {
this.mPeripheralConn = PeripheralConnections.a(this.mRobotLite.getModelId(), this.mUserId, !this.mRobotLite.isOfficial());
}
public void save() {
DiyDBModel queryForUUid;
if (this.mPeripheralConn != null) {
String dataRootDir = PathHelper.getDataRootDir(this.mContext, this.mRobotLite, false);
this.mPeripheralConn.b(dataRootDir);
String d = PeripheralConnections.d(dataRootDir);
if (this.mRobotLite.isOfficial() || (queryForUUid = DiyHelper.getInstance().queryForUUid(this.mRobotLite.getModelId())) == null) {
return;
}
new UnityFileOperator(queryForUUid.getModelId().intValue(), queryForUUid.getCustomModelId(), 1, d, 2).operateFile();
}
}
public void updateServoMode(Servo servo) {
PeripheralConnections peripheralConnections = this.mPeripheralConn;
if (peripheralConnections == null || servo == null) {
return;
}
peripheralConnections.a(Integer.valueOf(servo.getId()), servo.getModeType());
}
}

View File

@@ -0,0 +1,136 @@
package com.ubt.jimu.base;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentTransaction;
import butterknife.ButterKnife;
import com.ubt.jimu.BaseActivity;
import com.ubt.jimu.R;
import com.ubt.jimu.base.HelpFragment;
import com.ubt.jimu.base.cache.Cache;
import com.ubt.jimu.unity.bluetooth.UnityActivity;
import com.ubt.jimu.utils.LogUtils;
/* loaded from: classes.dex */
public class HelpActivity extends BaseActivity implements HelpFragment.OnHelpFragmentInteractionListener {
private static final String ACTIONBAR_BG_COLOR = "actionbarBackgroundColorResId";
private static final String FROM_MAIN = "fromMain";
private static final String TITLE = "title";
private static final String URL = "url";
private int actionbarBackgroundColorResId;
private boolean fromMain;
private HelpFragment helpFragment;
private String title;
private String url;
public static void start(Activity activity, String str) {
start(activity, str, "", R.color.color_community_title);
}
public static void startForResultFromFragment(int i, Fragment fragment, Context context, String str, String str2, int i2, boolean z) {
if (context == null) {
return;
}
Intent intent = new Intent(context, (Class<?>) HelpActivity.class);
intent.putExtra("url", str);
intent.putExtra("title", str2);
intent.putExtra(ACTIONBAR_BG_COLOR, i2);
intent.putExtra(FROM_MAIN, z);
fragment.startActivityForResult(intent, i);
}
@Override // com.ubt.jimu.BaseActivity, com.ubt.jimu.ScreenRotationManageActivity, androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, androidx.core.app.ComponentActivity, android.app.Activity
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.activity_help);
ButterKnife.a(this);
if (bundle != null) {
this.url = bundle.getString("url");
this.title = bundle.getString("title");
this.actionbarBackgroundColorResId = bundle.getInt(ACTIONBAR_BG_COLOR);
this.fromMain = bundle.getBoolean(FROM_MAIN, false);
} else {
this.url = getIntent().getStringExtra("url");
this.title = getIntent().getStringExtra("title");
this.actionbarBackgroundColorResId = getIntent().getIntExtra(ACTIONBAR_BG_COLOR, R.color.color_community_title);
this.fromMain = getIntent().getBooleanExtra(FROM_MAIN, false);
}
this.helpFragment = HelpFragment.newInstance(this.url, this.title, this.actionbarBackgroundColorResId);
this.helpFragment.setListener(this);
FragmentTransaction a = getSupportFragmentManager().a();
a.b(R.id.frameLayout, this.helpFragment);
a.a();
}
@Override // com.ubt.jimu.BaseActivity, com.ubt.jimu.ScreenRotationManageActivity, androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, android.app.Activity
protected void onDestroy() {
super.onDestroy();
LogUtils.c("onDestroy onDestroy");
}
@Override // com.ubt.jimu.base.HelpFragment.OnHelpFragmentInteractionListener
public void onHelpPageBack() {
LogUtils.c("onHelpPageBackonHelpPageBackonHelpPageBack");
if (this.fromMain) {
UnityActivity.startUnityActivity(this, Cache.getInstance().getRobot(), 8, 8, UnityActivity.BLOCKLY_TYPE_NONE);
}
setResult(-1);
finish();
}
@Override // com.ubt.jimu.BaseActivity, androidx.appcompat.app.AppCompatActivity, android.app.Activity, android.view.KeyEvent.Callback
public boolean onKeyDown(int i, KeyEvent keyEvent) {
if (i != 4) {
return super.onKeyDown(i, keyEvent);
}
if (this.helpFragment.goBack()) {
return true;
}
onHelpPageBack();
return true;
}
@Override // androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, androidx.core.app.ComponentActivity, android.app.Activity
protected void onSaveInstanceState(Bundle bundle) {
super.onSaveInstanceState(bundle);
bundle.putString("url", this.url);
bundle.putString("title", this.title);
}
@Override // com.ubt.jimu.ScreenRotationManageActivity, androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, android.app.Activity
protected void onStop() {
super.onStop();
LogUtils.c("onStoponStoponStop");
}
@Override // com.ubt.jimu.BaseActivity
public void relayout() {
}
public static void start(Activity activity, String str, String str2, int i, boolean z) {
if (activity == null) {
return;
}
Intent intent = new Intent(activity, (Class<?>) HelpActivity.class);
intent.putExtra("url", str);
intent.putExtra("title", str2);
intent.putExtra(ACTIONBAR_BG_COLOR, i);
intent.putExtra(FROM_MAIN, z);
activity.startActivity(intent);
}
public static void start(Activity activity, String str, String str2, int i) {
if (activity == null) {
return;
}
Intent intent = new Intent(activity, (Class<?>) HelpActivity.class);
intent.putExtra("url", str);
intent.putExtra("title", str2);
intent.putExtra(ACTIONBAR_BG_COLOR, i);
activity.startActivity(intent);
}
}

View File

@@ -0,0 +1,274 @@
package com.ubt.jimu.base;
import android.content.Context;
import android.graphics.Bitmap;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.webkit.WebChromeClient;
import android.webkit.WebResourceRequest;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import com.ubt.jimu.R;
import com.ubt.jimu.utils.LogUtils;
import com.ubt.jimu.utils.NetWorkUtil;
import com.ubt.jimu.widgets.NavigationBarView;
import com.ubtech.utils.AndroidVersionCheckUtils;
import com.ubtech.view.fragment.BaseFragment;
import java.lang.ref.WeakReference;
/* loaded from: classes.dex */
public class HelpFragment extends BaseFragment {
private static final String ACTIONBAR_BG_COLOR = "actionbarBackgroundColorResId";
private static final String TITLE = "title";
private static final String URL = "url";
private int actionbarBackgroundColorResId;
private Unbinder mBind;
private OnHelpFragmentInteractionListener mListener;
protected NavigationBarView nbv_bar;
protected ProgressBar pgLoading;
private String title;
private String url;
protected WebView webView;
public static class MyWebChromeClient extends WebChromeClient {
private WeakReference<HelpFragment> mFragmentReference;
public MyWebChromeClient(HelpFragment helpFragment) {
this.mFragmentReference = new WeakReference<>(helpFragment);
}
@Override // android.webkit.WebChromeClient
public void onProgressChanged(WebView webView, int i) {
HelpFragment helpFragment = this.mFragmentReference.get();
if (helpFragment == null || helpFragment.isDetached() || helpFragment.isRemoving()) {
return;
}
helpFragment.updateProgress(i);
}
@Override // android.webkit.WebChromeClient
public void onReceivedTitle(WebView webView, String str) {
super.onReceivedTitle(webView, str);
HelpFragment helpFragment = this.mFragmentReference.get();
if (helpFragment == null || helpFragment.isDetached() || helpFragment.isRemoving()) {
return;
}
helpFragment.setTitle(str);
}
}
public class MyWebViewClient extends WebViewClient {
public MyWebViewClient() {
}
@Override // android.webkit.WebViewClient
public void onPageFinished(WebView webView, String str) {
super.onPageFinished(webView, str);
ProgressBar progressBar = HelpFragment.this.pgLoading;
if (progressBar != null) {
progressBar.setProgress(100);
HelpFragment.this.pgLoading.setVisibility(8);
}
HelpFragment helpFragment = HelpFragment.this;
NavigationBarView navigationBarView = helpFragment.nbv_bar;
if (navigationBarView != null) {
navigationBarView.setTitle(TextUtils.isEmpty(helpFragment.title) ? webView.getTitle() : HelpFragment.this.title);
}
}
@Override // android.webkit.WebViewClient
public void onPageStarted(WebView webView, String str, Bitmap bitmap) {
super.onPageStarted(webView, str, bitmap);
ProgressBar progressBar = HelpFragment.this.pgLoading;
if (progressBar != null) {
progressBar.setVisibility(0);
HelpFragment.this.pgLoading.setProgress(0);
}
}
@Override // android.webkit.WebViewClient
public boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) {
if (Build.VERSION.SDK_INT >= 21) {
webView.loadUrl(webResourceRequest.getUrl().toString());
return true;
}
webView.loadUrl(webResourceRequest.toString());
return true;
}
}
public interface OnHelpFragmentInteractionListener {
void onHelpPageBack();
}
private void initWebView() {
int i = this.actionbarBackgroundColorResId;
if (i != 0) {
this.nbv_bar.setBackgroundResource(i);
}
this.webView.getSettings().setDisplayZoomControls(false);
this.webView.getSettings().setSupportZoom(false);
this.webView.getSettings().setUseWideViewPort(true);
this.webView.getSettings().setJavaScriptEnabled(true);
this.webView.getSettings().setLoadWithOverviewMode(true);
this.webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
this.webView.getSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
this.webView.getSettings().setBlockNetworkLoads(false);
this.webView.getSettings().setDomStorageEnabled(true);
this.webView.getSettings().setBlockNetworkImage(false);
if (AndroidVersionCheckUtils.c()) {
this.webView.getSettings().setAllowUniversalAccessFromFileURLs(true);
}
if (AndroidVersionCheckUtils.d()) {
this.webView.getSettings().setMediaPlaybackRequiresUserGesture(false);
}
this.webView.getSettings().setAllowContentAccess(true);
this.webView.getSettings().setAllowFileAccess(true);
this.webView.getSettings().setDatabaseEnabled(true);
this.webView.getSettings().setDomStorageEnabled(true);
this.webView.getSettings().setAppCacheEnabled(false);
if (NetWorkUtil.b(getContext())) {
this.webView.getSettings().setCacheMode(2);
} else {
this.webView.getSettings().setCacheMode(-1);
}
this.webView.getSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
this.webView.setScrollContainer(false);
this.webView.setWebViewClient(new MyWebViewClient());
this.webView.setWebChromeClient(new MyWebChromeClient(this));
LogUtils.c("隐私策略:" + this.url);
this.webView.loadUrl(this.url);
}
public static HelpFragment newInstance(String str, String str2, int i) {
HelpFragment helpFragment = new HelpFragment();
Bundle bundle = new Bundle();
bundle.putString("url", str);
bundle.putString("title", str2);
bundle.putInt(ACTIONBAR_BG_COLOR, i);
helpFragment.setArguments(bundle);
return helpFragment;
}
/* JADX INFO: Access modifiers changed from: private */
public void onImgBack() {
if (this.webView.canGoBack()) {
this.webView.goBack();
return;
}
OnHelpFragmentInteractionListener onHelpFragmentInteractionListener = this.mListener;
if (onHelpFragmentInteractionListener != null) {
onHelpFragmentInteractionListener.onHelpPageBack();
}
}
public boolean goBack() {
if (!this.webView.canGoBack()) {
return false;
}
this.webView.goBack();
return true;
}
/* JADX WARN: Multi-variable type inference failed */
@Override // com.ubtech.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onAttach(Context context) {
super.onAttach(context);
if (context instanceof OnHelpFragmentInteractionListener) {
this.mListener = (OnHelpFragmentInteractionListener) context;
}
}
@Override // com.ubtech.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
if (getArguments() != null) {
this.url = getArguments().getString("url");
this.title = getArguments().getString("title");
this.actionbarBackgroundColorResId = getArguments().getInt(ACTIONBAR_BG_COLOR);
}
}
@Override // com.ubtech.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.fragment_help, viewGroup, false);
this.mBind = ButterKnife.a(this, inflate);
initWebView();
if (!TextUtils.isEmpty(this.title)) {
this.nbv_bar.setTitle(this.title);
}
this.nbv_bar.setListener(new NavigationBarView.OnActionClickListener.Stub() { // from class: com.ubt.jimu.base.HelpFragment.1
@Override // com.ubt.jimu.widgets.NavigationBarView.OnActionClickListener.Stub
public void onLeftClick(View view) {
HelpFragment.this.onImgBack();
}
});
return inflate;
}
@Override // androidx.fragment.app.Fragment
public void onDestroy() {
WebView webView = this.webView;
if (webView != null) {
ViewParent parent = webView.getParent();
if (parent != null) {
((ViewGroup) parent).removeView(this.webView);
}
this.webView.removeAllViews();
this.webView.destroy();
}
super.onDestroy();
}
@Override // androidx.fragment.app.Fragment
public void onDestroyView() {
WebView webView = this.webView;
if (webView != null) {
ViewParent parent = webView.getParent();
if (parent != null) {
((ViewGroup) parent).removeView(this.webView);
}
this.webView.stopLoading();
this.webView.clearHistory();
this.webView.removeAllViews();
this.webView.destroy();
this.webView = null;
}
this.mBind.unbind();
super.onDestroyView();
}
@Override // androidx.fragment.app.Fragment
public void onDetach() {
super.onDetach();
this.mListener = null;
}
public void setListener(OnHelpFragmentInteractionListener onHelpFragmentInteractionListener) {
this.mListener = onHelpFragmentInteractionListener;
}
protected void setTitle(String str) {
NavigationBarView navigationBarView;
if (!TextUtils.isEmpty(str) || (navigationBarView = this.nbv_bar) == null) {
return;
}
navigationBarView.setTitle(str);
}
protected void updateProgress(int i) {
ProgressBar progressBar = this.pgLoading;
if (progressBar != null) {
progressBar.setProgress(i);
}
}
}

View File

@@ -0,0 +1,33 @@
package com.ubt.jimu.base;
import android.view.View;
import android.webkit.WebView;
import android.widget.ProgressBar;
import butterknife.Unbinder;
import butterknife.internal.Utils;
import com.ubt.jimu.R;
import com.ubt.jimu.widgets.NavigationBarView;
/* loaded from: classes.dex */
public class HelpFragment_ViewBinding implements Unbinder {
private HelpFragment target;
public HelpFragment_ViewBinding(HelpFragment helpFragment, View view) {
this.target = helpFragment;
helpFragment.nbv_bar = (NavigationBarView) Utils.b(view, R.id.nbv_bar, "field 'nbv_bar'", NavigationBarView.class);
helpFragment.pgLoading = (ProgressBar) Utils.b(view, R.id.pgLoading, "field 'pgLoading'", ProgressBar.class);
helpFragment.webView = (WebView) Utils.b(view, R.id.webView, "field 'webView'", WebView.class);
}
@Override // butterknife.Unbinder
public void unbind() {
HelpFragment helpFragment = this.target;
if (helpFragment == null) {
throw new IllegalStateException("Bindings already cleared.");
}
this.target = null;
helpFragment.nbv_bar = null;
helpFragment.pgLoading = null;
helpFragment.webView = null;
}
}

View File

@@ -0,0 +1,25 @@
package com.ubt.jimu.base;
import android.content.Context;
import com.alibaba.android.arouter.facade.service.SerializationService;
import com.ubt.jimu.utils.GsonUtil;
import java.lang.reflect.Type;
/* loaded from: classes.dex */
public class JsonServiceImpl implements SerializationService {
@Override // com.alibaba.android.arouter.facade.template.IProvider
public void init(Context context) {
}
public <T> T json2Object(String str, Class<T> cls) {
return (T) GsonUtil.a(str, cls);
}
public String object2Json(Object obj) {
return GsonUtil.a(obj);
}
public <T> T parseObject(String str, Type type) {
return (T) GsonUtil.a(str, type.getClass());
}
}

View File

@@ -0,0 +1,37 @@
package com.ubt.jimu.base;
import android.os.Bundle;
import android.view.View;
import butterknife.ButterKnife;
import com.ubt.jimu.BaseActivity;
/* loaded from: classes.dex */
public abstract class SuperActivity extends BaseActivity {
public View mRootView;
protected abstract void initData();
protected abstract void initEvent();
public abstract View initView();
@Override // com.ubt.jimu.BaseActivity, com.ubt.jimu.ScreenRotationManageActivity, androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, androidx.core.app.ComponentActivity, android.app.Activity
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
this.mRootView = initView();
setContentView(this.mRootView);
ButterKnife.a(this, this.mRootView);
initData();
initEvent();
}
@Override // com.ubt.jimu.BaseActivity, android.app.Activity
protected void onRestart() {
super.onRestart();
this.mRootView.requestLayout();
}
@Override // com.ubt.jimu.BaseActivity
public void relayout() {
}
}

View File

@@ -0,0 +1,192 @@
package com.ubt.jimu.base;
import android.app.Activity;
import android.app.ActivityManager;
import android.app.Application;
import android.content.Context;
import android.os.Process;
import com.ubt.jimu.JimuApplication;
import com.ubt.jimu.unity.bluetooth.UnityActivity;
import com.ubtech.utils.XLog;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Stack;
/* loaded from: classes.dex */
public class UbtActivityStack {
private int mResumedCount;
private Stack<Activity> mStack;
private static class NotesActivityStackHelper {
private static final UbtActivityStack INSTANCE = new UbtActivityStack();
private NotesActivityStackHelper() {
}
}
public static UbtActivityStack getInstance() {
return NotesActivityStackHelper.INSTANCE;
}
public void addActivity(Activity activity) {
Iterator<Activity> it = this.mStack.iterator();
while (it.hasNext()) {
Activity next = it.next();
if (activity.getClass().equals(UnityActivity.class) || activity.getClass().equals(next.getClass())) {
this.mStack.remove(next);
break;
}
}
this.mStack.add(activity);
}
public void closeActivity(Class cls) {
for (int i = 0; i < this.mStack.size(); i++) {
if (this.mStack.get(i) != null && !this.mStack.get(i).isFinishing() && this.mStack.get(i).getClass().equals(cls.getClass())) {
this.mStack.get(i).finish();
this.mStack.remove(i);
return;
}
}
}
public void decrement() {
this.mResumedCount--;
}
public void finishAllActivity() {
for (int i = 0; i < this.mStack.size(); i++) {
if (this.mStack.get(i) != null && !this.mStack.get(i).isFinishing()) {
this.mStack.get(i).finish();
}
}
this.mStack.clear();
killProgress();
}
public Activity getActivity(int i) {
Stack<Activity> stack = this.mStack;
if (stack == null || stack.size() <= 0 || this.mStack.size() <= i + 1) {
return null;
}
return this.mStack.get((r0.size() - 1) - i);
}
public Activity getActivityByClassName(String str) {
for (Activity activity : getActivityTask(JimuApplication.l())) {
if (activity.getClass().getSimpleName().equals(str)) {
return activity;
}
}
return null;
}
public List<Activity> getActivityTask(Application application) {
ArrayList arrayList = new ArrayList();
try {
Field declaredField = Application.class.getDeclaredField("mLoadedApk");
declaredField.setAccessible(true);
Object obj = declaredField.get(application);
Field declaredField2 = obj.getClass().getDeclaredField("mActivityThread");
declaredField2.setAccessible(true);
Object obj2 = declaredField2.get(obj);
Field declaredField3 = obj2.getClass().getDeclaredField("mActivities");
declaredField3.setAccessible(true);
Object obj3 = declaredField3.get(obj2);
if (obj3 instanceof Map) {
Iterator it = ((Map) obj3).entrySet().iterator();
while (it.hasNext()) {
Object value = ((Map.Entry) it.next()).getValue();
Field declaredField4 = value.getClass().getDeclaredField("activity");
declaredField4.setAccessible(true);
arrayList.add((Activity) declaredField4.get(value));
}
}
} catch (Exception e) {
e.printStackTrace();
}
return arrayList;
}
public int getResumedCount() {
return this.mResumedCount;
}
public Activity getTopActivity() {
if (this.mStack.size() <= 0) {
return null;
}
return this.mStack.get(r0.size() - 1);
}
public void increment() {
this.mResumedCount++;
}
public boolean isActivityStack(Context context) {
ActivityManager activityManager = (ActivityManager) context.getSystemService("activity");
List<ActivityManager.RunningTaskInfo> runningTasks = activityManager.getRunningTasks(3);
activityManager.getRunningAppProcesses();
activityManager.getAppTasks();
return runningTasks.size() <= 2;
}
public boolean isAppForeground() {
return this.mResumedCount > 0;
}
public boolean isExistUnityActivity() {
Iterator<Activity> it = getActivityTask(JimuApplication.l()).iterator();
while (it.hasNext()) {
if (it.next().getClass().getSimpleName().equals(UnityActivity.class.getSimpleName())) {
return true;
}
}
return false;
}
public boolean isTargetClass(Class cls, int i) {
Activity activity = getActivity(i);
return activity != null && activity.getClass().equals(cls);
}
public boolean isTopStack(Class cls) {
XLog.a("act_life", "size is %s", Integer.valueOf(this.mStack.size()));
if (this.mStack.size() == 0) {
return false;
}
Stack<Activity> stack = this.mStack;
if (!stack.get(stack.size() - 1).getClass().equals(cls)) {
return false;
}
Object[] objArr = new Object[1];
objArr[0] = cls != null ? cls.getSimpleName() : "null";
XLog.a("act_life", "top stack clz %s", objArr);
return true;
}
public void killProgress() {
Process.killProcess(Process.myPid());
System.exit(0);
}
public void removeActivity(Activity activity) {
this.mStack.remove(activity);
}
public void returnPreActivity(Context context) {
((Activity) context).finish();
}
public Stack<Activity> stack() {
return this.mStack;
}
private UbtActivityStack() {
this.mStack = new Stack<>();
this.mResumedCount = 0;
}
}

View File

@@ -0,0 +1,255 @@
package com.ubt.jimu.base.cache;
import android.bluetooth.BluetoothDevice;
import android.text.TextUtils;
import com.ubt.jimu.JimuApplication;
import com.ubt.jimu.base.db.robot.RobotDbHandler;
import com.ubt.jimu.base.db.user.UserDbHandler;
import com.ubt.jimu.base.entities.Constant;
import com.ubt.jimu.base.entities.Robot;
import com.ubt.jimu.base.entities.User;
import com.ubt.jimu.course.repository.JimuCourse;
import com.ubt.jimu.course.repository.JimuCourseMission;
import com.ubt.jimu.course.repository.JimuCourseTask;
import com.ubtech.utils.XLog;
import com.ubtrobot.jimu.robotapi.BoardInfo;
import java.util.List;
import java.util.UUID;
/* loaded from: classes.dex */
public class Cache {
private static final String TAG = "Cache";
private static Cache instance;
private boolean connected;
private JimuCourseMission courseMission;
private List<JimuCourseTask> courseTaskList;
private JimuCourse jimuCourse;
private JimuCourseTask jimuCourseTask;
private String mBlocklyTestUrl;
private BoardInfo mBoardInfo;
private BluetoothDevice mLastConnectedDevice;
private long packageId;
private String packageImagePath;
private String packageName;
private Robot robot;
private User user;
private boolean showMobileDataTips = false;
public long differ = 0;
private SharePreferenceHelper settings = new SharePreferenceHelper();
private Cache() {
}
public static synchronized Cache getInstance() {
Cache cache;
synchronized (Cache.class) {
if (instance == null) {
instance = new Cache();
}
cache = instance;
}
return cache;
}
public void clearCacheUser() {
setUser(null);
this.settings.put(SharePreferenceHelper.SP_KEY_USER_ID, "local");
this.settings.put(SharePreferenceHelper.AUTHOR_TOKEN, "");
}
public String getBlocklyTest() {
return this.mBlocklyTestUrl;
}
public BoardInfo getBoardInfo() {
return this.mBoardInfo;
}
public JimuCourseMission getCourseMission() {
return this.courseMission;
}
public List<JimuCourseTask> getCourseTaskList() {
return this.courseTaskList;
}
public JimuCourse getJimuCourse() {
return this.jimuCourse;
}
public JimuCourseTask getJimuCourseTask() {
return this.jimuCourseTask;
}
public BluetoothDevice getLastConnectedDevice() {
return this.mLastConnectedDevice;
}
public long getLoginUserIntId() {
String string = this.settings.getString(SharePreferenceHelper.SP_KEY_USER_ID, "");
if (TextUtils.isEmpty(string) || string.equals("local") || Integer.parseInt(string) <= 0) {
return 0L;
}
return Integer.parseInt(string);
}
public long getPackageId() {
this.packageId = this.settings.getLong(SharePreferenceHelper.SP_KEY_PACKAGE_ID, 0L).longValue();
return this.packageId;
}
public String getPackageImagePath() {
return this.settings.getString(SharePreferenceHelper.CURRENT_PACKAGE_IMAGE_PATH, null);
}
public String getPackageName() {
this.packageName = this.settings.getString(SharePreferenceHelper.SP_KEY_PACKAGE_NAME, "");
return this.packageName;
}
public Robot getRobot() {
if (this.robot == null) {
long longValue = this.settings.getLong(SharePreferenceHelper.SP_KEY_ROBOT_ID, -1L).longValue();
long longValue2 = this.settings.getLong(SharePreferenceHelper.SP_KEY_PACKAGE_ID, -1L).longValue();
if (longValue < 0 || longValue2 < 0) {
return null;
}
Robot robotById = RobotDbHandler.getRobotById(longValue);
if (robotById != null) {
setRobot(robotById);
}
}
return this.robot;
}
public SharePreferenceHelper getSettings() {
return this.settings;
}
public String getTTSToken() {
return this.settings.getString(Constant.Cache.SP_KEY_TTS_TOKEN, "");
}
public User getUser() {
if (this.user == null) {
this.user = UserDbHandler.getUser();
}
return this.user;
}
public String getUserId() {
return this.settings.getString(SharePreferenceHelper.SP_KEY_USER_ID, "local");
}
public String getUserToken() {
return this.settings.getString(SharePreferenceHelper.AUTHOR_TOKEN, "");
}
public String getUuid() {
String string = this.settings.getString(SharePreferenceHelper.SP_KEY_UUID, "");
if (!TextUtils.isEmpty(string)) {
return string;
}
String replace = UUID.randomUUID().toString().replace("-", "");
XLog.d("woo", "UUID.rancomUUID: " + replace, new Object[0]);
this.settings.put(SharePreferenceHelper.SP_KEY_UUID, replace);
return replace;
}
public int getVersionCode() {
return this.settings.getInt(Constant.Cache.APP_VERSION_CODE, 0);
}
public boolean isConnected() {
return this.connected;
}
public boolean isShowMobileDataTips() {
return this.showMobileDataTips;
}
public boolean isWifiOnly() {
return this.settings.getBoolean(SharePreferenceHelper.SP_KEY_WIFI_VIEW, true).booleanValue();
}
public void putBoolean(String str, boolean z) {
this.settings.put(str, Boolean.valueOf(z));
}
public void putInt(String str, int i) {
this.settings.put(str, Integer.valueOf(i));
}
public void putString(String str, String str2) {
this.settings.put(str, str2);
}
public void setBlocklyTestUrl(String str) {
this.mBlocklyTestUrl = str;
}
public void setBoardInfo(BoardInfo boardInfo) {
this.mBoardInfo = boardInfo;
}
public void setConnected(boolean z) {
this.connected = z;
}
public void setCourseMission(JimuCourseMission jimuCourseMission) {
this.courseMission = jimuCourseMission;
}
public void setCourseTaskList(List<JimuCourseTask> list) {
this.courseTaskList = list;
}
public void setJimuCourse(JimuCourse jimuCourse) {
this.jimuCourse = jimuCourse;
}
public void setJimuCourseTask(JimuCourseTask jimuCourseTask) {
this.jimuCourseTask = jimuCourseTask;
}
public void setLastConnectedDevice(BluetoothDevice bluetoothDevice) {
this.mLastConnectedDevice = bluetoothDevice;
}
public void setPackageId(long j) {
this.packageId = j;
this.settings.put(SharePreferenceHelper.SP_KEY_PACKAGE_ID, Long.valueOf(j));
}
public void setPackageImagePath(String str) {
this.packageImagePath = str;
this.settings.put(SharePreferenceHelper.CURRENT_PACKAGE_IMAGE_PATH, str);
}
public void setPackageName(String str) {
this.packageName = str;
this.settings.put(SharePreferenceHelper.SP_KEY_PACKAGE_NAME, str);
}
public void setRobot(Robot robot) {
Robot robot2;
if (robot == null) {
return;
}
if (robot.getModelName() != null && (robot2 = this.robot) != null && robot2.getModelName() != null && !robot.getModelName().equals(this.robot.getModelName())) {
JimuApplication.l().f().c();
}
this.robot = robot;
this.settings.put(SharePreferenceHelper.SP_KEY_ROBOT_NAME, robot.getModelNameLanguage());
this.settings.put(SharePreferenceHelper.SP_KEY_ROBOT_IMAGE, robot.getFilePath());
this.settings.put(SharePreferenceHelper.SP_KEY_ROBOT_ID, Long.valueOf(robot.getModelId()));
}
public void setShowMobileDataTips(boolean z) {
this.showMobileDataTips = z;
}
public void setUser(User user) {
this.user = user;
}
}

View File

@@ -0,0 +1,93 @@
package com.ubt.jimu.base.cache;
import com.ubt.jimu.JimuApplication;
import com.ubt.jimu.transport3.dao.TransportFileDbHandler2;
import com.ubt.jimu.unity.ModelType;
import com.ubt.jimu.utils.ExternalOverFroyoUtils;
import java.io.File;
/* loaded from: classes.dex */
public class Constants {
public static final String ADV_BEGIN_TIME = "adv_begin";
public static final String ADV_END_TIME = "adv_end";
public static final String ADV_FLAG = "adv_flag";
public static final String ADV_IMG_PATH = "adv_img_path";
public static final String ADV_LINK = "adv_link";
public static final String ADV_TYPE = "adv_type";
public static final String ADV_VERSION = "adv_version";
public static final String APP_VERSION = "app_version";
public static final String BLOCKLY_GUIDE = "blockly_guide";
public static final String BLOCKLY_TYPE = "blockly_type";
public static final String BLOCKLY_VERSION = "blockly_version";
public static final String BLUETOOTH_AUTO_CONNECT = "bluetooth_auto_connect";
public static final String COPY_LOCAL_CACHE_MODEL = "copy_cache_model";
public static final String COPY_LOCAL_CACHE_MODEL_IMG = "copy_model_img";
public static final String COURSE_RESOURCE_PATH = ExternalOverFroyoUtils.a(JimuApplication.l(), (ModelType) null) + "data" + File.separator + "blockly" + File.separator + "course_resources" + File.separator;
public static final String COURSE_VERSION = "course_version";
public static final String CURRENT_LANGUAGE = "current_language";
public static final String CUSTOM_MODEL;
public static final String CUSTOM_SOUNDS;
public static final String DEFAULT_MODEL;
public static final String DISABLE_WHILE_CHARGING = "disable_while_charging";
public static final String FOO_FILE = "foo";
public static final String HOME_BG_FILE_NAME = "home_image.png";
public static final String IMAGE_PATH = "images";
public static final String INSTRUCTION_CONFIG_FILE = "instruction";
public static final String IS_PUSH_REGISTER = "is_push_register";
public static final String IS_SHOW_GUIDE = "is_show_guide";
public static final String KEY_COURSE_ALERT_LOGIN = "k_c_alert_login";
public static final String KEY_COURSE_HAVE_PLAY_VIDEO = "k_c_played_video";
public static final String KEY_DOWNLOAD_SERVOS = "key_download_servos";
public static final String KEY_IS_ACTIVITY_FIRST_IN = "is_first_in_activity";
public static final String KEY_IS_HOME_GUIDE_SHOWN = "is_home_guide_shown";
public static final String KEY_MSG_DAILY_TASK = "k_task_daily";
public static final String KEY_MSG_MAIN_TASK = "k_task_main";
public static final String KEY_PROGRAM_LANGUAGE = "key_program_language";
public static final String KEY_SHOULD_SHOW_LOW_END_DIALOG = "should_show_low_end_dialog";
public static final String LANGUAGE = "language";
public static final String LANGUAGE_SET = "language_set";
public static final String LAST_LANGUAGE = "last_language";
public static final String LOCAL_CACHE_MODEL_IMG = "local/";
public static final String LOGIN = "login";
public static final String LOGIN_TIME = "login_time";
public static final String MAIN_BOARD_VERSION_CODE = "main_board_version_code";
public static final String MAIN_BOARD_VERSION_FILE = "main_board_version_file";
public static final long MEMORY_LIMIT = 1800000000;
public static final String MERGE_FLAG = "merge_local_flag";
public static final String MODEL_CLASS = "model_class";
public static final String MODEL_CLASS_LOGO = "model_class_logo";
public static final String PARTS = "parts/android/";
public static final String PUSH_MSG = "push_msg";
public static final String QINIU_TOKEN = "qiniu_token";
public static final String REGISTER_DEVICEID = "register_deviceid";
public static final String REGISTER_ONLY_EMAIL = "register_only_email";
public static final String SENSOR_FILE_PATH = "FilePath";
public static final String SENSOR_VERSION = "Version";
public static final String STEERING_VERSION_CODE = "Steering_version_code";
public static final String STEERING_VERSION_FILE = "Steering_version_file";
public static final String UNITY_LANGUAGE_FILE = "LanguageCode";
public static final String USER_HOME;
public static final String USER_ID = "user_id";
public static final String VIDEO_ADV_BEGIN_TIME = "adv_begin";
public static final String VIDEO_ADV_END_TIME = "adv_end";
public static final String VIDEO_ADV_FLAG = "adv_flag";
public static final String VIDEO_ADV_IMG_PATH = "adv_img_path";
public static final String VIDEO_ADV_LINK = "adv_link";
public static final String VIDEO_ADV_VERSION = "adv_version";
public static final String WECHAT_APP_ID = "wx2abcb6ca6e95847d";
public static final String WECHAT_APP_SECRET = "d4624c36b6795d1d99dcf0547af5443d";
public static final String WIFI_ONLY = "wifi_only";
public static final String app_update_notify = "app_update";
static {
StringBuilder sb = new StringBuilder();
sb.append("users");
sb.append(File.separator);
sb.append("%s");
sb.append(File.separator);
USER_HOME = sb.toString();
DEFAULT_MODEL = USER_HOME + "default" + File.separator;
CUSTOM_MODEL = USER_HOME + "playerdata" + File.separator;
CUSTOM_SOUNDS = USER_HOME + TransportFileDbHandler2.DIR_SOUNDS + File.separator;
}
}

View File

@@ -0,0 +1,302 @@
package com.ubt.jimu.base.cache;
import android.content.SharedPreferences;
import android.text.TextUtils;
import android.util.Base64;
import com.ubt.jimu.JimuApplication;
import com.ubtech.utils.XLog;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.StreamCorruptedException;
/* loaded from: classes.dex */
public final class SharePreferenceHelper<T> {
public static final String AUTHOR_TOKEN = "author_token";
public static final String CURRENT_PACKAGE_IMAGE_PATH = "current_package_image_path";
public static final String KEY_SCAN_TIPS_READ = "scan_tips_read";
private static final String SP_FILE_NAME_EXTRA = "file_extra";
public static final String SP_FILE_NAME_SETTING = "setting";
public static final String SP_FILE_NAME_USER = "file_user";
public static final String SP_KEY_APP_CHECKED_UPDATE = "sp_key_app_checked_update";
public static final String SP_KEY_APP_NEED_UPDATE = "sp_key_app_need_upadte";
public static final String SP_KEY_APP_UPDATE_URL = "sp_key_app_update_url";
public static final String SP_KEY_APP_VERSION_NAME = "sp_key_app_version_name";
public static final String SP_KEY_AUTO_CONNECT = "auto_connect";
public static final String SP_KEY_CONNECTION_STATUS = "jimu_robot_connection_status";
public static final String SP_KEY_ELECTRICITY_PROTECT = "electricity_protect";
public static final String SP_KEY_FLIPPER_PAGE_INDEX = "sp_key_flipper_page_index";
public static final String SP_KEY_INFO_TO = "info_to";
public static final String SP_KEY_LAST_PARENT_EMAIL = "sp_key_last_parent_email";
public static final String SP_KEY_PACKAGE_ID = "sp_key_package_id";
public static final String SP_KEY_PACKAGE_NAME = "sp_key_package_name";
public static final String SP_KEY_REGISTER_ACCOUNT = "sp_key_register_account";
public static final String SP_KEY_REGISTER_BIRTHDAY = "sp_key_register_birthday";
public static final String SP_KEY_REGISTER_COUNTRY = "sp_key_register_country";
public static final String SP_KEY_ROBOT_ID = "sp_key_robot_id";
public static final String SP_KEY_ROBOT_IMAGE = "robot_image_url";
public static final String SP_KEY_ROBOT_NAME = "robot_name";
public static final String SP_KEY_SEARCH_HISTORY = "search_history";
public static final String SP_KEY_START_FINISH_HOME_GUIDE = "sp_key_finish_home_guide";
public static final String SP_KEY_START_FROM_SPLASH = "sp_key_start_from_splash";
public static final String SP_KEY_USER_ID = "key_user_id";
public static final String SP_KEY_UUID = "sp_key_uuid";
public static final String SP_KEY_WIFI_VIEW = "wifi_view";
private String setting;
public SharePreferenceHelper() {
this(false);
}
public Boolean getBoolean(String str, Boolean bool) {
return Boolean.valueOf(JimuApplication.l().getSharedPreferences(this.setting, 0).getBoolean(str, bool.booleanValue()));
}
public float getFloat(String str, float f) {
return JimuApplication.l().getSharedPreferences(this.setting, 0).getFloat(str, f);
}
public int getInt(String str, int i) {
return JimuApplication.l().getSharedPreferences(this.setting, 0).getInt(str, i);
}
public Long getLong(String str, Long l) {
return Long.valueOf(JimuApplication.l().getSharedPreferences(this.setting, 0).getLong(str, l.longValue()));
}
public String getString(String str, String str2) {
return JimuApplication.l().getSharedPreferences(this.setting, 0).getString(str, str2);
}
public void put(String str, Object obj) {
SharedPreferences.Editor edit = JimuApplication.l().getSharedPreferences(this.setting, 4).edit();
if (obj instanceof Boolean) {
edit.putBoolean(str, ((Boolean) obj).booleanValue());
} else if (obj instanceof Float) {
edit.putFloat(str, ((Float) obj).floatValue());
} else if (obj instanceof Integer) {
edit.putInt(str, ((Integer) obj).intValue());
} else if (obj instanceof Long) {
edit.putLong(str, ((Long) obj).longValue());
} else if (obj instanceof String) {
edit.putString(str, (String) obj);
}
if (edit.commit()) {
return;
}
XLog.b("SharePreferenceHelper", "commit SP failed!");
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Type inference failed for: r0v13, types: [T, java.lang.Object] */
/* JADX WARN: Type inference failed for: r0v2 */
/* JADX WARN: Type inference failed for: r0v3 */
/* JADX WARN: Type inference failed for: r0v4, types: [T] */
/* JADX WARN: Type inference failed for: r0v6 */
/* JADX WARN: Type inference failed for: r0v7, types: [java.io.ObjectInputStream] */
/* JADX WARN: Type inference failed for: r5v1, types: [boolean] */
/* JADX WARN: Type inference failed for: r5v10, types: [java.io.ByteArrayInputStream] */
/* JADX WARN: Type inference failed for: r5v12, types: [java.io.ByteArrayInputStream, java.io.InputStream] */
/* JADX WARN: Type inference failed for: r5v2 */
/* JADX WARN: Type inference failed for: r5v3 */
/* JADX WARN: Type inference failed for: r5v4 */
/* JADX WARN: Type inference failed for: r5v5, types: [java.io.ByteArrayInputStream] */
/* JADX WARN: Type inference failed for: r5v8, types: [java.io.ByteArrayInputStream] */
public T readObject(String str, String str2) {
ObjectInputStream objectInputStream;
String string = JimuApplication.l().getSharedPreferences(str, 0).getString(str2, "");
?? isEmpty = TextUtils.isEmpty(string);
?? r0 = (T) null;
if (isEmpty != 0) {
return null;
}
byte[] decode = Base64.decode(string.getBytes(), 0);
try {
} catch (IOException e) {
e.printStackTrace();
return (T) r0;
}
try {
try {
isEmpty = new ByteArrayInputStream(decode);
} catch (StreamCorruptedException e2) {
e = e2;
objectInputStream = null;
isEmpty = 0;
} catch (IOException e3) {
e = e3;
objectInputStream = null;
isEmpty = 0;
} catch (Throwable th) {
th = th;
isEmpty = 0;
}
try {
objectInputStream = new ObjectInputStream(isEmpty);
} catch (StreamCorruptedException e4) {
e = e4;
objectInputStream = null;
} catch (IOException e5) {
e = e5;
objectInputStream = null;
} catch (Throwable th2) {
th = th2;
if (isEmpty != 0) {
try {
isEmpty.close();
} catch (Exception e6) {
e6.printStackTrace();
}
}
if (r0 == 0) {
throw th;
}
try {
r0.close();
throw th;
} catch (IOException e7) {
e7.printStackTrace();
throw th;
}
}
try {
try {
r0 = (T) objectInputStream.readObject();
try {
isEmpty.close();
} catch (Exception e8) {
e8.printStackTrace();
}
try {
objectInputStream.close();
} catch (IOException e9) {
e9.printStackTrace();
}
return r0;
} catch (StreamCorruptedException e10) {
e = e10;
e.printStackTrace();
if (isEmpty != 0) {
try {
isEmpty.close();
} catch (Exception e11) {
e11.printStackTrace();
}
}
if (objectInputStream != null) {
objectInputStream.close();
}
return (T) r0;
} catch (IOException e12) {
e = e12;
e.printStackTrace();
if (isEmpty != 0) {
try {
isEmpty.close();
} catch (Exception e13) {
e13.printStackTrace();
}
}
if (objectInputStream != null) {
objectInputStream.close();
}
return (T) r0;
}
} catch (ClassNotFoundException e14) {
e14.printStackTrace();
try {
isEmpty.close();
} catch (Exception e15) {
e15.printStackTrace();
}
objectInputStream.close();
return (T) r0;
}
} catch (Throwable th3) {
r0 = (T) decode;
th = th3;
}
}
public void saveObject(String str, String str2, Object obj) {
ObjectOutputStream objectOutputStream;
SharedPreferences sharedPreferences = JimuApplication.l().getSharedPreferences(str, 0);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
ObjectOutputStream objectOutputStream2 = null;
try {
try {
try {
objectOutputStream = new ObjectOutputStream(byteArrayOutputStream);
try {
objectOutputStream.writeObject(obj);
String encodeToString = Base64.encodeToString(byteArrayOutputStream.toByteArray(), 0);
SharedPreferences.Editor edit = sharedPreferences.edit();
edit.putString(str2, encodeToString);
if (!edit.commit()) {
XLog.b("SharePreferenceHelper", "commit SP failed!");
}
try {
objectOutputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
byteArrayOutputStream.close();
} catch (IOException e2) {
e = e2;
objectOutputStream2 = objectOutputStream;
e.printStackTrace();
if (objectOutputStream2 != null) {
try {
objectOutputStream2.close();
} catch (IOException e3) {
e3.printStackTrace();
}
}
byteArrayOutputStream.close();
} catch (Throwable th) {
th = th;
if (objectOutputStream != null) {
try {
objectOutputStream.close();
} catch (IOException e4) {
e4.printStackTrace();
}
}
try {
byteArrayOutputStream.close();
throw th;
} catch (IOException e5) {
e5.printStackTrace();
throw th;
}
}
} catch (Throwable th2) {
th = th2;
objectOutputStream = objectOutputStream2;
}
} catch (IOException e6) {
e = e6;
}
} catch (IOException e7) {
e7.printStackTrace();
}
}
public SharePreferenceHelper(boolean z) {
this.setting = z ? SP_FILE_NAME_USER : SP_FILE_NAME_SETTING;
}
private SharePreferenceHelper(String str) {
this.setting = str;
}
public void saveObject(String str, Object obj) {
saveObject(this.setting, str, obj);
}
public T readObject(String str) {
return readObject(this.setting, str);
}
}

View File

@@ -0,0 +1,7 @@
package com.ubt.jimu.base.data;
/* loaded from: classes.dex */
public enum CtrlMotionType {
servo,
motor
}

View File

@@ -0,0 +1,40 @@
package com.ubt.jimu.base.data;
/* loaded from: classes.dex */
public abstract class Engine implements Comparable {
public static final int DIRECTION_CLOCK = 1;
public static final int DIRECTION_DISCLOCK = -1;
private int id;
private int direction = 1;
private boolean isConfigged = false;
public Engine(int i) {
this.id = i;
}
public int getDirection() {
return this.direction;
}
public int getId() {
return this.id;
}
public abstract CtrlMotionType getMotionType();
public boolean isConfigged() {
return this.isConfigged;
}
public void setConfigged(boolean z) {
this.isConfigged = z;
}
public void setDirection(int i) {
this.direction = i;
}
public String toString() {
return "Engine{id=" + this.id + " type=" + getMotionType() + '}';
}
}

View File

@@ -0,0 +1,31 @@
package com.ubt.jimu.base.data;
/* loaded from: classes.dex */
public class Motor extends Engine {
public Motor(int i) {
super(i);
}
@Override // java.lang.Comparable
public int compareTo(Object obj) {
if (obj != null && (obj instanceof Motor)) {
return getId() - ((Motor) obj).getId();
}
return 1;
}
@Override // com.ubt.jimu.base.data.Engine
public CtrlMotionType getMotionType() {
return CtrlMotionType.motor;
}
@Override // com.ubt.jimu.base.data.Engine
public String toString() {
return "Motor{direction=" + getDirection() + "} " + super.toString();
}
public Motor(int i, int i2) {
this(i);
super.setDirection(i2);
}
}

View File

@@ -0,0 +1,46 @@
package com.ubt.jimu.base.data;
/* loaded from: classes.dex */
public class Servo extends Engine {
public boolean isChoose;
private ServoMode type;
public Servo(int i, ServoMode servoMode) {
super(i);
this.type = servoMode;
}
@Override // java.lang.Comparable
public int compareTo(Object obj) {
if (obj != null && (obj instanceof Servo)) {
return getId() - ((Servo) obj).getId();
}
return 1;
}
public ServoMode getModeType() {
return this.type;
}
@Override // com.ubt.jimu.base.data.Engine
public CtrlMotionType getMotionType() {
return CtrlMotionType.servo;
}
public boolean isChoose() {
return this.isChoose;
}
public void setChoose(boolean z) {
this.isChoose = z;
}
public void setModeType(ServoMode servoMode) {
this.type = servoMode;
}
@Override // com.ubt.jimu.base.data.Engine
public String toString() {
return "Servo{type=" + this.type + "} " + super.toString();
}
}

View File

@@ -0,0 +1,7 @@
package com.ubt.jimu.base.data;
/* loaded from: classes.dex */
public enum ServoMode {
SERVO_MODE_ANGLE,
SERVO_MODE_TURN
}

View File

@@ -0,0 +1,114 @@
package com.ubt.jimu.base.db;
import java.util.ArrayList;
import java.util.List;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.query.QueryBuilder;
/* loaded from: classes.dex */
public abstract class AbstractDaoHandler<T> implements IDaoHandler<T> {
protected AbstractDao<T, Long> dao;
public AbstractDaoHandler(AbstractDao<T, Long> abstractDao) {
this.dao = abstractDao;
}
@Override // com.ubt.jimu.base.db.IDaoHandler
public void delete(T t) {
this.dao.b((AbstractDao<T, Long>) t);
}
@Override // com.ubt.jimu.base.db.IDaoHandler
public void deleteAll() {
this.dao.b();
}
@Override // com.ubt.jimu.base.db.IDaoHandler
public void deleteById(long j) {
this.dao.c((AbstractDao<T, Long>) Long.valueOf(j));
}
@Override // com.ubt.jimu.base.db.IDaoHandler
public void deleteInTx(List<T> list) {
if (list == null || list.size() == 0) {
return;
}
this.dao.a((Iterable) list);
}
public QueryBuilder<T> getQueryBuilder() {
return this.dao.k();
}
@Override // com.ubt.jimu.base.db.IDaoHandler
public long insert(T t) {
return this.dao.f(t);
}
@Override // com.ubt.jimu.base.db.IDaoHandler
public void insertInTx(List<T> list) {
if (list == null || list.size() == 0) {
return;
}
this.dao.b((Iterable) list);
}
@Override // com.ubt.jimu.base.db.IDaoHandler
public long insertOrUpdate(T t) {
return this.dao.g(t);
}
@Override // com.ubt.jimu.base.db.IDaoHandler
public void insertOrUpdateInTx(List<T> list) {
if (list == null || list.size() == 0) {
return;
}
this.dao.c(list);
}
public List<T> query(QueryBuilder<T> queryBuilder) {
List<T> list;
try {
list = queryBuilder.b();
} catch (Exception e) {
e.printStackTrace();
list = null;
}
return list == null ? new ArrayList() : list;
}
@Override // com.ubt.jimu.base.db.IDaoHandler
public List<T> selectAll() {
return this.dao.j();
}
@Override // com.ubt.jimu.base.db.IDaoHandler
public T selectById(Long l) {
return this.dao.a(l.longValue());
}
@Override // com.ubt.jimu.base.db.IDaoHandler
public abstract T selectUnique(T t);
public T unique(QueryBuilder<T> queryBuilder) {
try {
return queryBuilder.c();
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
@Override // com.ubt.jimu.base.db.IDaoHandler
public void update(T t) {
this.dao.j(t);
}
@Override // com.ubt.jimu.base.db.IDaoHandler
public void updateInTx(List<T> list) {
if (list == null || list.size() == 0) {
return;
}
this.dao.d((Iterable) list);
}
}

View File

@@ -0,0 +1,44 @@
package com.ubt.jimu.base.db;
import android.content.Context;
import android.text.TextUtils;
import com.ubt.jimu.JimuApplication;
import com.ubt.jimu.base.cache.Cache;
import com.ubt.jimu.gen.DaoMaster;
import com.ubt.jimu.gen.DaoSession;
import org.greenrobot.greendao.database.Database;
/* loaded from: classes.dex */
public class DatabaseUtils {
public static final String LOCAL_DB = "local";
private static DaoSession getDaoSession(Database database) {
return new DaoMaster(database).newSession();
}
private static Database getReadableDb(Context context, String str) {
if (TextUtils.isEmpty(str)) {
str = "local";
}
return new DaoMaster.DevOpenHelper(context, str).getReadableDb();
}
private static Database getWritableDb(Context context, String str) {
if (TextUtils.isEmpty(str)) {
str = "local";
}
return new DaoMaster.DevOpenHelper(context, str).getWritableDb();
}
public static DaoSession getDaoSession(boolean z) {
return JimuApplication.l().e();
}
private static Database getReadableDb() {
return getReadableDb(JimuApplication.l(), Cache.getInstance().getUserId());
}
private static Database getWritableDb() {
return getWritableDb(JimuApplication.l(), Cache.getInstance().getUserId());
}
}

View File

@@ -0,0 +1,57 @@
package com.ubt.jimu.base.db;
import com.ubt.jimu.base.entities.FileDownloadRecord;
import com.ubt.jimu.gen.FileDownloadRecordDao;
import java.util.ArrayList;
import java.util.List;
import org.greenrobot.greendao.query.QueryBuilder;
import org.greenrobot.greendao.query.WhereCondition;
/* loaded from: classes.dex */
public class FileDownloadRecordDbHandler {
public static boolean getFileDownloadRecord(int i, int i2) {
try {
QueryBuilder<FileDownloadRecord> k = DatabaseUtils.getDaoSession(false).j().k();
k.a(FileDownloadRecordDao.Properties.TypeId.a(Integer.valueOf(i)), FileDownloadRecordDao.Properties.Type.a(Integer.valueOf(i2)));
return k.c() != null;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
public static List<FileDownloadRecord> getFileDownloadRecordByUrl(String str, int i) {
ArrayList arrayList = new ArrayList();
QueryBuilder<FileDownloadRecord> k = DatabaseUtils.getDaoSession(false).j().k();
k.a(FileDownloadRecordDao.Properties.FileUrl.a((Object) str), FileDownloadRecordDao.Properties.Type.a(Integer.valueOf(i)));
List<FileDownloadRecord> b = k.b();
if (b != null && b.size() > 0) {
arrayList.addAll(b);
}
return arrayList;
}
public static void writeRecord(long j, String str, String str2, int i, long j2) {
try {
FileDownloadRecordDao j3 = DatabaseUtils.getDaoSession(false).j();
QueryBuilder<FileDownloadRecord> k = j3.k();
k.a(FileDownloadRecordDao.Properties.FileUrl.a((Object) str), new WhereCondition[0]);
FileDownloadRecord c = k.c();
if (c != null) {
c.setUpdateTime(j2);
j3.j(c);
} else {
FileDownloadRecord fileDownloadRecord = new FileDownloadRecord();
fileDownloadRecord.setFileUrl(str);
fileDownloadRecord.setId(j);
fileDownloadRecord.setSavePath(str2);
fileDownloadRecord.setType(i);
fileDownloadRecord.setTypeId(j);
fileDownloadRecord.setUpdateTime(j2);
j3.g(fileDownloadRecord);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@@ -0,0 +1,32 @@
package com.ubt.jimu.base.db;
import java.util.List;
/* loaded from: classes.dex */
interface IDaoHandler<T> {
void delete(T t);
void deleteAll();
void deleteById(long j);
void deleteInTx(List<T> list);
long insert(T t);
void insertInTx(List<T> list);
long insertOrUpdate(T t);
void insertOrUpdateInTx(List<T> list);
List<T> selectAll();
T selectById(Long l);
T selectUnique(T t);
void update(T t);
void updateInTx(List<T> list);
}

View File

@@ -0,0 +1,34 @@
package com.ubt.jimu.base.db;
import com.ubt.jimu.gen.DaoSession;
import java.util.Iterator;
import java.util.List;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoMaster;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
@Deprecated
/* loaded from: classes.dex */
public class JimuDaoMaster extends AbstractDaoMaster {
public static final int SCHEMA_VERSION = 1;
public JimuDaoMaster(Database database, List<Class<? extends AbstractDao<?, ?>>> list) {
super(database, 1);
Iterator<Class<? extends AbstractDao<?, ?>>> it = list.iterator();
while (it.hasNext()) {
registerDaoClass(it.next());
}
}
@Override // org.greenrobot.greendao.AbstractDaoMaster
public AbstractDaoSession newSession() {
return new DaoSession(this.db, IdentityScopeType.Session, this.daoConfigMap);
}
@Override // org.greenrobot.greendao.AbstractDaoMaster
public AbstractDaoSession newSession(IdentityScopeType identityScopeType) {
return new DaoSession(this.db, identityScopeType, this.daoConfigMap);
}
}

View File

@@ -0,0 +1,137 @@
package com.ubt.jimu.base.db;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;
import com.ubt.jimu.gen.BlocklyProjectDao;
import com.ubt.jimu.gen.DaoMaster;
import com.ubt.jimu.gen.DiyDBModelDao;
import com.ubt.jimu.gen.DiyModelActionDao;
import com.ubt.jimu.gen.DiyProgramFileDao;
import com.ubt.jimu.gen.FirmwareVersionDao;
import com.ubt.jimu.gen.JimuMotionDao;
import com.ubt.jimu.gen.JimuSoundDao;
import com.ubt.jimu.gen.PackageDao;
import com.ubt.jimu.gen.TransportFileDao;
import com.ubtrobot.log.ALog;
import org.greenrobot.greendao.database.Database;
/* loaded from: classes.dex */
public class JimuOpenHelper extends DaoMaster.OpenHelper {
public JimuOpenHelper(Context context, String str) {
super(context, str);
}
private void addColumn(SQLiteDatabase sQLiteDatabase, String str, String str2, String str3, boolean z, int i) {
sQLiteDatabase.execSQL(createAddColumnSql(str, str2, str3, z, i));
}
private String createAddColumnSql(String str, String str2, String str3, boolean z, int i) {
StringBuilder sb = new StringBuilder();
sb.append("ALTER TABLE ");
sb.append(str);
sb.append(" ADD COLUMN ");
sb.append(str2);
sb.append(" ");
sb.append(str3);
if (z) {
sb.append(";");
} else {
sb.append(" NOT NULL DEFAULT(");
sb.append(i);
sb.append(");");
}
String sb2 = sb.toString();
ALog.a("JimuOpenHelper").d(sb2);
return sb2;
}
private void upgrade310(SQLiteDatabase sQLiteDatabase) {
addColumn(sQLiteDatabase, DiyDBModelDao.TABLENAME, DiyDBModelDao.Properties.LastUploadTime.e, "INTEGER", false, 0);
addColumn(sQLiteDatabase, TransportFileDao.TABLENAME, TransportFileDao.Properties.FileType.e, "TEXT", true, 0);
addColumn(sQLiteDatabase, TransportFileDao.TABLENAME, TransportFileDao.Properties.Uploaded.e, "INTEGER", false, 0);
addColumn(sQLiteDatabase, BlocklyProjectDao.TABLENAME, BlocklyProjectDao.Properties.LastUploadTime.e, "INTEGER", false, 0);
addColumn(sQLiteDatabase, BlocklyProjectDao.TABLENAME, BlocklyProjectDao.Properties.ModelId.e, "INTEGER", false, 0);
addColumn(sQLiteDatabase, BlocklyProjectDao.TABLENAME, BlocklyProjectDao.Properties.IsFirst.e, "INTEGER", false, 0);
addColumn(sQLiteDatabase, BlocklyProjectDao.TABLENAME, BlocklyProjectDao.Properties.IsUploadQiNiu.e, "INTEGER", false, 0);
addColumn(sQLiteDatabase, BlocklyProjectDao.TABLENAME, BlocklyProjectDao.Properties.IsUploadService.e, "INTEGER", false, 0);
addColumn(sQLiteDatabase, BlocklyProjectDao.TABLENAME, BlocklyProjectDao.Properties.IsModify.e, "INTEGER", false, 0);
addColumn(sQLiteDatabase, JimuSoundDao.TABLENAME, JimuSoundDao.Properties.IsUploadQiNiu.e, "INTEGER", false, 0);
addColumn(sQLiteDatabase, JimuSoundDao.TABLENAME, JimuSoundDao.Properties.IsSyncUbtService.e, "INTEGER", false, 0);
addColumn(sQLiteDatabase, JimuSoundDao.TABLENAME, JimuSoundDao.Properties.LastUploadTime.e, "INTEGER", false, 0);
addColumn(sQLiteDatabase, JimuSoundDao.TABLENAME, JimuSoundDao.Properties.IsFirst.e, "INTEGER", false, 0);
addColumn(sQLiteDatabase, JimuSoundDao.TABLENAME, JimuSoundDao.Properties.AudioId.e, "TEXT", true, 0);
addColumn(sQLiteDatabase, JimuMotionDao.TABLENAME, JimuMotionDao.Properties.LastUploadTime.e, "INTEGER", false, 0);
addColumn(sQLiteDatabase, JimuMotionDao.TABLENAME, JimuMotionDao.Properties.IsFirst.e, "INTEGER", false, 0);
addColumn(sQLiteDatabase, JimuMotionDao.TABLENAME, JimuMotionDao.Properties.IsUploadService.e, "INTEGER", false, 0);
addColumn(sQLiteDatabase, JimuMotionDao.TABLENAME, JimuMotionDao.Properties.ModelId.e, "INTEGER", false, 0);
DiyModelActionDao.a(wrap(sQLiteDatabase), true);
}
private void upgrade320(SQLiteDatabase sQLiteDatabase) {
addColumn(sQLiteDatabase, "PACKAGE", PackageDao.Properties.VideoThumbnail.e, "STRING", true, 0);
addColumn(sQLiteDatabase, "PACKAGE", PackageDao.Properties.VideoUrl.e, "STRING", true, 0);
addColumn(sQLiteDatabase, "PACKAGE", PackageDao.Properties.Played.e, "INTEGER", true, 0);
}
private void upgrade7(SQLiteDatabase sQLiteDatabase) {
addColumn(sQLiteDatabase, DiyDBModelDao.TABLENAME, DiyDBModelDao.Properties.CompleteState.e, "INTEGER", false, 0);
}
private void upgradeFrom122(SQLiteDatabase sQLiteDatabase) {
sQLiteDatabase.execSQL("ALTER TABLE ROBOT ADD COLUMN HAS_MISSION INTEGER;");
sQLiteDatabase.execSQL("ALTER TABLE JIMU_COURSE_MISSION ADD COLUMN MODULES_STR TEXT;");
}
private void upgradeFrom223(SQLiteDatabase sQLiteDatabase) {
addColumn(sQLiteDatabase, DiyProgramFileDao.TABLENAME, DiyProgramFileDao.Properties.Group.e, "TEXT", true, 0);
addColumn(sQLiteDatabase, DiyProgramFileDao.TABLENAME, DiyProgramFileDao.Properties.Language.e, "TEXT", true, 0);
}
private void upgradeTo5(SQLiteDatabase sQLiteDatabase) {
addColumn(sQLiteDatabase, "PACKAGE", PackageDao.Properties.EAN.e, "TEXT", true, 0);
addColumn(sQLiteDatabase, "PACKAGE", PackageDao.Properties.UPC.e, "TEXT", true, 0);
}
private void upgradeTo8(SQLiteDatabase sQLiteDatabase) {
addColumn(sQLiteDatabase, FirmwareVersionDao.TABLENAME, FirmwareVersionDao.Properties.IsForced.e, "INTEGER", false, 0);
}
@Override // com.ubt.jimu.gen.DaoMaster.OpenHelper, org.greenrobot.greendao.database.DatabaseOpenHelper
public void onCreate(Database database) {
super.onCreate(database);
}
@Override // org.greenrobot.greendao.database.DatabaseOpenHelper, android.database.sqlite.SQLiteOpenHelper
public void onUpgrade(SQLiteDatabase sQLiteDatabase, int i, int i2) {
super.onUpgrade(sQLiteDatabase, i, i2);
if (i2 != i) {
Log.i("JimuOpenHelper", "onUpgrade version " + i + " to " + i2);
if (i <= 1) {
upgradeFrom122(sQLiteDatabase);
}
if (i <= 2) {
upgradeFrom223(sQLiteDatabase);
}
if (i <= 3) {
upgrade310(sQLiteDatabase);
}
if (i <= 4) {
upgradeTo5(sQLiteDatabase);
}
if (i <= 5) {
upgrade320(sQLiteDatabase);
}
if (i <= 6) {
upgrade7(sQLiteDatabase);
}
if (i <= 7) {
upgradeTo8(sQLiteDatabase);
}
}
}
public JimuOpenHelper(Context context, String str, SQLiteDatabase.CursorFactory cursorFactory) {
super(context, str, cursorFactory);
}
}

View File

@@ -0,0 +1,19 @@
package com.ubt.jimu.base.db.converter;
import com.google.gson.reflect.TypeToken;
import com.ubt.jimu.diy.model.DiyDetailsModel;
import com.ubt.jimu.utils.JsonHelper;
import java.util.ArrayList;
import org.greenrobot.greendao.converter.PropertyConverter;
/* loaded from: classes.dex */
public class DiyBuildStepConvert implements PropertyConverter<ArrayList<DiyDetailsModel.DiyBuildStep>, String> {
public String convertToDatabaseValue(ArrayList<DiyDetailsModel.DiyBuildStep> arrayList) {
return JsonHelper.a(arrayList);
}
public ArrayList<DiyDetailsModel.DiyBuildStep> convertToEntityProperty(String str) {
return (ArrayList) JsonHelper.a(str, new TypeToken<ArrayList<DiyDetailsModel.DiyBuildStep>>() { // from class: com.ubt.jimu.base.db.converter.DiyBuildStepConvert.1
}.getType());
}
}

View File

@@ -0,0 +1,102 @@
package com.ubt.jimu.base.db.course;
import com.ubt.jimu.base.db.AbstractDaoHandler;
import com.ubt.jimu.base.db.DatabaseUtils;
import com.ubt.jimu.course.repository.JimuCourse;
import com.ubt.jimu.gen.JimuCourseDao;
import java.util.List;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.query.QueryBuilder;
import org.greenrobot.greendao.query.WhereCondition;
/* loaded from: classes.dex */
public class JimuCourseDbHandler extends AbstractDaoHandler<JimuCourse> {
public JimuCourseDbHandler(AbstractDao<JimuCourse, Long> abstractDao) {
super(abstractDao);
}
public static JimuCourse getDownloadedCourse(JimuCourse jimuCourse) {
QueryBuilder k = new JimuCourseDbHandler(DatabaseUtils.getDaoSession(false).l()).dao.k();
k.a(JimuCourseDao.Properties.Id.a(Integer.valueOf(jimuCourse.getId())), new WhereCondition[0]);
List<JimuCourse> b = k.b();
if (b == null || b.size() == 0) {
return null;
}
for (JimuCourse jimuCourse2 : b) {
if (jimuCourse2.getDownload()) {
return jimuCourse2;
}
}
return null;
}
public static List<JimuCourse> getJimuCourseList(String str, long j) {
try {
QueryBuilder<JimuCourse> k = DatabaseUtils.getDaoSession(false).l().k();
k.a(JimuCourseDao.Properties.UserId.a((Object) str), new WhereCondition[0]);
k.a(JimuCourseDao.Properties.Id);
return k.b();
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
public static void saveOrUpdate(List<JimuCourse> list) {
if (list == null) {
return;
}
JimuCourseDao l = DatabaseUtils.getDaoSession(false).l();
for (JimuCourse jimuCourse : list) {
try {
QueryBuilder<JimuCourse> k = l.k();
k.a(JimuCourseDao.Properties.UserId.a((Object) jimuCourse.getUserId()), JimuCourseDao.Properties.Id.a(Integer.valueOf(jimuCourse.getId())));
JimuCourse c = k.c();
if (c == null) {
l.f(jimuCourse);
} else {
c.setDescription(jimuCourse.getDescription());
c.setFolderName(jimuCourse.getFolderName());
c.setImagePath(jimuCourse.getImagePath());
c.setResourceZip(jimuCourse.getResourceZip());
c.setImagePathLock(jimuCourse.getImagePathLock());
c.setIsAvailable(jimuCourse.getIsAvailable());
c.setName(jimuCourse.getName());
c.setPassCount(jimuCourse.getPassCount());
c.setMissionCount(jimuCourse.getMissionCount());
c.setStarMax(jimuCourse.getStarMax());
if (jimuCourse.getUpdatedTime() != c.getUpdatedTime()) {
c.setDownload(false);
}
l.j(c);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
public static void updateAllUserCourseDownloaded(JimuCourse jimuCourse, boolean z) {
JimuCourseDao l = DatabaseUtils.getDaoSession(true).l();
try {
QueryBuilder<JimuCourse> k = l.k();
k.a(JimuCourseDao.Properties.Id.a(Integer.valueOf(jimuCourse.getId())), new WhereCondition[0]);
List<JimuCourse> b = k.b();
if (b == null || b.size() <= 0) {
return;
}
for (JimuCourse jimuCourse2 : b) {
jimuCourse2.setDownload(z);
jimuCourse2.setUpdatedTime(jimuCourse.getUpdatedTime());
l.j(jimuCourse2);
}
} catch (Exception e) {
e.printStackTrace();
}
}
@Override // com.ubt.jimu.base.db.AbstractDaoHandler, com.ubt.jimu.base.db.IDaoHandler
public JimuCourse selectUnique(JimuCourse jimuCourse) {
return null;
}
}

View File

@@ -0,0 +1,110 @@
package com.ubt.jimu.base.db.course;
import com.ubt.jimu.base.db.AbstractDaoHandler;
import com.ubt.jimu.base.db.DatabaseUtils;
import com.ubt.jimu.course.repository.JimuCourseMission;
import com.ubt.jimu.gen.DaoSession;
import com.ubt.jimu.gen.JimuCourseMissionDao;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.query.QueryBuilder;
/* loaded from: classes.dex */
public class JimuCourseMissionDbHandler extends AbstractDaoHandler<JimuCourseMission> {
public JimuCourseMissionDbHandler(AbstractDao<JimuCourseMission, Long> abstractDao) {
super(abstractDao);
}
public static JimuCourseMission getJimuCourseMission(JimuCourseMission jimuCourseMission) {
try {
QueryBuilder<JimuCourseMission> k = DatabaseUtils.getDaoSession(false).m().k();
k.a(JimuCourseMissionDao.Properties.UserId.a((Object) jimuCourseMission.getUserId()), JimuCourseMissionDao.Properties.CourseId.a(Long.valueOf(jimuCourseMission.getCourseId())), JimuCourseMissionDao.Properties.TaskId.a(Long.valueOf(jimuCourseMission.getTaskId())), JimuCourseMissionDao.Properties.Id.a(Long.valueOf(jimuCourseMission.getId())));
return k.c();
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
public static List<JimuCourseMission> getJimuCourseMissions(String str, long j, long j2, long j3) {
try {
QueryBuilder<JimuCourseMission> k = DatabaseUtils.getDaoSession(false).m().k();
k.a(JimuCourseMissionDao.Properties.UserId.a((Object) str), JimuCourseMissionDao.Properties.PackageId.a(Long.valueOf(j)), JimuCourseMissionDao.Properties.CourseId.a(Long.valueOf(j2)), JimuCourseMissionDao.Properties.TaskId.a(Long.valueOf(j3)));
k.a(JimuCourseMissionDao.Properties.Name);
return k.b();
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
public static boolean update(List<JimuCourseMission> list) {
if (list == null || list.size() == 0) {
return false;
}
try {
DaoSession daoSession = DatabaseUtils.getDaoSession(true);
for (JimuCourseMission jimuCourseMission : list) {
JimuCourseMission jimuCourseMission2 = getJimuCourseMission(jimuCourseMission);
if (jimuCourseMission2 != null) {
jimuCourseMission.setLocalId(jimuCourseMission2.getLocalId());
}
}
daoSession.m().c((Iterable) list);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
public static boolean updateMissions(List<JimuCourseMission> list) {
JimuCourseMission next;
JimuCourseMission jimuCourseMission;
if (list == null || list.size() == 0) {
return false;
}
try {
DaoSession daoSession = DatabaseUtils.getDaoSession(true);
ArrayList arrayList = new ArrayList();
Iterator<JimuCourseMission> it = list.iterator();
while (it.hasNext() && (jimuCourseMission = getJimuCourseMission((next = it.next()))) != null) {
jimuCourseMission.setIsLock(next.getIsLock());
jimuCourseMission.setIsSkip(next.getIsSkip());
jimuCourseMission.setStar(next.getStar());
arrayList.add(jimuCourseMission);
}
if (arrayList.size() != list.size()) {
return false;
}
daoSession.m().d((Iterable) arrayList);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
public static void updateNextMission(JimuCourseMission jimuCourseMission) {
if (jimuCourseMission == null) {
return;
}
try {
JimuCourseMissionDao m = DatabaseUtils.getDaoSession(true).m();
JimuCourseMission jimuCourseMission2 = getJimuCourseMission(jimuCourseMission);
if (jimuCourseMission2 != null) {
jimuCourseMission.setLocalId(jimuCourseMission2.getLocalId());
m.b((Object[]) new JimuCourseMission[]{jimuCourseMission});
}
} catch (Exception e) {
e.printStackTrace();
}
}
@Override // com.ubt.jimu.base.db.AbstractDaoHandler, com.ubt.jimu.base.db.IDaoHandler
public JimuCourseMission selectUnique(JimuCourseMission jimuCourseMission) {
return null;
}
}

View File

@@ -0,0 +1,41 @@
package com.ubt.jimu.base.db.course;
import com.ubt.jimu.base.db.AbstractDaoHandler;
import com.ubt.jimu.base.db.DatabaseUtils;
import com.ubt.jimu.course.repository.JimuCourseTask;
import com.ubt.jimu.gen.JimuCourseTaskDao;
import java.util.List;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.query.QueryBuilder;
/* loaded from: classes.dex */
public class JimuCourseTaskDbHaldler extends AbstractDaoHandler<JimuCourseTask> {
public JimuCourseTaskDbHaldler(AbstractDao<JimuCourseTask, Long> abstractDao) {
super(abstractDao);
}
public static List<JimuCourseTask> getJimuCourseTasks(String str, long j, long j2) {
QueryBuilder<JimuCourseTask> k = DatabaseUtils.getDaoSession(false).n().k();
k.a(JimuCourseTaskDao.Properties.UserId.a((Object) str), JimuCourseTaskDao.Properties.PackageId.a(Long.valueOf(j)), JimuCourseTaskDao.Properties.CourseId.a(Long.valueOf(j2)));
return k.b();
}
public static void saveOrUpdate(List<JimuCourseTask> list) {
if (list == null || list.size() == 0) {
return;
}
DatabaseUtils.getDaoSession(true).n().c((Iterable) list);
}
@Override // com.ubt.jimu.base.db.AbstractDaoHandler, com.ubt.jimu.base.db.IDaoHandler
public JimuCourseTask selectUnique(JimuCourseTask jimuCourseTask) {
return null;
}
public static void saveOrUpdate(JimuCourseTask jimuCourseTask) {
if (jimuCourseTask == null) {
return;
}
DatabaseUtils.getDaoSession(true).n().a((Object[]) new JimuCourseTask[]{jimuCourseTask});
}
}

View File

@@ -0,0 +1,8 @@
package com.ubt.jimu.base.db.diy;
/* loaded from: classes.dex */
public enum Diy2Type {
TEXT,
LIST,
PICTURE
}

View File

@@ -0,0 +1,369 @@
package com.ubt.jimu.base.db.diy;
import android.text.TextUtils;
import com.ubt.jimu.base.entities.RobotLite;
import java.io.Serializable;
/* loaded from: classes.dex */
public class DiyDBModel implements Serializable, Comparable<DiyDBModel> {
private static final int CONTROLLER_COMPLETE = 1;
private static final long serialVersionUID = 12840;
private String actionPath;
private int completeState;
private String compressImagePath;
private int customModelCategory;
private long customModelCreatetime;
private String customModelId;
private String description;
private String filePath;
private Long id;
private boolean isDelete;
private Boolean isModify;
private long lastUploadTime;
private String modelCreatedId;
private Integer modelId;
private String modelName;
private long modifyTime;
private Integer mystep;
private String step1Desc;
private Integer step1state;
private Integer step2state;
private Integer step3state;
private Integer step4state;
private String step5PathDesc;
private String step5desc;
private Integer step5state;
private Integer uploadState;
private boolean useable;
private String version;
public DiyDBModel(Long l, String str, String str2, int i, long j, long j2, Boolean bool, Integer num, boolean z, String str3, boolean z2, String str4, String str5, String str6, long j3, String str7, Integer num2, Integer num3, String str8, Integer num4, Integer num5, Integer num6, Integer num7, String str9, String str10, Integer num8, String str11, int i2) {
this.isModify = false;
this.modelId = 0;
this.useable = true;
this.isDelete = false;
this.uploadState = 0;
this.step1state = 0;
this.step2state = 0;
this.step3state = 0;
this.step4state = 0;
this.step5state = 0;
this.mystep = 0;
this.actionPath = "";
this.id = l;
this.customModelId = str;
this.modelName = str2;
this.customModelCategory = i;
this.customModelCreatetime = j;
this.modifyTime = j2;
this.isModify = bool;
this.modelId = num;
this.useable = z;
this.version = str3;
this.isDelete = z2;
this.description = str4;
this.modelCreatedId = str5;
this.compressImagePath = str6;
this.lastUploadTime = j3;
this.filePath = str7;
this.uploadState = num2;
this.step1state = num3;
this.step1Desc = str8;
this.step2state = num4;
this.step3state = num5;
this.step4state = num6;
this.step5state = num7;
this.step5desc = str9;
this.step5PathDesc = str10;
this.mystep = num8;
this.actionPath = str11;
this.completeState = i2;
}
public String getActionPath() {
return this.actionPath;
}
public int getCompleteState() {
return this.completeState;
}
public String getCompressImagePath() {
return this.compressImagePath;
}
public int getCustomModelCategory() {
return this.customModelCategory;
}
public long getCustomModelCreatetime() {
return this.customModelCreatetime;
}
public String getCustomModelId() {
return this.customModelId;
}
public String getDescription() {
return this.description;
}
public String getFilePath() {
return this.filePath;
}
public Long getId() {
return this.id;
}
public boolean getIsDelete() {
return this.isDelete;
}
public Boolean getIsModify() {
return this.isModify;
}
public long getLastUploadTime() {
return this.lastUploadTime;
}
public String getModelCreatedId() {
return this.modelCreatedId;
}
public Integer getModelId() {
return this.modelId;
}
public String getModelName() {
return this.modelName;
}
public Boolean getModify() {
return this.isModify;
}
public long getModifyTime() {
return this.modifyTime;
}
public Integer getMyStep() {
return this.mystep;
}
public Integer getMystep() {
return this.mystep;
}
public RobotLite getRobotLite() {
return new RobotLite(this.modelId.intValue(), this.customModelId, this.modelName, this.filePath, true, true);
}
public String getStep1Desc() {
return this.step1Desc;
}
public Integer getStep1state() {
return this.step1state;
}
public Integer getStep2state() {
return this.step2state;
}
public Integer getStep3state() {
return this.step3state;
}
public Integer getStep4state() {
return this.step4state;
}
public String getStep5PathDesc() {
return this.step5PathDesc;
}
public String getStep5desc() {
return this.step5desc;
}
public Integer getStep5state() {
return this.step5state;
}
public Integer getUploadState() {
return this.uploadState;
}
public boolean getUseable() {
return this.useable;
}
public String getVersion() {
return this.version;
}
public boolean isControllerComplete() {
return (this.completeState & 1) > 0;
}
public boolean isDelete() {
return this.isDelete;
}
public boolean isUseable() {
return this.useable;
}
public void setActionPath(String str) {
this.actionPath = str;
}
public void setCompleteState(int i) {
this.completeState = i;
}
public void setCompressImagePath(String str) {
this.compressImagePath = str;
}
public void setControllerComplete() {
this.completeState |= 1;
}
public void setCustomModelCategory(int i) {
this.customModelCategory = i;
}
public void setCustomModelCreatetime(long j) {
this.customModelCreatetime = j;
}
public void setCustomModelId(String str) {
this.customModelId = str;
}
public void setDelete(boolean z) {
this.isDelete = z;
}
public void setDescription(String str) {
this.description = str;
}
public void setFilePath(String str) {
this.filePath = str;
}
public void setId(Long l) {
this.id = l;
}
public void setIsDelete(boolean z) {
this.isDelete = z;
}
public void setIsModify(Boolean bool) {
this.isModify = bool;
}
public void setLastUploadTime(long j) {
this.lastUploadTime = j;
}
public void setModelCreatedId(String str) {
this.modelCreatedId = str;
}
public void setModelId(Integer num) {
this.modelId = num;
}
public void setModelName(String str) {
this.modelName = str;
}
public void setModify(Boolean bool) {
this.isModify = bool;
}
public void setModifyTime(long j) {
this.modifyTime = j;
}
public void setMyStep(Integer num) {
this.mystep = num;
}
public void setMystep(Integer num) {
this.mystep = num;
}
public void setStep1Desc(String str) {
this.step1Desc = str;
}
public void setStep1state(Integer num) {
this.step1state = num;
}
public void setStep2state(Integer num) {
this.step2state = num;
}
public void setStep3state(Integer num) {
this.step3state = num;
}
public void setStep4state(Integer num) {
this.step4state = num;
}
public void setStep5PathDesc(String str) {
this.step5PathDesc = str;
}
public void setStep5desc(String str) {
this.step5desc = str;
}
public void setStep5state(Integer num) {
this.step5state = num;
}
public void setUploadState(Integer num) {
this.uploadState = num;
}
public void setUseable(boolean z) {
this.useable = z;
}
public void setVersion(String str) {
this.version = str;
}
@Override // java.lang.Comparable
public int compareTo(DiyDBModel diyDBModel) {
if (TextUtils.isEmpty(diyDBModel.getCustomModelId()) || TextUtils.isEmpty(this.customModelId)) {
return 1;
}
return Long.parseLong(this.customModelId) > Long.parseLong(diyDBModel.getCustomModelId()) ? -1 : 0;
}
public DiyDBModel() {
this.isModify = false;
this.modelId = 0;
this.useable = true;
this.isDelete = false;
this.uploadState = 0;
this.step1state = 0;
this.step2state = 0;
this.step3state = 0;
this.step4state = 0;
this.step5state = 0;
this.mystep = 0;
this.actionPath = "";
}
}

View File

@@ -0,0 +1,321 @@
package com.ubt.jimu.base.db.diy;
/* loaded from: classes.dex */
public class DiyDBModelCopy {
private String actionPath;
private String compressImagePath;
private int customModelCategory;
private long customModelCreatetime;
private String customModelId;
private String description;
private String filePath;
private Long id;
private boolean isDelete;
private Boolean isModify;
private String modelCreatedId;
private Integer modelId;
private String modelName;
private long modifyTime;
private Integer mystep;
private String step1Desc;
private Integer step1state;
private Integer step2state;
private Integer step3state;
private Integer step4state;
private String step5PathDesc;
private String step5desc;
private Integer step5state;
private Integer uploadState;
private boolean useable;
private String version;
public DiyDBModelCopy() {
this.isModify = false;
this.useable = true;
this.isDelete = false;
this.uploadState = 0;
this.step1state = 0;
this.step2state = 0;
this.step3state = 0;
this.step4state = 0;
this.step5state = 0;
this.mystep = 0;
this.actionPath = "";
}
public String getActionPath() {
return this.actionPath;
}
public String getCompressImagePath() {
return this.compressImagePath;
}
public int getCustomModelCategory() {
return this.customModelCategory;
}
public long getCustomModelCreatetime() {
return this.customModelCreatetime;
}
public String getCustomModelId() {
return this.customModelId;
}
public String getDescription() {
return this.description;
}
public String getFilePath() {
return this.filePath;
}
public Long getId() {
return this.id;
}
public boolean getIsDelete() {
return this.isDelete;
}
public Boolean getIsModify() {
return this.isModify;
}
public String getModelCreatedId() {
return this.modelCreatedId;
}
public Integer getModelId() {
return this.modelId;
}
public String getModelName() {
return this.modelName;
}
public Boolean getModify() {
return this.isModify;
}
public long getModifyTime() {
return this.modifyTime;
}
public Integer getMyStep() {
return this.mystep;
}
public Integer getMystep() {
return this.mystep;
}
public String getStep1Desc() {
return this.step1Desc;
}
public Integer getStep1state() {
return this.step1state;
}
public Integer getStep2state() {
return this.step2state;
}
public Integer getStep3state() {
return this.step3state;
}
public Integer getStep4state() {
return this.step4state;
}
public String getStep5PathDesc() {
return this.step5PathDesc;
}
public String getStep5desc() {
return this.step5desc;
}
public Integer getStep5state() {
return this.step5state;
}
public Integer getUploadState() {
return this.uploadState;
}
public boolean getUseable() {
return this.useable;
}
public String getVersion() {
return this.version;
}
public boolean isDelete() {
return this.isDelete;
}
public boolean isUseable() {
return this.useable;
}
public void setActionPath(String str) {
this.actionPath = str;
}
public void setCompressImagePath(String str) {
this.compressImagePath = str;
}
public void setCustomModelCategory(int i) {
this.customModelCategory = i;
}
public void setCustomModelCreatetime(long j) {
this.customModelCreatetime = j;
}
public void setCustomModelId(String str) {
this.customModelId = str;
}
public void setDelete(boolean z) {
this.isDelete = z;
}
public void setDescription(String str) {
this.description = str;
}
public void setFilePath(String str) {
this.filePath = str;
}
public void setId(Long l) {
this.id = l;
}
public void setIsDelete(boolean z) {
this.isDelete = z;
}
public void setIsModify(Boolean bool) {
this.isModify = bool;
}
public void setModelCreatedId(String str) {
this.modelCreatedId = str;
}
public void setModelId(Integer num) {
this.modelId = num;
}
public void setModelName(String str) {
this.modelName = str;
}
public void setModify(Boolean bool) {
this.isModify = bool;
}
public void setModifyTime(long j) {
this.modifyTime = j;
}
public void setMyStep(Integer num) {
this.mystep = num;
}
public void setMystep(Integer num) {
this.mystep = num;
}
public void setStep1Desc(String str) {
this.step1Desc = str;
}
public void setStep1state(Integer num) {
this.step1state = num;
}
public void setStep2state(Integer num) {
this.step2state = num;
}
public void setStep3state(Integer num) {
this.step3state = num;
}
public void setStep4state(Integer num) {
this.step4state = num;
}
public void setStep5PathDesc(String str) {
this.step5PathDesc = str;
}
public void setStep5desc(String str) {
this.step5desc = str;
}
public void setStep5state(Integer num) {
this.step5state = num;
}
public void setUploadState(Integer num) {
this.uploadState = num;
}
public void setUseable(boolean z) {
this.useable = z;
}
public void setVersion(String str) {
this.version = str;
}
public DiyDBModelCopy(Long l, String str, String str2, int i, long j, long j2, Boolean bool, Integer num, boolean z, String str3, boolean z2, String str4, String str5, String str6, String str7, Integer num2, Integer num3, String str8, Integer num4, Integer num5, Integer num6, Integer num7, String str9, String str10, Integer num8, String str11) {
this.isModify = false;
this.useable = true;
this.isDelete = false;
this.uploadState = 0;
this.step1state = 0;
this.step2state = 0;
this.step3state = 0;
this.step4state = 0;
this.step5state = 0;
this.mystep = 0;
this.actionPath = "";
this.id = l;
this.customModelId = str;
this.modelName = str2;
this.customModelCategory = i;
this.customModelCreatetime = j;
this.modifyTime = j2;
this.isModify = bool;
this.modelId = num;
this.useable = z;
this.version = str3;
this.isDelete = z2;
this.description = str4;
this.modelCreatedId = str5;
this.compressImagePath = str6;
this.filePath = str7;
this.uploadState = num2;
this.step1state = num3;
this.step1Desc = str8;
this.step2state = num4;
this.step3state = num5;
this.step4state = num6;
this.step5state = num7;
this.step5desc = str9;
this.step5PathDesc = str10;
this.mystep = num8;
this.actionPath = str11;
}
}

View File

@@ -0,0 +1,22 @@
package com.ubt.jimu.base.db.diy;
import com.ubt.jimu.base.db.AbstractDaoHandler;
import com.ubt.jimu.diy.model.DiyDetailsModel;
import org.greenrobot.greendao.AbstractDao;
/* loaded from: classes.dex */
public class DiyDetailsDbHandler extends AbstractDaoHandler<DiyDetailsModel> {
public DiyDetailsDbHandler(AbstractDao<DiyDetailsModel, Long> abstractDao) {
super(abstractDao);
}
public boolean checkDownload(DiyDetailsModel diyDetailsModel) {
DiyDetailsModel selectById = selectById(diyDetailsModel.getId());
return selectById != null && selectById.getDownload();
}
@Override // com.ubt.jimu.base.db.AbstractDaoHandler, com.ubt.jimu.base.db.IDaoHandler
public DiyDetailsModel selectUnique(DiyDetailsModel diyDetailsModel) {
return null;
}
}

View File

@@ -0,0 +1,89 @@
package com.ubt.jimu.base.db.diy;
import android.content.Context;
import com.ubt.jimu.base.cache.Cache;
import com.ubt.jimu.base.db.DatabaseUtils;
import com.ubt.jimu.gen.DaoMaster;
import com.ubt.jimu.gen.DaoSession;
import com.ubt.jimu.gen.DiyDBModelDao;
import java.util.ArrayList;
import java.util.List;
import org.greenrobot.greendao.query.QueryBuilder;
import org.greenrobot.greendao.query.WhereCondition;
/* loaded from: classes.dex */
public class DiyHelper {
public static final boolean ENCRYPTED = true;
private static final DiyHelper ourInstance = new DiyHelper();
private DaoSession daoSession;
private DiyHelper() {
}
public static DiyHelper getInstance() {
return ourInstance;
}
public void deleteItem(DiyDBModel diyDBModel) {
DatabaseUtils.getDaoSession(true).a((DaoSession) diyDBModel);
}
public DaoSession getDaoSession() {
return this.daoSession;
}
public List<DiyDBModel> getDiyList() {
ArrayList arrayList = new ArrayList();
try {
QueryBuilder<DiyDBModel> k = DatabaseUtils.getDaoSession(true).d().k();
k.a(DiyDBModelDao.Properties.ModelCreatedId.a((Object) Cache.getInstance().getUserId()), new WhereCondition[0]);
List<DiyDBModel> b = k.b();
for (int size = b.size(); size > 0; size--) {
arrayList.add(b.get(size - 1));
}
} catch (Exception e) {
e.printStackTrace();
}
return arrayList;
}
public void insertData(DiyDBModel diyDBModel) {
try {
DatabaseUtils.getDaoSession(true).b((DaoSession) diyDBModel);
} catch (Exception e) {
e.printStackTrace();
}
}
public boolean nameRepeat(String str) {
QueryBuilder b = DatabaseUtils.getDaoSession(false).b(DiyDBModel.class);
b.a(DiyDBModelDao.Properties.ModelName.a((Object) str), new WhereCondition[0]);
return ((DiyDBModel) b.c()) != null;
}
public boolean queryForName(String str) {
try {
QueryBuilder<DiyDBModel> k = DatabaseUtils.getDaoSession(true).d().k();
k.a(DiyDBModelDao.Properties.ModelName.a((Object) str), new WhereCondition[0]);
return k.c() != null;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
public DiyDBModel queryForUUid(String str) {
try {
QueryBuilder<DiyDBModel> k = DatabaseUtils.getDaoSession(true).d().k();
k.a(DiyDBModelDao.Properties.CustomModelId.a((Object) str), new WhereCondition[0]);
return k.c();
} catch (Exception e) {
e.printStackTrace();
return new DiyDBModel();
}
}
public void rigisterDb(Context context) {
this.daoSession = new DaoMaster(new DaoMaster.DevOpenHelper(context, "diy-db-encrypted").getEncryptedWritableDb("super-secret")).newSession();
}
}

View File

@@ -0,0 +1,59 @@
package com.ubt.jimu.base.db.diy;
import com.ubt.jimu.base.db.AbstractDaoHandler;
import com.ubt.jimu.base.db.DatabaseUtils;
import com.ubt.jimu.blockly.Utils;
import com.ubt.jimu.blockly.bean.BlocklyProject;
import com.ubt.jimu.diy.DiyRobotDbHandler;
import com.ubt.jimu.diy.model.DiyProgramFile;
import com.ubt.jimu.gen.DiyProgramFileDao;
import com.ubt.jimu.unity.ModelType;
import com.ubt.jimu.utils.LocaleUtils;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.query.QueryBuilder;
/* loaded from: classes.dex */
public class DiyProgramFileDbHandler extends AbstractDaoHandler<DiyProgramFile> {
public DiyProgramFileDbHandler(AbstractDao<DiyProgramFile, Long> abstractDao) {
super(abstractDao);
}
public static List<BlocklyProject> getDiyBlocklyProject(String str) {
DiyProgramFileDbHandler diyProgramFileDbHandler = new DiyProgramFileDbHandler(DatabaseUtils.getDaoSession(true).g());
ArrayList arrayList = new ArrayList();
List<DiyProgramFile> diyProgramFile = diyProgramFileDbHandler.getDiyProgramFile(str);
if (diyProgramFile.size() == 0) {
return arrayList;
}
for (DiyProgramFile diyProgramFile2 : diyProgramFile) {
File file = new File(DiyRobotDbHandler.getModelPath(str, ModelType.PLAYER_DATA) + str + Utils.BLOCKLY_ADD_PATH + File.separator + diyProgramFile2.getBlocklyProjectXmlName());
if (file.exists() && !file.isDirectory()) {
BlocklyProject blocklyProject = new BlocklyProject();
blocklyProject.setBlocklyType(diyProgramFile2.getType());
blocklyProject.setBlocklyVersion(diyProgramFile2.getBlocklyVersion());
blocklyProject.setCustomModelId(diyProgramFile2.getCustomModelId());
blocklyProject.setXmlId(diyProgramFile2.getBlocklyProjectXmlId());
blocklyProject.setXmlName(diyProgramFile2.getName());
blocklyProject.setIsDeleted("0");
blocklyProject.setModelType(String.valueOf(ModelType.PLAYER_DATA.getType()));
arrayList.add(blocklyProject);
}
}
return arrayList;
}
public List<DiyProgramFile> getDiyProgramFile(String str) {
QueryBuilder k = this.dao.k();
k.a(DiyProgramFileDao.Properties.CustomModelId.a((Object) str), DiyProgramFileDao.Properties.Language.a((Object) LocaleUtils.b()));
List<DiyProgramFile> b = k.b();
return b == null ? new ArrayList() : b;
}
@Override // com.ubt.jimu.base.db.AbstractDaoHandler, com.ubt.jimu.base.db.IDaoHandler
public DiyProgramFile selectUnique(DiyProgramFile diyProgramFile) {
return null;
}
}

View File

@@ -0,0 +1,59 @@
package com.ubt.jimu.base.db.diy;
import android.text.TextUtils;
import com.ubt.jimu.base.db.AbstractDaoHandler;
import com.ubt.jimu.base.db.DatabaseUtils;
import com.ubt.jimu.diy.DiyRobotFile;
import com.ubt.jimu.gen.DiyRobotFileDao;
import java.util.List;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.query.QueryBuilder;
import org.greenrobot.greendao.query.WhereCondition;
/* loaded from: classes.dex */
public class DiyRobotFileDbDandler extends AbstractDaoHandler<DiyRobotFile> {
public DiyRobotFileDbDandler(AbstractDao<DiyRobotFile, Long> abstractDao) {
super(abstractDao);
}
public static DiyRobotFile query(DiyRobotFile diyRobotFile) {
if (diyRobotFile == null) {
return null;
}
QueryBuilder<DiyRobotFile> k = DatabaseUtils.getDaoSession(false).h().k();
k.a(DiyRobotFileDao.Properties.CustomModelId.a(TextUtils.isEmpty(diyRobotFile.getCustomModelId()) ? Integer.valueOf(diyRobotFile.getServerModelId()) : diyRobotFile.getCustomModelId()), DiyRobotFileDao.Properties.FileType.a(Integer.valueOf(diyRobotFile.getFileType())), DiyRobotFileDao.Properties.FileName.a((Object) diyRobotFile.getFileName()), DiyRobotFileDao.Properties.ServerModelId.a(Integer.valueOf(diyRobotFile.getServerModelId())));
return k.c();
}
public static List<DiyRobotFile> queryDiyRobotFile(String str) {
QueryBuilder<DiyRobotFile> k = DatabaseUtils.getDaoSession(false).h().k();
k.a(DiyRobotFileDao.Properties.CustomModelId.a((Object) str), new WhereCondition[0]);
return k.b();
}
public static void saveOrUpdate(DiyRobotFile diyRobotFile) {
if (diyRobotFile == null) {
return;
}
try {
DiyRobotFileDao h = DatabaseUtils.getDaoSession(false).h();
QueryBuilder<DiyRobotFile> k = h.k();
k.a(DiyRobotFileDao.Properties.CustomModelId.a(TextUtils.isEmpty(diyRobotFile.getCustomModelId()) ? Integer.valueOf(diyRobotFile.getServerModelId()) : diyRobotFile.getCustomModelId()), DiyRobotFileDao.Properties.FileType.a(Integer.valueOf(diyRobotFile.getFileType())), DiyRobotFileDao.Properties.FileName.a((Object) diyRobotFile.getFileName()), DiyRobotFileDao.Properties.ServerModelId.a(Integer.valueOf(diyRobotFile.getServerModelId())));
DiyRobotFile c = k.c();
if (c == null) {
h.f(diyRobotFile);
} else {
diyRobotFile.setId(c.getId());
h.g(diyRobotFile);
}
} catch (Exception e) {
e.printStackTrace();
throw e;
}
}
@Override // com.ubt.jimu.base.db.AbstractDaoHandler, com.ubt.jimu.base.db.IDaoHandler
public DiyRobotFile selectUnique(DiyRobotFile diyRobotFile) {
return null;
}
}

View File

@@ -0,0 +1,37 @@
package com.ubt.jimu.base.db.diy;
import com.ubt.jimu.base.db.DatabaseUtils;
import com.ubt.jimu.gen.DiyStep2ModelDao;
import org.greenrobot.greendao.query.QueryBuilder;
import org.greenrobot.greendao.query.WhereCondition;
/* loaded from: classes.dex */
public class DiyStep2Helper {
private static final DiyStep2Helper ourInstance = new DiyStep2Helper();
private DiyStep2Helper() {
}
public static DiyStep2Helper getInstance() {
return ourInstance;
}
public void insertData(DiyStep2Model diyStep2Model) {
try {
DatabaseUtils.getDaoSession(true).i().g(diyStep2Model);
} catch (Exception e) {
e.printStackTrace();
}
}
public DiyStep2Model queryForUUid(String str) {
try {
QueryBuilder<DiyStep2Model> k = DatabaseUtils.getDaoSession(true).i().k();
k.a(DiyStep2ModelDao.Properties.CustomModelId.a((Object) str), new WhereCondition[0]);
return k.c();
} catch (Exception e) {
e.printStackTrace();
return new DiyStep2Model();
}
}
}

View File

@@ -0,0 +1,169 @@
package com.ubt.jimu.base.db.diy;
/* loaded from: classes.dex */
public class DiyStep2Model {
private String customModelId;
private Integer direction;
private String directionPath;
private String modelName;
private String picJson;
private Integer step1lock;
private Integer step1state;
private Integer step2lock;
private Integer step2state;
private Integer step3lock;
private Integer step3state;
private Integer step4lock;
private Integer step4state;
private String stepDesc;
public DiyStep2Model(String str, String str2, Integer num, Integer num2, String str3, String str4, Integer num3, Integer num4, Integer num5, String str5, Integer num6, Integer num7, Integer num8, Integer num9) {
this.step1state = 0;
this.step1lock = 0;
this.step2state = 0;
this.step2lock = 0;
this.direction = 1;
this.step3state = 0;
this.step3lock = 0;
this.step4state = 0;
this.step4lock = 0;
this.customModelId = str;
this.modelName = str2;
this.step1state = num;
this.step1lock = num2;
this.stepDesc = str3;
this.picJson = str4;
this.step2state = num3;
this.step2lock = num4;
this.direction = num5;
this.directionPath = str5;
this.step3state = num6;
this.step3lock = num7;
this.step4state = num8;
this.step4lock = num9;
}
public String getCustomModelId() {
return this.customModelId;
}
public Integer getDirection() {
return this.direction;
}
public String getDirectionPath() {
return this.directionPath;
}
public String getModelName() {
return this.modelName;
}
public String getPicJson() {
return this.picJson;
}
public Integer getStep1lock() {
return this.step1lock;
}
public Integer getStep1state() {
return this.step1state;
}
public Integer getStep2lock() {
return this.step2lock;
}
public Integer getStep2state() {
return this.step2state;
}
public Integer getStep3lock() {
return this.step3lock;
}
public Integer getStep3state() {
return this.step3state;
}
public Integer getStep4lock() {
return this.step4lock;
}
public Integer getStep4state() {
return this.step4state;
}
public String getStepDesc() {
return this.stepDesc;
}
public void setCustomModelId(String str) {
this.customModelId = str;
}
public void setDirection(Integer num) {
this.direction = num;
}
public void setDirectionPath(String str) {
this.directionPath = str;
}
public void setModelName(String str) {
this.modelName = str;
}
public void setPicJson(String str) {
this.picJson = str;
}
public void setStep1lock(Integer num) {
this.step1lock = num;
}
public void setStep1state(Integer num) {
this.step1state = num;
}
public void setStep2lock(Integer num) {
this.step2lock = num;
}
public void setStep2state(Integer num) {
this.step2state = num;
}
public void setStep3lock(Integer num) {
this.step3lock = num;
}
public void setStep3state(Integer num) {
this.step3state = num;
}
public void setStep4lock(Integer num) {
this.step4lock = num;
}
public void setStep4state(Integer num) {
this.step4state = num;
}
public void setStepDesc(String str) {
this.stepDesc = str;
}
public DiyStep2Model() {
this.step1state = 0;
this.step1lock = 0;
this.step2state = 0;
this.step2lock = 0;
this.direction = 1;
this.step3state = 0;
this.step3lock = 0;
this.step4state = 0;
this.step4lock = 0;
}
}

View File

@@ -0,0 +1,14 @@
package com.ubt.jimu.base.db.diy;
import org.greenrobot.greendao.converter.PropertyConverter;
/* loaded from: classes.dex */
public class DiyStep2TypeConverter implements PropertyConverter<Diy2Type, String> {
public String convertToDatabaseValue(Diy2Type diy2Type) {
return diy2Type.name();
}
public Diy2Type convertToEntityProperty(String str) {
return Diy2Type.valueOf(str);
}
}

View File

@@ -0,0 +1,8 @@
package com.ubt.jimu.base.db.diy;
/* loaded from: classes.dex */
public enum DiyType {
TEXT,
LIST,
PICTURE
}

View File

@@ -0,0 +1,14 @@
package com.ubt.jimu.base.db.diy;
import org.greenrobot.greendao.converter.PropertyConverter;
/* loaded from: classes.dex */
public class DiyTypeConverter implements PropertyConverter<DiyType, String> {
public String convertToDatabaseValue(DiyType diyType) {
return diyType.name();
}
public DiyType convertToEntityProperty(String str) {
return DiyType.valueOf(str);
}
}

View File

@@ -0,0 +1,14 @@
package com.ubt.jimu.base.db.diy;
/* loaded from: classes.dex */
public class SyncDbModel extends DiyDBModel {
private String modelDescription;
public String getModelDescription() {
return this.modelDescription;
}
public void setModelDescription(String str) {
this.modelDescription = str;
}
}

View File

@@ -0,0 +1,32 @@
package com.ubt.jimu.base.db.proxy;
import com.ubt.jimu.base.db.DatabaseUtils;
import com.ubt.jimu.blockly.bean.BlocklyProject;
import java.util.List;
/* loaded from: classes.dex */
public class BlocklyProjectImpl implements ISqlProxy<BlocklyProject> {
@Override // com.ubt.jimu.base.db.proxy.ISqlProxy
public void deleteByData(BlocklyProject blocklyProject) {
}
@Override // com.ubt.jimu.base.db.proxy.ISqlProxy
public void deleteById() {
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // com.ubt.jimu.base.db.proxy.ISqlProxy
public BlocklyProject iSelect() {
return null;
}
@Override // com.ubt.jimu.base.db.proxy.ISqlProxy
public List<BlocklyProject> selectAll() {
return DatabaseUtils.getDaoSession(true).a().j();
}
@Override // com.ubt.jimu.base.db.proxy.ISqlProxy
public void insert(BlocklyProject blocklyProject) {
DatabaseUtils.getDaoSession(true).a().g(blocklyProject);
}
}

View File

@@ -0,0 +1,36 @@
package com.ubt.jimu.base.db.proxy;
import com.ubt.jimu.base.db.DatabaseUtils;
import com.ubt.jimu.transport.model.ConfigItem;
import java.util.List;
/* loaded from: classes.dex */
public class ConfigItemImpl implements ISqlProxy<ConfigItem> {
@Override // com.ubt.jimu.base.db.proxy.ISqlProxy
public void deleteByData(ConfigItem configItem) {
}
@Override // com.ubt.jimu.base.db.proxy.ISqlProxy
public void deleteById() {
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // com.ubt.jimu.base.db.proxy.ISqlProxy
public ConfigItem iSelect() {
return null;
}
@Override // com.ubt.jimu.base.db.proxy.ISqlProxy
public List<ConfigItem> selectAll() {
return DatabaseUtils.getDaoSession(true).b().j();
}
@Override // com.ubt.jimu.base.db.proxy.ISqlProxy
public void insert(ConfigItem configItem) {
try {
DatabaseUtils.getDaoSession(true).b().f(configItem);
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@@ -0,0 +1,32 @@
package com.ubt.jimu.base.db.proxy;
import com.ubt.jimu.base.db.DatabaseUtils;
import com.ubt.jimu.base.db.diy.DiyDBModel;
import java.util.List;
/* loaded from: classes.dex */
public class DiyDBModelImpl implements ISqlProxy<DiyDBModel> {
@Override // com.ubt.jimu.base.db.proxy.ISqlProxy
public void deleteByData(DiyDBModel diyDBModel) {
}
@Override // com.ubt.jimu.base.db.proxy.ISqlProxy
public void deleteById() {
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // com.ubt.jimu.base.db.proxy.ISqlProxy
public DiyDBModel iSelect() {
return null;
}
@Override // com.ubt.jimu.base.db.proxy.ISqlProxy
public List<DiyDBModel> selectAll() {
return DatabaseUtils.getDaoSession(true).d().j();
}
@Override // com.ubt.jimu.base.db.proxy.ISqlProxy
public void insert(DiyDBModel diyDBModel) {
DatabaseUtils.getDaoSession(true).d().g(diyDBModel);
}
}

View File

@@ -0,0 +1,30 @@
package com.ubt.jimu.base.db.proxy;
import com.ubt.jimu.base.db.proxy.data.TestBean;
import java.util.List;
/* loaded from: classes.dex */
public class GreenDaoImpl implements ISqlProxy<TestBean> {
@Override // com.ubt.jimu.base.db.proxy.ISqlProxy
public void deleteByData(TestBean testBean) {
}
@Override // com.ubt.jimu.base.db.proxy.ISqlProxy
public void deleteById() {
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // com.ubt.jimu.base.db.proxy.ISqlProxy
public TestBean iSelect() {
return null;
}
@Override // com.ubt.jimu.base.db.proxy.ISqlProxy
public void insert(TestBean testBean) {
}
@Override // com.ubt.jimu.base.db.proxy.ISqlProxy
public List<TestBean> selectAll() {
return null;
}
}

View File

@@ -0,0 +1,16 @@
package com.ubt.jimu.base.db.proxy;
import java.util.List;
/* loaded from: classes.dex */
public interface ISqlProxy<T> {
void deleteByData(T t);
void deleteById();
T iSelect();
void insert(T t);
List<T> selectAll();
}

View File

@@ -0,0 +1,36 @@
package com.ubt.jimu.base.db.proxy;
import com.ubt.jimu.base.db.DatabaseUtils;
import com.ubt.jimu.blockly.bean.JimuMotion;
import java.util.List;
/* loaded from: classes.dex */
public class JimuMotionImpl implements ISqlProxy<JimuMotion> {
@Override // com.ubt.jimu.base.db.proxy.ISqlProxy
public void deleteByData(JimuMotion jimuMotion) {
}
@Override // com.ubt.jimu.base.db.proxy.ISqlProxy
public void deleteById() {
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // com.ubt.jimu.base.db.proxy.ISqlProxy
public JimuMotion iSelect() {
return null;
}
@Override // com.ubt.jimu.base.db.proxy.ISqlProxy
public List<JimuMotion> selectAll() {
return DatabaseUtils.getDaoSession(true).o().j();
}
@Override // com.ubt.jimu.base.db.proxy.ISqlProxy
public void insert(JimuMotion jimuMotion) {
try {
DatabaseUtils.getDaoSession(true).o().g(jimuMotion);
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@@ -0,0 +1,37 @@
package com.ubt.jimu.base.db.proxy;
import java.util.List;
/* loaded from: classes.dex */
public class SqliteHelper<T> {
private static final SqliteHelper ourInstance = new SqliteHelper();
private ISqlProxy mSqlProxy;
private SqliteHelper() {
}
public static SqliteHelper getInstance() {
return ourInstance;
}
public void delete(T t) {
this.mSqlProxy.deleteByData(t);
}
public SqliteHelper init(ISqlProxy iSqlProxy) {
this.mSqlProxy = iSqlProxy;
return ourInstance;
}
public void insert(T t) {
this.mSqlProxy.insert(t);
}
public List<T> loadAll() {
return this.mSqlProxy.selectAll();
}
public T select() {
return (T) this.mSqlProxy.iSelect();
}
}

View File

@@ -0,0 +1,37 @@
package com.ubt.jimu.base.db.proxy;
import com.ubt.jimu.base.db.DatabaseUtils;
import com.ubt.jimu.transport.model.TransportFile;
import com.ubt.jimu.utils.LogUtils;
import java.util.List;
/* loaded from: classes.dex */
public class TransportFileImpl implements ISqlProxy<TransportFile> {
@Override // com.ubt.jimu.base.db.proxy.ISqlProxy
public void deleteByData(TransportFile transportFile) {
}
@Override // com.ubt.jimu.base.db.proxy.ISqlProxy
public void deleteById() {
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // com.ubt.jimu.base.db.proxy.ISqlProxy
public TransportFile iSelect() {
return null;
}
@Override // com.ubt.jimu.base.db.proxy.ISqlProxy
public List<TransportFile> selectAll() {
return DatabaseUtils.getDaoSession(true).v().j();
}
@Override // com.ubt.jimu.base.db.proxy.ISqlProxy
public void insert(TransportFile transportFile) {
try {
LogUtils.c("l=======" + DatabaseUtils.getDaoSession(true).v().g(transportFile));
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@@ -0,0 +1,27 @@
package com.ubt.jimu.base.db.proxy.data;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
/* loaded from: classes.dex */
public class DataBaseHelper extends SQLiteOpenHelper {
private static final String DB_NAME = "JIMU_DB";
private static final int version = 1007;
public DataBaseHelper(Context context) {
this(context, DB_NAME, null, 1007);
}
@Override // android.database.sqlite.SQLiteOpenHelper
public void onCreate(SQLiteDatabase sQLiteDatabase) {
}
@Override // android.database.sqlite.SQLiteOpenHelper
public void onUpgrade(SQLiteDatabase sQLiteDatabase, int i, int i2) {
}
public DataBaseHelper(Context context, String str, SQLiteDatabase.CursorFactory cursorFactory, int i) {
super(context, str, cursorFactory, i);
}
}

View File

@@ -0,0 +1,5 @@
package com.ubt.jimu.base.db.proxy.data;
/* loaded from: classes.dex */
public class TestBean {
}

View File

@@ -0,0 +1,81 @@
package com.ubt.jimu.base.db.proxy.data;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import com.ubt.jimu.base.db.proxy.BlocklyProjectImpl;
import com.ubt.jimu.base.db.proxy.ConfigItemImpl;
import com.ubt.jimu.base.db.proxy.DiyDBModelImpl;
import com.ubt.jimu.base.db.proxy.JimuMotionImpl;
import com.ubt.jimu.base.db.proxy.SqliteHelper;
import com.ubt.jimu.base.db.proxy.TransportFileImpl;
import com.ubt.jimu.blockly.bean.BlocklyProject;
import com.ubt.jimu.blockly.bean.JimuMotion;
import com.ubt.jimu.transport.model.ConfigItem;
import com.ubt.jimu.transport.model.TransportFile;
import java.util.Iterator;
/* loaded from: classes.dex */
public class TestSqlIte {
private static final TestSqlIte INSTANCE = new TestSqlIte();
private TestSqlIte() {
}
public static TestSqlIte getInstance() {
return INSTANCE;
}
public void execSqlite(Context context) {
SQLiteDatabase writableDatabase = new DataBaseHelper(context).getWritableDatabase();
new DiyDBModelImpl();
try {
TestType.isCreate().moveDiyData(writableDatabase.rawQuery("select * from CustomModelBean", null));
writableDatabase.execSQL("drop table CustomModelBean");
} catch (Exception e) {
e.printStackTrace();
}
BlocklyProjectImpl blocklyProjectImpl = new BlocklyProjectImpl();
try {
Iterator it = new TestType().moveData(writableDatabase, "select * from BlocklyProject", BlocklyProject.class.getName()).iterator();
while (it.hasNext()) {
SqliteHelper.getInstance().init(blocklyProjectImpl).insert((BlocklyProject) it.next());
}
writableDatabase.execSQL("drop table BlocklyProject");
} catch (Exception e2) {
e2.printStackTrace();
}
ConfigItemImpl configItemImpl = new ConfigItemImpl();
try {
Iterator it2 = new TestType().moveData(writableDatabase, "select * from ConfigItem", ConfigItem.class.getName()).iterator();
while (it2.hasNext()) {
SqliteHelper.getInstance().init(configItemImpl).insert((ConfigItem) it2.next());
}
writableDatabase.execSQL("drop table ConfigItem");
} catch (Exception e3) {
e3.printStackTrace();
}
JimuMotionImpl jimuMotionImpl = new JimuMotionImpl();
try {
Iterator it3 = new TestType().moveData(writableDatabase, "select * from JimuMotion ", JimuMotion.class.getName()).iterator();
while (it3.hasNext()) {
SqliteHelper.getInstance().init(jimuMotionImpl).insert((JimuMotion) it3.next());
}
writableDatabase.execSQL("drop table JimuMotion");
} catch (Exception e4) {
e4.printStackTrace();
}
TransportFileImpl transportFileImpl = new TransportFileImpl();
try {
long j = 1;
for (TransportFile transportFile : new TestType().moveData(writableDatabase, "select * from syncFile ", TransportFile.class.getName())) {
transportFile.setCustomFileId(Long.valueOf(j));
SqliteHelper.getInstance().init(transportFileImpl).insert(transportFile);
j++;
}
writableDatabase.execSQL("drop table syncFile");
} catch (Exception e5) {
e5.printStackTrace();
}
writableDatabase.close();
}
}

View File

@@ -0,0 +1,77 @@
package com.ubt.jimu.base.db.proxy.data;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import com.tencent.open.SocialConstants;
import com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter;
import com.ubt.jimu.base.db.diy.DiyDBModel;
import com.ubt.jimu.base.db.diy.DiyHelper;
import com.ubt.jimu.diy.DiyRobotDbHandler;
import com.ubt.jimu.unity.bluetooth.UnityActivity;
import com.unity3d.ads.metadata.MediationMetaData;
import java.io.File;
import java.lang.reflect.Field;
import java.util.ArrayList;
/* loaded from: classes.dex */
public class TestType<T> {
private static TestType tt;
public static TestType isCreate() {
if (tt == null) {
tt = new TestType();
}
return tt;
}
public ArrayList<T> moveData(SQLiteDatabase sQLiteDatabase, String str, String str2) throws Exception {
AbstractReflectionConverter.ArraysList arraysList = (ArrayList<T>) new ArrayList();
Cursor rawQuery = sQLiteDatabase.rawQuery(str, null);
while (rawQuery.moveToNext()) {
Class<?> cls = Class.forName(str2);
Field[] declaredFields = cls.getDeclaredFields();
Object newInstance = cls.newInstance();
for (int i = 0; i < declaredFields.length; i++) {
declaredFields[i].setAccessible(true);
if (declaredFields[i].getGenericType().equals(String.class)) {
declaredFields[i].set(newInstance, rawQuery.getColumnIndex(declaredFields[i].getName()) != -1 ? rawQuery.getString(rawQuery.getColumnIndex(declaredFields[i].getName())) : null);
} else if (declaredFields[i].getGenericType().equals(Integer.class)) {
declaredFields[i].set(newInstance, Integer.valueOf(rawQuery.getColumnIndex(declaredFields[i].getName()) != -1 ? rawQuery.getInt(rawQuery.getColumnIndex(declaredFields[i].getName())) : -10));
} else if (declaredFields[i].getGenericType().equals(Long.class)) {
declaredFields[i].set(newInstance, Long.valueOf(rawQuery.getColumnIndex(declaredFields[i].getName()) != -1 ? rawQuery.getLong(rawQuery.getColumnIndex(declaredFields[i].getName())) : -10L));
} else if (declaredFields[i].getGenericType().equals(Boolean.class)) {
declaredFields[i].set(newInstance, Boolean.valueOf(rawQuery.getColumnIndex(declaredFields[i].getName()) != -1 && rawQuery.getLong(rawQuery.getColumnIndex(declaredFields[i].getName())) == 1));
} else if (declaredFields[i].getGenericType().equals(Double.class)) {
declaredFields[i].set(newInstance, Double.valueOf(rawQuery.getColumnIndex(declaredFields[i].getName()) != -1 ? rawQuery.getDouble(rawQuery.getColumnIndex(declaredFields[i].getName())) : 0.0d));
}
}
arraysList.add(newInstance);
}
return arraysList;
}
public void moveDiyData(Cursor cursor) {
while (cursor.moveToNext()) {
DiyDBModel diyDBModel = new DiyDBModel();
diyDBModel.setCustomModelId(cursor.getString(cursor.getColumnIndex("customModelId")));
diyDBModel.setModelName(cursor.getString(cursor.getColumnIndex(UnityActivity.pModelName)));
diyDBModel.setCustomModelCategory(cursor.getInt(cursor.getColumnIndex("customModelCategory")));
diyDBModel.setModifyTime(cursor.getInt(cursor.getColumnIndex("modifyTime")));
boolean z = false;
diyDBModel.setModify(Boolean.valueOf(cursor.getInt(cursor.getColumnIndex("isModify")) == 1));
diyDBModel.setModelId(Integer.valueOf(cursor.getInt(cursor.getColumnIndex("modelId"))));
if (cursor.getInt(cursor.getColumnIndex("useable")) == 1) {
z = true;
}
diyDBModel.setUseable(z);
diyDBModel.setVersion(cursor.getString(cursor.getColumnIndex(MediationMetaData.KEY_VERSION)));
diyDBModel.setDescription(cursor.getString(cursor.getColumnIndex(SocialConstants.PARAM_COMMENT)));
diyDBModel.setModelCreatedId(cursor.getString(cursor.getColumnIndex("modelCreatedId")));
diyDBModel.setCompressImagePath(cursor.getString(cursor.getColumnIndex("compressImagePath")));
diyDBModel.setFilePath(DiyRobotDbHandler.getCustomModelPath(cursor.getString(cursor.getColumnIndex("modelCreatedId"))) + diyDBModel.getCustomModelId() + File.separator + diyDBModel.getCustomModelId() + ".jpg");
diyDBModel.setUploadState(Integer.valueOf(cursor.getInt(cursor.getColumnIndex("uploadState"))));
diyDBModel.setStep1state(1);
DiyHelper.getInstance().insertData(diyDBModel);
}
}
}

View File

@@ -0,0 +1,36 @@
package com.ubt.jimu.base.db.robot;
import com.ubt.jimu.base.db.AbstractDaoHandler;
import com.ubt.jimu.base.db.DatabaseUtils;
import com.ubt.jimu.base.entities.FirmwareVersion;
import com.ubt.jimu.gen.FirmwareVersionDao;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.query.QueryBuilder;
import org.greenrobot.greendao.query.WhereCondition;
/* loaded from: classes.dex */
public class FirmwareVersionDbHandler extends AbstractDaoHandler<FirmwareVersion> {
private static FirmwareVersionDbHandler instance;
public FirmwareVersionDbHandler(AbstractDao<FirmwareVersion, Long> abstractDao) {
super(abstractDao);
}
public static synchronized FirmwareVersionDbHandler getInstance() {
FirmwareVersionDbHandler firmwareVersionDbHandler;
synchronized (FirmwareVersionDbHandler.class) {
if (instance == null) {
instance = new FirmwareVersionDbHandler(DatabaseUtils.getDaoSession(true).k());
}
firmwareVersionDbHandler = instance;
}
return firmwareVersionDbHandler;
}
@Override // com.ubt.jimu.base.db.AbstractDaoHandler, com.ubt.jimu.base.db.IDaoHandler
public FirmwareVersion selectUnique(FirmwareVersion firmwareVersion) {
QueryBuilder<FirmwareVersion> queryBuilder = getQueryBuilder();
queryBuilder.a(FirmwareVersionDao.Properties.VersionType.a(firmwareVersion.getVersionType()), new WhereCondition[0]);
return queryBuilder.c();
}
}

View File

@@ -0,0 +1,95 @@
package com.ubt.jimu.base.db.robot;
import android.text.TextUtils;
import com.ubt.jimu.base.db.DatabaseUtils;
import com.ubt.jimu.base.entities.Package;
import com.ubt.jimu.gen.PackageDao;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.greenrobot.greendao.query.QueryBuilder;
/* loaded from: classes.dex */
public class PackageDbHandler {
public static List<Package> findByEan(String str) {
List<Package> b = DatabaseUtils.getDaoSession(false).q().k().b();
if (b == null || b.size() <= 0) {
return null;
}
ArrayList arrayList = new ArrayList();
Iterator<Package> it = b.iterator();
while (true) {
if (!it.hasNext()) {
break;
}
Package next = it.next();
if (matchWords(str, next.getEAN())) {
arrayList.add(next);
break;
}
}
return arrayList;
}
public static List<Package> findByUpc(String str) {
List<Package> b = DatabaseUtils.getDaoSession(false).q().k().b();
if (b == null || b.size() <= 0) {
return null;
}
ArrayList arrayList = new ArrayList();
Iterator<Package> it = b.iterator();
while (true) {
if (!it.hasNext()) {
break;
}
Package next = it.next();
if (matchWords(str, next.getUPC())) {
arrayList.add(next);
break;
}
}
return arrayList;
}
public static List<Package> getPackageList() {
QueryBuilder<Package> k = DatabaseUtils.getDaoSession(false).q().k();
k.a(PackageDao.Properties.DisplayOrder);
return k.b();
}
private static boolean matchWords(String str, String str2) {
if (!TextUtils.isEmpty(str2)) {
for (String str3 : str2.split(",")) {
if (str.equals(str3.trim())) {
return true;
}
}
}
return false;
}
public static void saveOrUpdate(List<Package> list) {
try {
DatabaseUtils.getDaoSession(true).q().c((Iterable) list);
} catch (Exception e) {
e.printStackTrace();
}
}
public static Package selectById(long j) {
try {
return DatabaseUtils.getDaoSession(true).q().a(j);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
public static void saveOrUpdate(Package r1) {
try {
DatabaseUtils.getDaoSession(true).q().j(r1);
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@@ -0,0 +1,29 @@
package com.ubt.jimu.base.db.robot;
import com.ubt.jimu.base.db.AbstractDaoHandler;
import com.ubt.jimu.base.db.DatabaseUtils;
import com.ubt.jimu.base.entities.PartFileInfo;
import java.util.List;
import org.greenrobot.greendao.AbstractDao;
/* loaded from: classes.dex */
public class PartFileInfoDbHandler extends AbstractDaoHandler<PartFileInfo> {
public PartFileInfoDbHandler(AbstractDao<PartFileInfo, Long> abstractDao) {
super(abstractDao);
}
public static boolean insertOrUpdate(List<PartFileInfo> list) {
try {
new PartFileInfoDbHandler(DatabaseUtils.getDaoSession(true).r()).insertOrUpdateInTx(list);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
@Override // com.ubt.jimu.base.db.AbstractDaoHandler, com.ubt.jimu.base.db.IDaoHandler
public PartFileInfo selectUnique(PartFileInfo partFileInfo) {
return selectById(partFileInfo.getId());
}
}

View File

@@ -0,0 +1,98 @@
package com.ubt.jimu.base.db.robot;
import com.ubt.jimu.base.db.AbstractDaoHandler;
import com.ubt.jimu.base.db.DatabaseUtils;
import com.ubt.jimu.base.entities.Robot;
import com.ubt.jimu.gen.RobotDao;
import java.util.Iterator;
import java.util.List;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.query.QueryBuilder;
import org.greenrobot.greendao.query.WhereCondition;
/* loaded from: classes.dex */
public class RobotDbHandler extends AbstractDaoHandler<Robot> {
private static RobotDbHandler instance;
public RobotDbHandler(AbstractDao<Robot, Long> abstractDao) {
super(abstractDao);
}
public static synchronized RobotDbHandler getInstance() {
RobotDbHandler robotDbHandler;
synchronized (RobotDbHandler.class) {
if (instance == null) {
instance = new RobotDbHandler(DatabaseUtils.getDaoSession(true).s());
}
robotDbHandler = instance;
}
return robotDbHandler;
}
public static Robot getRobotById(long j) {
QueryBuilder<Robot> k = DatabaseUtils.getDaoSession(true).s().k();
k.a(RobotDao.Properties.ModelId.a(Long.valueOf(j)), new WhereCondition[0]);
return k.c();
}
public static Robot getRobotByModelName(String str) {
QueryBuilder<Robot> k = DatabaseUtils.getDaoSession(true).s().k();
k.a(RobotDao.Properties.ModelName.a((Object) str), new WhereCondition[0]);
return k.c();
}
public static List<Robot> getRobotList(long j) {
try {
return DatabaseUtils.getDaoSession(true).q().h(Long.valueOf(j)).getRobotList();
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
public static void saveOrUpdate(List<Robot> list) {
try {
RobotDao s = DatabaseUtils.getDaoSession(true).s();
List<Robot> j = s.j();
if (j == null || j.size() == 0) {
s.c((Iterable) list);
}
for (Robot robot : list) {
Iterator<Robot> it = j.iterator();
while (true) {
if (it.hasNext()) {
Robot next = it.next();
if (robot.getModelId() == next.getModelId()) {
robot.setDownload(next.getDownload() && robot.getModelUpdateTime() == next.getModelUpdateTime());
}
}
}
}
s.c((Iterable) list);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void setRobotDownloadState(Robot robot) {
RobotDao s = DatabaseUtils.getDaoSession(true).s();
QueryBuilder<Robot> k = s.k();
k.a(RobotDao.Properties.ModelName.a((Object) robot.getModelName()), new WhereCondition[0]);
List<Robot> b = k.b();
if (b == null || b.size() <= 0) {
return;
}
Iterator<Robot> it = b.iterator();
while (it.hasNext()) {
it.next().setDownload(robot.getDownload());
}
s.d((Iterable) b);
}
@Override // com.ubt.jimu.base.db.AbstractDaoHandler, com.ubt.jimu.base.db.IDaoHandler
public Robot selectUnique(Robot robot) {
QueryBuilder k = this.dao.k();
k.a(RobotDao.Properties.ModelId.a(Long.valueOf(robot.getModelId())), new WhereCondition[0]);
return (Robot) k.c();
}
}

View File

@@ -0,0 +1,16 @@
package com.ubt.jimu.base.db.robot;
import com.ubt.jimu.base.db.DatabaseUtils;
import com.ubt.jimu.base.entities.RobotPackage;
import java.util.List;
/* loaded from: classes.dex */
public class RobotPackageDbHandler {
public static void saveOrUpdate(List<RobotPackage> list) {
try {
DatabaseUtils.getDaoSession(false).t().c((Iterable) list);
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@@ -0,0 +1,81 @@
package com.ubt.jimu.base.db.starcourse;
import com.ubt.jimu.JimuApplication;
import com.ubt.jimu.base.db.DatabaseUtils;
import com.ubt.jimu.base.entities.Constant;
import com.ubt.jimu.base.entities.Course;
import com.ubt.jimu.gen.CourseDao;
import com.ubt.jimu.utils.LogUtils;
import com.ubt.jimu.utils.SPUtils;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.greenrobot.greendao.query.QueryBuilder;
/* loaded from: classes.dex */
public class CourseDbHandler {
public static List<Course> getNewCourseList() {
ArrayList arrayList = new ArrayList();
CourseDao c = DatabaseUtils.getDaoSession(true).c();
String g = JimuApplication.l().g();
QueryBuilder<Course> k = c.k();
k.a(CourseDao.Properties.Lan.a((Object) g), CourseDao.Properties.StoryName.a((Object) Constant.SelectRobot.ASTROBOT_MINI));
List<Course> b = k.b();
arrayList.addAll(b);
LogUtils.c("tList.getNewCourseList" + b.size());
return arrayList;
}
public static List<Course> getOldCourseList() {
ArrayList arrayList = new ArrayList();
CourseDao c = DatabaseUtils.getDaoSession(true).c();
String g = JimuApplication.l().g();
QueryBuilder<Course> k = c.k();
k.a(CourseDao.Properties.Lan.a((Object) g), CourseDao.Properties.StoryName.a((Object) "AstroBot"));
arrayList.addAll(k.b());
return arrayList;
}
public static void saveList(List<Course> list) {
if (list == null || list.size() == 0) {
return;
}
CourseDao c = DatabaseUtils.getDaoSession(true).c();
String g = JimuApplication.l().g();
Iterator<Course> it = list.iterator();
while (it.hasNext()) {
it.next().setLan(g);
}
c.c((Iterable) list);
}
public static void setCourseComplete(Course course) {
if (course == null) {
return;
}
CourseDao c = DatabaseUtils.getDaoSession(true).c();
String g = JimuApplication.l().g();
course.setLan(g);
course.setStatus(Course.STATUS_COMPLETED);
c.j(course);
String b = SPUtils.b(Constant.SelectRobot.INTERSTELLAR_ADVENTURE_SELECT_PACKAGE_KEY);
List<Course> oldCourseList = (Constant.SelectRobot.INTERSTELLAR_ADVENTURE_OLD_PACKAGE_CN.equals(b) || Constant.SelectRobot.INTERSTELLAR_ADVENTURE_OLD_PACKAGE_NA.equals(b) || Constant.SelectRobot.INTERSTELLAR_ADVENTURE_OLD_PACKAGE_GLOBAL.equals(b)) ? getOldCourseList() : getNewCourseList();
Course course2 = null;
boolean z = false;
for (int i = 0; i < oldCourseList.size(); i++) {
Course course3 = oldCourseList.get(i);
if (course3.getNameKey().equals(course.getNextCourse())) {
course2 = course3;
}
if (course3.getStatus().equals(Course.STATUS_RUNNING)) {
z = true;
}
}
if (z || course2 == null) {
return;
}
course2.setStatus(Course.STATUS_RUNNING);
course2.setLan(g);
c.b((Object[]) new Course[]{course2});
}
}

View File

@@ -0,0 +1,41 @@
package com.ubt.jimu.base.db.starcourse;
import com.ubt.jimu.JimuApplication;
import com.ubt.jimu.base.db.DatabaseUtils;
import com.ubt.jimu.base.entities.Story;
import com.ubt.jimu.gen.StoryDao;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.greenrobot.greendao.query.QueryBuilder;
import org.greenrobot.greendao.query.WhereCondition;
/* loaded from: classes.dex */
public class StoryDbHandler {
public static List<Story> getStoryList() {
ArrayList arrayList = new ArrayList();
try {
String g = JimuApplication.l().g();
QueryBuilder<Story> k = DatabaseUtils.getDaoSession(true).u().k();
k.a(StoryDao.Properties.Lan.a((Object) g), new WhereCondition[0]);
arrayList.addAll(k.b());
return arrayList;
} catch (Exception e) {
e.printStackTrace();
return arrayList;
}
}
public static void save(List<Story> list) {
if (list == null || list.size() == 0) {
return;
}
String g = JimuApplication.l().g();
StoryDao u = DatabaseUtils.getDaoSession(true).u();
Iterator<Story> it = list.iterator();
while (it.hasNext()) {
it.next().setLan(g);
}
u.c((Iterable) list);
}
}

View File

@@ -0,0 +1,77 @@
package com.ubt.jimu.base.db.user;
import com.ubt.jimu.base.cache.Cache;
import com.ubt.jimu.base.db.DatabaseUtils;
import com.ubt.jimu.base.entities.User;
import com.ubt.jimu.gen.UserDao;
import com.ubtrobot.ubtlib.analytics.JimuAnalytics;
import java.util.List;
import org.greenrobot.greendao.query.QueryBuilder;
import org.greenrobot.greendao.query.WhereCondition;
/* loaded from: classes.dex */
public class UserDbHandler {
public static void clearUser() {
JimuAnalytics.b().a("0", "google_play");
try {
DatabaseUtils.getDaoSession(true).w().b();
} catch (Exception e) {
e.printStackTrace();
}
}
public static User getUser() {
try {
List<User> j = DatabaseUtils.getDaoSession(false).w().j();
if (j != null && j.size() != 0) {
return j.get(0);
}
return null;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
public static boolean isLogin() {
User user = getUser();
return user != null && user.getUserId() > 0;
}
public static void save(User user) {
if (user != null) {
JimuAnalytics.b().a(String.valueOf(user.getUserId()), "google_play");
}
try {
DatabaseUtils.getDaoSession(true).w().g(user);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void updateUser(long j) {
}
public static void updateUserInfo(User user) {
try {
DatabaseUtils.getDaoSession(true).w().j(user);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void updateUserToken(String str) {
try {
UserDao w = DatabaseUtils.getDaoSession(false).w();
QueryBuilder<User> k = w.k();
k.a(UserDao.Properties.UserId.a(Long.valueOf(Cache.getInstance().getLoginUserIntId())), new WhereCondition[0]);
User c = k.c();
if (c != null) {
c.setToken(str);
}
w.j(c);
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@@ -0,0 +1,8 @@
package com.ubt.jimu.base.dialog;
/* loaded from: classes.dex */
public interface IDialogListener {
void onCancle();
void onOk();
}

View File

@@ -0,0 +1,349 @@
package com.ubt.jimu.base.dialog;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.drawable.ColorDrawable;
import android.text.TextUtils;
import android.text.method.ScrollingMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.ubt.jimu.Channel;
import com.ubt.jimu.JimuApplication;
import com.ubt.jimu.R;
import com.ubt.jimu.base.cache.Cache;
import com.ubt.jimu.update.UpdateManager;
import com.ubt.jimu.utils.NetWorkUtil;
import com.ubt.jimu.utils.SystemUtils;
import com.ubtech.utils.DisplayUtil;
/* loaded from: classes.dex */
public class JimuSimpleDialog extends Dialog implements View.OnClickListener {
public Button btnCancel;
public Button btnOk;
public String cancel;
public int cancleBtnBg;
public String content;
private ImageView imgLogo;
private OnDismissListener mOnDismissListener;
public String ok;
private DialogInterface.OnClickListener onCancelListener;
private DialogInterface.OnClickListener onOkListener;
private TextView tvDialogTitle;
private TextView tvTips;
public static class Builder {
private String cancel;
private int cancleBtnBg;
private String content;
private Context context;
private String logoUrl;
private String ok;
private DialogInterface.OnClickListener onCancelListener;
private DialogInterface.OnClickListener onOkListener;
private String title;
private int logoResId = 0;
private boolean canceledOnTouchOutside = true;
private int gravity = 17;
public Builder(Context context) {
this.context = context;
}
public JimuSimpleDialog build() {
int i;
double d;
int a;
int a2;
JimuSimpleDialog jimuSimpleDialog = new JimuSimpleDialog(this.context);
jimuSimpleDialog.requestWindowFeature(1);
jimuSimpleDialog.getWindow().setBackgroundDrawable(new ColorDrawable(0));
jimuSimpleDialog.content = this.content;
jimuSimpleDialog.ok = this.ok;
jimuSimpleDialog.cancel = this.cancel;
jimuSimpleDialog.onOkListener = this.onOkListener;
jimuSimpleDialog.onCancelListener = this.onCancelListener;
jimuSimpleDialog.cancleBtnBg = this.cancleBtnBg;
View inflate = LayoutInflater.from(this.context).inflate(R.layout.dialog_jimu_simple, (ViewGroup) null, false);
jimuSimpleDialog.intView(inflate, this);
jimuSimpleDialog.setContentView(inflate);
jimuSimpleDialog.setCanceledOnTouchOutside(this.canceledOnTouchOutside);
Window window = jimuSimpleDialog.getWindow();
WindowManager.LayoutParams attributes = window.getAttributes();
window.setBackgroundDrawableResource(R.color.translucent);
window.setWindowAnimations(R.style.dialogWindowAlphaIn);
int max = Math.max(DisplayUtil.b(JimuApplication.l()), DisplayUtil.a(JimuApplication.l()));
if (JimuApplication.l().i()) {
i = (int) (max * 0.5039d);
d = 0.624d;
} else {
i = (int) (max * 0.5165d);
d = 0.6088d;
}
int i2 = (int) (i * d);
if (JimuApplication.l().i()) {
a = DisplayUtil.a(this.context, 516.0f);
a2 = DisplayUtil.a(this.context, 322.0f);
} else {
a = DisplayUtil.a(this.context, 344.55f);
a2 = DisplayUtil.a(this.context, 209.75f);
}
if (a > i || a2 > i2) {
i = a;
i2 = a2;
}
attributes.width = i;
attributes.height = i2;
attributes.gravity = 17;
window.setAttributes(attributes);
return jimuSimpleDialog;
}
public Builder cancel(String str) {
this.cancel = str;
return this;
}
public Builder canceledOnTouchOutside(boolean z) {
this.canceledOnTouchOutside = z;
return this;
}
public Builder cancleBtnBg(int i) {
this.cancleBtnBg = i;
return this;
}
public Builder content(String str) {
this.content = str;
return this;
}
public Builder gravity(int i) {
this.gravity = i;
return this;
}
public Builder logoResId(int i) {
this.logoResId = i;
return this;
}
public Builder logoUrl(String str) {
this.logoUrl = str;
return this;
}
public Builder ok(String str) {
this.ok = str;
return this;
}
public Builder onCancel(DialogInterface.OnClickListener onClickListener) {
this.onCancelListener = onClickListener;
return this;
}
public Builder onOk(DialogInterface.OnClickListener onClickListener) {
this.onOkListener = onClickListener;
return this;
}
public Builder title(String str) {
this.title = str;
return this;
}
public Builder cancel(int i) {
this.cancel = this.context.getString(i);
return this;
}
public Builder content(int i) {
this.content = this.context.getString(i);
return this;
}
public Builder ok(int i) {
this.ok = this.context.getString(i);
return this;
}
public Builder title(int i) {
this.title = this.context.getString(i);
return this;
}
}
public interface OnDismissListener {
void onDismiss(Dialog dialog);
}
public JimuSimpleDialog(Context context) {
super(context);
}
public static JimuSimpleDialog buildSimpleDialog(Activity activity, String str, String str2, String str3, String str4, int i, DialogInterface.OnClickListener onClickListener, DialogInterface.OnClickListener onClickListener2) {
return new Builder(activity).title(str3).cancel(str2).ok(str).content(str4).gravity(i).onCancel(onClickListener).onOk(onClickListener2).build();
}
public static boolean shouldShowWifiOnlyDialog(Context context) {
return NetWorkUtil.a(context) == NetWorkUtil.NetworkType.MOBILE && Cache.getInstance().isWifiOnly() && !Cache.getInstance().isShowMobileDataTips();
}
public static boolean showWifiOnlyDialog(Context context, final DialogInterface.OnClickListener onClickListener, final DialogInterface.OnClickListener onClickListener2, boolean z) {
if (context != null && !z && shouldShowWifiOnlyDialog(context)) {
new Builder(context).title(R.string.mobile_data_tips).cancel(R.string.cancel).ok(R.string.key_continue).content(R.string.tips_using_mobile_data).onCancel(new DialogInterface.OnClickListener() { // from class: com.ubt.jimu.base.dialog.JimuSimpleDialog.4
@Override // android.content.DialogInterface.OnClickListener
public void onClick(DialogInterface dialogInterface, int i) {
DialogInterface.OnClickListener onClickListener3 = onClickListener;
if (onClickListener3 != null) {
onClickListener3.onClick(dialogInterface, i);
}
dialogInterface.dismiss();
}
}).onOk(new DialogInterface.OnClickListener() { // from class: com.ubt.jimu.base.dialog.JimuSimpleDialog.3
@Override // android.content.DialogInterface.OnClickListener
public void onClick(DialogInterface dialogInterface, int i) {
DialogInterface.OnClickListener onClickListener3 = onClickListener2;
if (onClickListener3 != null) {
onClickListener3.onClick(dialogInterface, i);
Cache.getInstance().setShowMobileDataTips(true);
}
dialogInterface.dismiss();
}
}).build().show();
return true;
}
if (onClickListener2 == null) {
return false;
}
onClickListener2.onClick(null, -1);
return false;
}
public static Dialog versionUpdateDialog(final Activity activity, boolean z, String str) {
Builder builder = new Builder(activity);
builder.title(R.string.update_title).ok(R.string.update_sure).content(str).gravity(3).onOk(new DialogInterface.OnClickListener() { // from class: com.ubt.jimu.base.dialog.JimuSimpleDialog.1
@Override // android.content.DialogInterface.OnClickListener
public void onClick(DialogInterface dialogInterface, int i) {
if (Channel.GOOGLE_PLAY.getChannelName().equals("google_play")) {
SystemUtils.a(activity);
dialogInterface.dismiss();
} else {
UpdateManager.c().a(activity);
dialogInterface.dismiss();
}
}
}).build();
if (!z) {
builder.cancel(R.string.cancel).canceledOnTouchOutside(true).onCancel(new DialogInterface.OnClickListener() { // from class: com.ubt.jimu.base.dialog.JimuSimpleDialog.2
@Override // android.content.DialogInterface.OnClickListener
public void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
}
});
}
return builder.build();
}
@Override // android.app.Dialog, android.content.DialogInterface
public void dismiss() {
super.dismiss();
OnDismissListener onDismissListener = this.mOnDismissListener;
if (onDismissListener != null) {
onDismissListener.onDismiss(this);
}
}
public void intView(View view, Builder builder) {
this.tvDialogTitle = (TextView) view.findViewById(R.id.tvDialogTitle);
this.tvTips = (TextView) view.findViewById(R.id.tvTips);
this.imgLogo = (ImageView) view.findViewById(R.id.imgLogo);
this.btnCancel = (Button) view.findViewById(R.id.btnCancel);
this.btnOk = (Button) view.findViewById(R.id.btnOk);
this.btnCancel.setOnClickListener(this);
this.btnOk.setOnClickListener(this);
if (!TextUtils.isEmpty(this.content)) {
this.tvTips.setText(this.content);
this.tvTips.setMovementMethod(ScrollingMovementMethod.getInstance());
}
if (this.onCancelListener == null) {
this.btnCancel.setVisibility(8);
}
if (this.onOkListener == null) {
this.btnOk.setVisibility(8);
}
if (!TextUtils.isEmpty(this.ok)) {
this.btnOk.setText(this.ok);
}
if (!TextUtils.isEmpty(this.cancel)) {
this.btnCancel.setText(this.cancel);
}
if (TextUtils.isEmpty(builder.title)) {
this.tvDialogTitle.setVisibility(8);
} else {
this.tvDialogTitle.setVisibility(0);
this.tvDialogTitle.setText(builder.title);
}
if (!TextUtils.isEmpty(builder.logoUrl)) {
Glide.e(getContext()).a(builder.logoUrl).a(this.imgLogo);
} else if (builder.logoResId != 0) {
this.imgLogo.setImageResource(builder.logoResId);
} else {
this.imgLogo.setVisibility(8);
}
if (17 != builder.gravity) {
this.tvTips.setGravity(builder.gravity);
}
int i = this.cancleBtnBg;
if (i != 0) {
this.btnCancel.setBackgroundResource(i);
}
}
@Override // android.view.View.OnClickListener
public void onClick(View view) {
int id = view.getId();
if (id == R.id.btnCancel) {
DialogInterface.OnClickListener onClickListener = this.onCancelListener;
if (onClickListener != null) {
onClickListener.onClick(this, 0);
return;
} else {
dismiss();
return;
}
}
if (id != R.id.btnOk) {
dismiss();
return;
}
DialogInterface.OnClickListener onClickListener2 = this.onOkListener;
if (onClickListener2 != null) {
onClickListener2.onClick(this, 0);
} else {
dismiss();
}
}
public void setOnDismissListener(OnDismissListener onDismissListener) {
this.mOnDismissListener = onDismissListener;
}
public JimuSimpleDialog(Context context, int i) {
super(context, i);
}
protected JimuSimpleDialog(Context context, boolean z, DialogInterface.OnCancelListener onCancelListener) {
super(context, z, onCancelListener);
}
}

View File

@@ -0,0 +1,259 @@
package com.ubt.jimu.base.dialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.drawable.ColorDrawable;
import android.text.SpannableStringBuilder;
import android.text.TextPaint;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.text.style.TextAppearanceSpan;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.TextView;
import com.alibaba.android.arouter.facade.Postcard;
import com.alibaba.android.arouter.launcher.ARouter;
import com.ubt.jimu.JimuApplication;
import com.ubt.jimu.R;
import com.ubt.jimu.base.dialog.LegalExamineDialog;
import com.ubt.jimu.base.entities.Constant;
import com.ubt.jimu.utils.LocaleUtils;
import com.ubt.jimu.utils.SPUtils;
import com.ubtech.utils.DisplayUtil;
/* loaded from: classes.dex */
public class LegalExamineDialog extends Dialog implements View.OnClickListener {
public Button btnCancel;
public Button btnOk;
public String cancel;
private CheckBox checkBox;
public String content;
private TextView contentTv;
private Context context;
private LegalResult legalResult;
public String ok;
private TextView tipTv;
public static class Builder {
private Context context;
private LegalResult legalResult;
public Builder(Context context) {
this.context = context;
}
static /* synthetic */ boolean a(DialogInterface dialogInterface, int i, KeyEvent keyEvent) {
return i == 4;
}
public LegalExamineDialog build() {
int a;
int a2;
LegalExamineDialog legalExamineDialog = new LegalExamineDialog(this.context);
legalExamineDialog.setOnKeyListener(new DialogInterface.OnKeyListener() { // from class: com.ubt.jimu.base.dialog.a
@Override // android.content.DialogInterface.OnKeyListener
public final boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) {
return LegalExamineDialog.Builder.a(dialogInterface, i, keyEvent);
}
});
legalExamineDialog.context = this.context;
legalExamineDialog.legalResult = this.legalResult;
legalExamineDialog.requestWindowFeature(1);
legalExamineDialog.getWindow().setBackgroundDrawable(new ColorDrawable(0));
View inflate = LayoutInflater.from(this.context).inflate(R.layout.dialog_jimu_legal_examine, (ViewGroup) null, false);
legalExamineDialog.intView(inflate, this);
legalExamineDialog.setContentView(inflate);
legalExamineDialog.setCanceledOnTouchOutside(false);
Window window = legalExamineDialog.getWindow();
WindowManager.LayoutParams attributes = window.getAttributes();
window.setBackgroundDrawableResource(R.color.translucent);
window.setWindowAnimations(R.style.dialogWindowAlphaIn);
int max = (int) (Math.max(DisplayUtil.b(JimuApplication.l()), DisplayUtil.a(JimuApplication.l())) * 0.712d);
int i = (int) (max * 0.657d);
if (JimuApplication.l().i()) {
a = DisplayUtil.a(this.context, 516.0f);
a2 = DisplayUtil.a(this.context, 322.0f);
} else {
a = DisplayUtil.a(this.context, 344.55f);
a2 = DisplayUtil.a(this.context, 209.75f);
}
if (a > max || a2 > i) {
max = a;
}
attributes.width = max;
attributes.gravity = 17;
window.setAttributes(attributes);
return legalExamineDialog;
}
public Builder onLegalResult(LegalResult legalResult) {
this.legalResult = legalResult;
return this;
}
}
public interface LegalResult {
void pass();
void reject();
}
public LegalExamineDialog(Context context) {
super(context);
}
private SpannableStringBuilder buildChildPrivacy(final Context context, int i) {
String string = context.getResources().getString(R.string.child_privaty_policy_with_punctuation);
SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(string);
spannableStringBuilder.setSpan(new TextAppearanceSpan(context, i), 0, string.length(), 33);
spannableStringBuilder.setSpan(new ClickableSpan() { // from class: com.ubt.jimu.base.dialog.LegalExamineDialog.4
@Override // android.text.style.ClickableSpan
public void onClick(View view) {
Postcard a = ARouter.b().a("/page/web");
a.a("url", "file:////android_asset/privacy/jimuChildren.html?language=" + LocaleUtils.c());
a.a("title", "");
a.a("type", 0);
a.a("show_title", false);
a.t();
}
@Override // android.text.style.ClickableSpan, android.text.style.CharacterStyle
public void updateDrawState(TextPaint textPaint) {
super.updateDrawState(textPaint);
textPaint.setColor(context.getResources().getColor(R.color.bg_4AACF5));
textPaint.bgColor = context.getResources().getColor(R.color.translucent);
textPaint.setUnderlineText(false);
}
}, 0, string.length(), 33);
return spannableStringBuilder;
}
private SpannableStringBuilder buildUserProtocol(final Context context, int i) {
String string = context.getResources().getString(R.string.common_gdpr_content_02);
SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(string);
spannableStringBuilder.setSpan(new TextAppearanceSpan(context, i), 0, string.length(), 33);
spannableStringBuilder.setSpan(new ClickableSpan() { // from class: com.ubt.jimu.base.dialog.LegalExamineDialog.3
@Override // android.text.style.ClickableSpan
public void onClick(View view) {
Postcard a = ARouter.b().a("/page/web");
a.a("url", "file:////android_asset/user/index.html?language=" + LocaleUtils.c());
a.a("title", "");
a.a("type", 0);
a.a("show_title", false);
a.t();
}
@Override // android.text.style.ClickableSpan, android.text.style.CharacterStyle
public void updateDrawState(TextPaint textPaint) {
super.updateDrawState(textPaint);
textPaint.setColor(context.getResources().getColor(R.color.bg_4AACF5));
textPaint.bgColor = context.getResources().getColor(R.color.translucent);
textPaint.setUnderlineText(false);
}
}, 0, string.length(), 33);
return spannableStringBuilder;
}
private SpannableStringBuilder buildprivacy(final Context context, int i) {
String string = context.getResources().getString(R.string.common_gdpr_content_04);
SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(string);
spannableStringBuilder.setSpan(new TextAppearanceSpan(context, i), 0, string.length(), 33);
spannableStringBuilder.setSpan(new ClickableSpan() { // from class: com.ubt.jimu.base.dialog.LegalExamineDialog.2
@Override // android.text.style.ClickableSpan
public void onClick(View view) {
Postcard a = ARouter.b().a("/page/web");
a.a("url", "file:////android_asset/privacy/index.html?language=" + LocaleUtils.c());
a.a("title", "");
a.a("type", 0);
a.a("show_title", false);
a.t();
}
@Override // android.text.style.ClickableSpan, android.text.style.CharacterStyle
public void updateDrawState(TextPaint textPaint) {
super.updateDrawState(textPaint);
textPaint.setColor(context.getResources().getColor(R.color.bg_4AACF5));
textPaint.bgColor = context.getResources().getColor(R.color.translucent);
textPaint.setUnderlineText(false);
}
}, 0, string.length(), 33);
return spannableStringBuilder;
}
@Override // android.app.Dialog, android.content.DialogInterface
public void dismiss() {
super.dismiss();
}
public void intView(View view, Builder builder) {
this.contentTv = (TextView) view.findViewById(R.id.content);
this.tipTv = (TextView) view.findViewById(R.id.tips);
this.btnCancel = (Button) view.findViewById(R.id.btnCancel);
this.btnOk = (Button) view.findViewById(R.id.btnOk);
this.checkBox = (CheckBox) view.findViewById(R.id.checkbox_agree);
this.btnCancel.setOnClickListener(this);
this.btnOk.setOnClickListener(this);
this.contentTv.setMovementMethod(new LinkMovementMethod());
this.contentTv.append(this.context.getResources().getString(R.string.common_gdpr_content_01));
this.contentTv.append(buildUserProtocol(this.context, R.style.JSpecilTextAppearance));
this.contentTv.append(this.context.getResources().getString(R.string.comma));
this.contentTv.append(buildprivacy(this.context, R.style.JSpecilTextAppearance));
this.contentTv.append(this.context.getResources().getString(R.string.common_gdpr_content_03));
this.contentTv.append(buildChildPrivacy(this.context, R.style.JSpecilTextAppearance));
this.contentTv.append(this.context.getResources().getString(R.string.common_gdpr_content_05));
this.tipTv.setMovementMethod(new LinkMovementMethod());
this.tipTv.append(this.context.getString(R.string.common_gdpr_tip_01));
this.tipTv.append(buildUserProtocol(this.context, R.style.JSpecilTextAppearanceSmall));
this.tipTv.append(this.context.getResources().getString(R.string.comma));
this.tipTv.append(buildprivacy(this.context, R.style.JSpecilTextAppearanceSmall));
this.tipTv.append(this.context.getResources().getString(R.string.common_gdpr_tip_02));
this.tipTv.append(buildChildPrivacy(this.context, R.style.JSpecilTextAppearanceSmall));
this.tipTv.append(this.context.getString(R.string.common_gdpr_tip_03));
this.btnOk.setText(this.context.getResources().getString(R.string.dialog_legal_agree));
this.btnCancel.setText(this.context.getString(R.string.dialog_legal_reject));
this.btnCancel.setBackgroundResource(R.drawable.sel_common_negative_btn);
this.btnOk.setEnabled(false);
this.btnOk.setAlpha(0.5f);
this.checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { // from class: com.ubt.jimu.base.dialog.LegalExamineDialog.1
@Override // android.widget.CompoundButton.OnCheckedChangeListener
public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
if (z) {
LegalExamineDialog.this.btnOk.setEnabled(true);
LegalExamineDialog.this.btnOk.setAlpha(1.0f);
} else {
LegalExamineDialog.this.btnOk.setEnabled(false);
LegalExamineDialog.this.btnOk.setAlpha(0.5f);
}
}
});
}
@Override // android.view.View.OnClickListener
public void onClick(View view) {
int id = view.getId();
if (id == R.id.btnCancel) {
this.legalResult.reject();
} else if (id != R.id.btnOk) {
dismiss();
} else {
SPUtils.a(Constant.NoviceGuide.AGREE_LEGAL_EXAMINE, true);
this.legalResult.pass();
}
}
public LegalExamineDialog(Context context, int i) {
super(context, i);
}
protected LegalExamineDialog(Context context, boolean z, DialogInterface.OnCancelListener onCancelListener) {
super(context, z, onCancelListener);
}
}

View File

@@ -0,0 +1,95 @@
package com.ubt.jimu.base.dialog;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.animation.LinearInterpolator;
import android.view.animation.RotateAnimation;
import android.widget.ImageView;
import android.widget.TextView;
import com.ubt.jimu.R;
/* loaded from: classes.dex */
public class LoadingDialog extends Dialog {
private ImageView imgLoading;
private Activity mActivity;
private RotateAnimation rotateAnimation;
private TextView tvProgress;
public LoadingDialog(Context context) {
this(context, 0);
}
private void initView() {
this.tvProgress = (TextView) findViewById(R.id.tvProgress);
this.imgLoading = (ImageView) findViewById(R.id.imgLoading);
}
private void startAnimation() {
RotateAnimation rotateAnimation = this.rotateAnimation;
if (rotateAnimation != null) {
rotateAnimation.cancel();
this.imgLoading.clearAnimation();
}
this.rotateAnimation = new RotateAnimation(0.0f, 359.0f, 1, 0.5f, 1, 0.5f);
this.rotateAnimation.setRepeatCount(-1);
this.rotateAnimation.setDuration(800L);
this.rotateAnimation.setInterpolator(new LinearInterpolator());
this.rotateAnimation.setRepeatMode(1);
this.imgLoading.startAnimation(this.rotateAnimation);
}
@Override // android.app.Dialog, android.content.DialogInterface
public void dismiss() {
RotateAnimation rotateAnimation = this.rotateAnimation;
if (rotateAnimation != null) {
rotateAnimation.cancel();
}
this.rotateAnimation = null;
this.imgLoading.clearAnimation();
Activity activity = this.mActivity;
if (activity == null || activity.isFinishing() || this.mActivity.isDestroyed()) {
return;
}
super.dismiss();
}
@Override // android.app.Dialog
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
getWindow().requestFeature(1);
setContentView(R.layout.dialog_loading);
getWindow().setBackgroundDrawable(new ColorDrawable(0));
getWindow().setLayout(-1, -1);
setCanceledOnTouchOutside(false);
initView();
}
@Override // android.app.Dialog
public void show() {
super.show();
startAnimation();
}
public void updateProgress(String str) {
TextView textView;
if (TextUtils.isEmpty(str) || (textView = this.tvProgress) == null) {
return;
}
textView.setText(str);
}
public LoadingDialog(Context context, boolean z, DialogInterface.OnCancelListener onCancelListener) {
super(context, z, onCancelListener);
this.mActivity = (Activity) context;
}
public LoadingDialog(Context context, int i) {
super(context, i);
this.mActivity = (Activity) context;
}
}

View File

@@ -0,0 +1,181 @@
package com.ubt.jimu.base.dialog;
import android.app.Dialog;
import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.text.method.ScrollingMovementMethod;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import com.ubt.jimu.JimuApplication;
import com.ubt.jimu.R;
import com.ubtech.utils.DisplayUtil;
/* loaded from: classes.dex */
public class LoginCheckCodeDialog extends Dialog {
private Button btnCancel;
private Button btnOk;
private Callback callback;
private Context context;
private String emailText;
private EditText etCaptcha;
private TextView get_emial_verify_code;
private boolean isTablet;
private int loginType;
private String phoneText;
private TextView tvTitle;
public interface Callback {
void onCancel();
void onGetCaptcha();
void onOK(String str);
}
public LoginCheckCodeDialog(Context context) {
super(context, R.style.window_dialog);
this.context = context;
this.isTablet = JimuApplication.l().i();
}
public void disableGetCodeTextView() {
TextView textView = this.get_emial_verify_code;
if (textView != null) {
textView.setClickable(false);
}
}
public void enableGetCodeTextView() {
TextView textView = this.get_emial_verify_code;
if (textView != null) {
textView.setClickable(true);
}
}
public void initView() {
this.tvTitle = (TextView) findViewById(R.id.tv_title);
this.tvTitle.setMovementMethod(ScrollingMovementMethod.getInstance());
this.etCaptcha = (EditText) findViewById(R.id.et_captcha);
this.btnCancel = (Button) findViewById(R.id.btn_cancel);
this.btnCancel.setOnClickListener(new View.OnClickListener() { // from class: com.ubt.jimu.base.dialog.LoginCheckCodeDialog.1
@Override // android.view.View.OnClickListener
public void onClick(View view) {
if (LoginCheckCodeDialog.this.callback != null) {
LoginCheckCodeDialog.this.callback.onCancel();
}
LoginCheckCodeDialog.this.dismiss();
}
});
this.btnOk = (Button) findViewById(R.id.btn_ok);
this.btnOk.setEnabled(false);
this.btnOk.setOnClickListener(new View.OnClickListener() { // from class: com.ubt.jimu.base.dialog.LoginCheckCodeDialog.2
@Override // android.view.View.OnClickListener
public void onClick(View view) {
if (LoginCheckCodeDialog.this.callback != null) {
LoginCheckCodeDialog.this.callback.onOK(LoginCheckCodeDialog.this.etCaptcha.getText().toString().trim());
}
}
});
this.get_emial_verify_code = (TextView) findViewById(R.id.get_emial_verify_code);
this.get_emial_verify_code.setOnClickListener(new View.OnClickListener() { // from class: com.ubt.jimu.base.dialog.LoginCheckCodeDialog.3
@Override // android.view.View.OnClickListener
public void onClick(View view) {
if (LoginCheckCodeDialog.this.callback != null) {
LoginCheckCodeDialog.this.callback.onGetCaptcha();
}
}
});
this.etCaptcha.addTextChangedListener(new TextWatcher() { // from class: com.ubt.jimu.base.dialog.LoginCheckCodeDialog.4
@Override // android.text.TextWatcher
public void afterTextChanged(Editable editable) {
}
@Override // android.text.TextWatcher
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override // android.text.TextWatcher
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
if (TextUtils.isEmpty(charSequence)) {
LoginCheckCodeDialog.this.btnOk.setEnabled(false);
} else {
if (LoginCheckCodeDialog.this.btnOk.isEnabled()) {
return;
}
LoginCheckCodeDialog.this.btnOk.setEnabled(true);
}
}
});
}
@Override // android.app.Dialog
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.dialog_login_check_code);
setUpWindows();
initView();
setCanceledOnTouchOutside(false);
}
public void setCallback(Callback callback) {
this.callback = callback;
}
public void setUpWindows() {
Window window = getWindow();
window.setBackgroundDrawable(new ColorDrawable(0));
WindowManager.LayoutParams attributes = window.getAttributes();
int a = DisplayUtil.a(this.context, this.isTablet ? 400.0f : 352.0f);
int a2 = DisplayUtil.a(this.context, this.isTablet ? 300.0f : 220.0f);
attributes.width = a;
attributes.height = a2;
attributes.gravity = 17;
window.setAttributes(attributes);
}
public void startCountDown() {
TextView textView = this.get_emial_verify_code;
if (textView == null) {
return;
}
textView.setClickable(false);
new CountDownTimer(60000L, 1000L) { // from class: com.ubt.jimu.base.dialog.LoginCheckCodeDialog.5
@Override // android.os.CountDownTimer
public void onFinish() {
LoginCheckCodeDialog.this.get_emial_verify_code.setText(R.string.get_captcha);
LoginCheckCodeDialog.this.get_emial_verify_code.setClickable(true);
}
@Override // android.os.CountDownTimer
public void onTick(long j) {
LoginCheckCodeDialog.this.get_emial_verify_code.setText((j / 1000) + "s");
}
}.start();
}
public LoginCheckCodeDialog(Context context, Callback callback) {
super(context, R.style.window_dialog);
this.context = context;
this.callback = callback;
this.isTablet = JimuApplication.l().i();
}
public LoginCheckCodeDialog(Context context, int i, String str, String str2, Callback callback) {
super(context, R.style.window_dialog);
this.context = context;
this.callback = callback;
this.loginType = i;
this.phoneText = str;
this.emailText = str2;
this.isTablet = JimuApplication.l().i();
}
}

View File

@@ -0,0 +1,301 @@
package com.ubt.jimu.base.dialog;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.drawable.ColorDrawable;
import android.text.TextUtils;
import android.text.method.ScrollingMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.ubt.jimu.JimuApplication;
import com.ubt.jimu.R;
import com.ubtech.utils.DisplayUtil;
import com.ubtech.view.dialog.SimpleDialog;
/* loaded from: classes.dex */
public class PermissionHintDialog extends Dialog implements View.OnClickListener {
public Button btnCancel;
public Button btnOk;
public String cancel;
public String content;
private ImageView imgLogo;
public String ok;
private DialogInterface.OnClickListener onCancelListener;
private DialogInterface.OnClickListener onOkListener;
private TextView tvDialogTitle;
private TextView tvTips;
public static class Builder {
private String cancel;
private String content;
private Context context;
private String logoUrl;
private String ok;
private DialogInterface.OnClickListener onCancelListener;
private DialogInterface.OnClickListener onOkListener;
private String title;
private int logoResId = 0;
private boolean canceledOnTouchOutside = true;
private int gravity = 17;
public Builder(Context context) {
this.context = context;
}
public PermissionHintDialog build() {
int i;
double d;
int a;
int a2;
PermissionHintDialog permissionHintDialog = new PermissionHintDialog(this.context);
permissionHintDialog.requestWindowFeature(1);
permissionHintDialog.getWindow().setBackgroundDrawable(new ColorDrawable(0));
permissionHintDialog.content = this.content;
permissionHintDialog.ok = this.ok;
permissionHintDialog.cancel = this.cancel;
permissionHintDialog.onOkListener = this.onOkListener;
permissionHintDialog.onCancelListener = this.onCancelListener;
View inflate = LayoutInflater.from(this.context).inflate(R.layout.dialog_permission_hint, (ViewGroup) null, false);
permissionHintDialog.intView(inflate, this);
permissionHintDialog.setContentView(inflate);
permissionHintDialog.setCanceledOnTouchOutside(this.canceledOnTouchOutside);
Window window = permissionHintDialog.getWindow();
WindowManager.LayoutParams attributes = window.getAttributes();
window.setBackgroundDrawableResource(R.color.translucent);
window.setWindowAnimations(R.style.dialogWindowAlphaIn);
int max = Math.max(DisplayUtil.b(JimuApplication.l()), DisplayUtil.a(JimuApplication.l()));
if (JimuApplication.l().i()) {
i = (int) (max * 0.5039d);
d = 0.624d;
} else {
i = (int) (max * 0.5165d);
d = 0.6088d;
}
int i2 = (int) (i * d);
if (JimuApplication.l().i()) {
a = DisplayUtil.a(this.context, 516.0f);
a2 = DisplayUtil.a(this.context, 322.0f);
} else {
a = DisplayUtil.a(this.context, 344.55f);
a2 = DisplayUtil.a(this.context, 209.75f);
}
if (a > i || a2 > i2) {
i = a;
i2 = a2;
}
attributes.width = i;
attributes.height = i2;
attributes.gravity = 17;
window.setAttributes(attributes);
return permissionHintDialog;
}
public Builder cancel(String str) {
this.cancel = str;
return this;
}
public Builder canceledOnTouchOutside(boolean z) {
this.canceledOnTouchOutside = z;
return this;
}
public Builder content(String str) {
this.content = str;
return this;
}
public Builder gravity(int i) {
this.gravity = i;
return this;
}
public Builder logoResId(int i) {
this.logoResId = i;
return this;
}
public Builder logoUrl(String str) {
this.logoUrl = str;
return this;
}
public Builder ok(String str) {
this.ok = str;
return this;
}
public Builder onCancel(DialogInterface.OnClickListener onClickListener) {
this.onCancelListener = onClickListener;
return this;
}
public Builder onOk(DialogInterface.OnClickListener onClickListener) {
this.onOkListener = onClickListener;
return this;
}
public Builder title(String str) {
this.title = str;
return this;
}
public Builder cancel(int i) {
this.cancel = this.context.getString(i);
return this;
}
public Builder content(int i) {
this.content = this.context.getString(i);
return this;
}
public Builder ok(int i) {
this.ok = this.context.getString(i);
return this;
}
public Builder title(int i) {
this.title = this.context.getString(i);
return this;
}
}
public PermissionHintDialog(Context context) {
super(context);
}
public static PermissionHintDialog buildSimpleDialog(Activity activity, String str, String str2, String str3, String str4, int i, DialogInterface.OnClickListener onClickListener, DialogInterface.OnClickListener onClickListener2) {
return new Builder(activity).title(str3).cancel(str2).ok(str).content(str4).gravity(i).onCancel(onClickListener).onOk(onClickListener2).build();
}
public static boolean showBluetoothEnableFailedHint(Context context) {
new SimpleDialog.Builder(context).d(R.string.permission_button_text_permission_denied_warning_dialog).a((CharSequence) context.getResources().getString(R.string.permission_waring_text_bluetooth_enable_failed)).b(new DialogInterface.OnClickListener() { // from class: com.ubt.jimu.base.dialog.PermissionHintDialog.4
@Override // android.content.DialogInterface.OnClickListener
public void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
}
}).a().show();
return true;
}
public static boolean showLocationPermissionDeniedHint(Context context) {
new Builder(context).ok(R.string.permission_button_text_permission_denied_warning_dialog).content(String.format(context.getResources().getString(R.string.permission_prompt_open_permission_by_settings), context.getResources().getString(R.string.permission_location))).onOk(new DialogInterface.OnClickListener() { // from class: com.ubt.jimu.base.dialog.PermissionHintDialog.2
@Override // android.content.DialogInterface.OnClickListener
public void onClick(DialogInterface dialogInterface, int i) {
}
}).build().show();
return true;
}
public static boolean showPermissionDeniedHint(Context context, String str) {
new Builder(context).ok(R.string.permission_button_text_permission_denied_warning_dialog).content(str).onOk(new DialogInterface.OnClickListener() { // from class: com.ubt.jimu.base.dialog.PermissionHintDialog.1
@Override // android.content.DialogInterface.OnClickListener
public void onClick(DialogInterface dialogInterface, int i) {
}
}).build().show();
return true;
}
public static boolean showStoragePermissionDeniedHint(Context context) {
new Builder(context).ok(R.string.permission_button_text_permission_denied_warning_dialog).content(String.format(context.getResources().getString(R.string.permission_prompt_open_permission_by_settings), context.getResources().getString(R.string.permission_storage))).onOk(new DialogInterface.OnClickListener() { // from class: com.ubt.jimu.base.dialog.PermissionHintDialog.3
@Override // android.content.DialogInterface.OnClickListener
public void onClick(DialogInterface dialogInterface, int i) {
}
}).build().show();
return true;
}
public void intView(View view, Builder builder) {
this.tvDialogTitle = (TextView) view.findViewById(R.id.tvDialogTitle);
this.tvTips = (TextView) view.findViewById(R.id.tvTips);
this.imgLogo = (ImageView) view.findViewById(R.id.imgLogo);
this.btnCancel = (Button) view.findViewById(R.id.btnCancel);
this.btnOk = (Button) view.findViewById(R.id.btnOk);
this.btnCancel.setOnClickListener(this);
this.btnOk.setOnClickListener(this);
if (!TextUtils.isEmpty(this.content)) {
this.tvTips.setText(this.content);
this.tvTips.setMovementMethod(ScrollingMovementMethod.getInstance());
}
if (this.onCancelListener == null) {
this.btnCancel.setVisibility(8);
} else if (JimuApplication.l().i()) {
this.btnCancel.setBackgroundResource(R.drawable.negative_btn_bg_pad);
} else {
this.btnCancel.setBackgroundResource(R.drawable.negative_btn_bg);
}
if (this.onOkListener == null) {
this.btnOk.setVisibility(8);
} else if (JimuApplication.l().i()) {
this.btnOk.setBackgroundResource(R.drawable.positive_btn_bg_pad);
} else {
this.btnOk.setBackgroundResource(R.drawable.positive_btn_bg);
}
if (!TextUtils.isEmpty(this.ok)) {
this.btnOk.setText(this.ok);
}
if (!TextUtils.isEmpty(this.cancel)) {
this.btnCancel.setText(this.cancel);
}
if (TextUtils.isEmpty(builder.title)) {
this.tvDialogTitle.setVisibility(8);
} else {
this.tvDialogTitle.setVisibility(0);
this.tvDialogTitle.setText(builder.title);
}
if (!TextUtils.isEmpty(builder.logoUrl)) {
Glide.e(getContext()).a(builder.logoUrl).a(this.imgLogo);
} else if (builder.logoResId != 0) {
this.imgLogo.setImageResource(builder.logoResId);
} else {
this.imgLogo.setVisibility(8);
}
if (17 != builder.gravity) {
this.tvTips.setGravity(builder.gravity);
}
}
@Override // android.view.View.OnClickListener
public void onClick(View view) {
int id = view.getId();
if (id == R.id.btnCancel) {
DialogInterface.OnClickListener onClickListener = this.onCancelListener;
if (onClickListener != null) {
onClickListener.onClick(this, 0);
return;
} else {
dismiss();
return;
}
}
if (id != R.id.btnOk) {
dismiss();
return;
}
DialogInterface.OnClickListener onClickListener2 = this.onOkListener;
if (onClickListener2 == null) {
dismiss();
} else {
onClickListener2.onClick(this, 0);
dismiss();
}
}
public PermissionHintDialog(Context context, int i) {
super(context, i);
}
protected PermissionHintDialog(Context context, boolean z, DialogInterface.OnCancelListener onCancelListener) {
super(context, z, onCancelListener);
}
}

View File

@@ -0,0 +1,145 @@
package com.ubt.jimu.base.dialog;
import android.app.DialogFragment;
import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.ubt.jimu.R;
import com.ubtech.utils.DisplayUtil;
/* loaded from: classes.dex */
public class SimpleQuestionDialog extends DialogFragment implements View.OnClickListener {
public static final int GRAVITY_CENTER = 2;
public static final int GRAVITY_LEFT = 1;
public static final String KEY_CANCELBUTTON = "cancel";
public static final String KEY_OK_BUTTON = "ok";
public static final String KEY_TIPS = "tips";
public static final String KEY_TIPS_GRAVITY = "tipsGravity";
public static final String KEY_TITLE = "title";
private TextView cancelBtn;
private String cancelButton;
private IDialogListener listener;
private TextView okBtn;
private String okButton;
private String tips;
private int tipsGravity;
private TextView tipsTxt;
private String title;
private TextView tvTitle;
public static SimpleQuestionDialog newInstance(String str) {
Bundle bundle = new Bundle();
bundle.putString(KEY_TIPS, str);
SimpleQuestionDialog simpleQuestionDialog = new SimpleQuestionDialog();
simpleQuestionDialog.setArguments(bundle);
return simpleQuestionDialog;
}
@Override // android.view.View.OnClickListener
public void onClick(View view) {
if (view.getId() == R.id.simple_question_dialog_ok) {
IDialogListener iDialogListener = this.listener;
if (iDialogListener != null) {
iDialogListener.onOk();
}
dismiss();
return;
}
if (view.getId() == R.id.simple_question_dialog_cancel) {
IDialogListener iDialogListener2 = this.listener;
if (iDialogListener2 != null) {
iDialogListener2.onCancle();
}
dismiss();
}
}
@Override // android.app.DialogFragment, android.app.Fragment
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
setCancelable(false);
Bundle arguments = getArguments();
if (arguments != null) {
this.title = arguments.getString("title");
this.tips = arguments.getString(KEY_TIPS);
this.okButton = arguments.getString(KEY_OK_BUTTON);
this.cancelButton = arguments.getString(KEY_CANCELBUTTON);
this.tipsGravity = arguments.getInt(KEY_TIPS_GRAVITY);
}
}
@Override // android.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
getDialog().requestWindowFeature(1);
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(0));
View inflate = layoutInflater.inflate(R.layout.dialog_simple_question, viewGroup);
this.tvTitle = (TextView) inflate.findViewById(R.id.simple_question_dialog_title);
this.tipsTxt = (TextView) inflate.findViewById(R.id.simple_question_dialog_info);
this.okBtn = (TextView) inflate.findViewById(R.id.simple_question_dialog_ok);
this.cancelBtn = (TextView) inflate.findViewById(R.id.simple_question_dialog_cancel);
this.okBtn.setOnClickListener(this);
this.cancelBtn.setOnClickListener(this);
this.tipsTxt.setText(this.tips + " ");
if (!TextUtils.isEmpty(this.okButton)) {
this.okBtn.setText(this.okButton);
}
if (!TextUtils.isEmpty(this.cancelButton)) {
this.cancelBtn.setText(this.cancelButton);
}
if (TextUtils.isEmpty(this.title)) {
int a = DisplayUtil.a((Context) getActivity(), 46.0f);
this.tipsTxt.setPadding(a, a, a, a);
this.tvTitle.setVisibility(8);
} else {
this.tvTitle.setVisibility(0);
this.tvTitle.setText(this.title);
}
int i = this.tipsGravity;
if (i > 0) {
setTextLeft(i);
}
return inflate;
}
public void setListener(IDialogListener iDialogListener) {
this.listener = iDialogListener;
}
public void setTextLeft(int i) {
TextView textView = this.tipsTxt;
if (textView != null) {
if (i == 1) {
textView.setGravity(3);
} else if (i == 2) {
textView.setGravity(17);
}
}
}
public static SimpleQuestionDialog newInstance(String str, String str2, String str3) {
Bundle bundle = new Bundle();
bundle.putString(KEY_OK_BUTTON, str);
bundle.putString(KEY_CANCELBUTTON, str2);
bundle.putString(KEY_TIPS, str3);
SimpleQuestionDialog simpleQuestionDialog = new SimpleQuestionDialog();
simpleQuestionDialog.setArguments(bundle);
return simpleQuestionDialog;
}
public static SimpleQuestionDialog newInstance(String str, String str2, String str3, String str4, int i) {
Bundle bundle = new Bundle();
bundle.putString("title", str);
bundle.putString(KEY_OK_BUTTON, str2);
bundle.putString(KEY_CANCELBUTTON, str3);
bundle.putString(KEY_TIPS, str4);
bundle.putInt(KEY_TIPS_GRAVITY, i);
SimpleQuestionDialog simpleQuestionDialog = new SimpleQuestionDialog();
simpleQuestionDialog.setArguments(bundle);
return simpleQuestionDialog;
}
}

View File

@@ -0,0 +1,265 @@
package com.ubt.jimu.base.dialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.text.TextUtils;
import android.text.method.ScrollingMovementMethod;
import android.view.KeyEvent;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.TextView;
import com.ubt.jimu.JimuApplication;
import com.ubt.jimu.R;
import com.ubtech.utils.DisplayUtil;
import com.ubtech.view.widget.UButton;
/* loaded from: classes.dex */
public class UpdateDialog extends Dialog implements View.OnClickListener {
private boolean backAble;
private UButton btnCancel;
private UButton btnOk;
private String cancel;
private boolean canceledOnTouchOutside;
private String content;
private ImageView imgLeft;
private ImageView imgRight;
private boolean isLeft;
private boolean isRight;
private int leftResId;
private InteractionListner mInteractionListener;
private String ok;
private int rightResId;
private String title;
private TextView tvContent;
private TextView tvDialogTitle;
public static class Builder {
private String cancel;
private String content;
private int leftResId;
private InteractionListner mInteractionListner;
private String ok;
private int rightResId;
private String title;
private boolean canceledOnTouchOutside = true;
private boolean backAble = true;
private boolean isLeft = false;
private boolean isRight = false;
public Builder backAble(boolean z) {
this.backAble = z;
return this;
}
public Builder cancel(String str) {
this.cancel = str;
return this;
}
public Builder canceledOnTouchOutside(boolean z) {
this.canceledOnTouchOutside = z;
return this;
}
public Builder content(String str) {
this.content = str;
return this;
}
public Builder interactionListener(InteractionListner interactionListner) {
this.mInteractionListner = interactionListner;
return this;
}
public Builder isLeft(boolean z) {
this.isLeft = z;
return this;
}
public Builder isRight(boolean z) {
this.isRight = z;
return this;
}
public Builder leftResId(int i) {
this.leftResId = i;
return this;
}
public Builder ok(String str) {
this.ok = str;
return this;
}
public Builder rightResId(int i) {
this.rightResId = i;
return this;
}
public Builder title(String str) {
this.title = str;
return this;
}
}
public interface InteractionListner {
void onCancelClick(UpdateDialog updateDialog);
void onLeftImgClick(UpdateDialog updateDialog);
void onOkClick(UpdateDialog updateDialog);
void onRightImgClick(UpdateDialog updateDialog);
}
public UpdateDialog(Context context, Builder builder) {
super(context);
this.canceledOnTouchOutside = builder.canceledOnTouchOutside;
this.backAble = builder.backAble;
this.isLeft = builder.isLeft;
this.isRight = builder.isRight;
this.leftResId = builder.leftResId;
this.rightResId = builder.rightResId;
this.title = builder.title;
this.content = builder.content;
this.cancel = builder.cancel;
this.ok = builder.ok;
this.mInteractionListener = builder.mInteractionListner;
}
private void initView() {
this.imgLeft = (ImageView) findViewById(R.id.imgLeft);
this.imgRight = (ImageView) findViewById(R.id.imgRight);
this.tvDialogTitle = (TextView) findViewById(R.id.tvDialogTitle);
this.tvContent = (TextView) findViewById(R.id.tvContent);
this.btnCancel = (UButton) findViewById(R.id.btnCancel);
this.btnOk = (UButton) findViewById(R.id.btnOk);
this.imgLeft.setOnClickListener(this);
this.imgRight.setOnClickListener(this);
this.btnCancel.setOnClickListener(this);
this.btnOk.setOnClickListener(this);
if (this.isLeft) {
this.imgLeft.setVisibility(0);
this.imgLeft.setImageResource(this.leftResId);
} else {
this.imgLeft.setVisibility(8);
}
if (this.isRight) {
this.imgRight.setVisibility(0);
this.imgRight.setImageResource(this.rightResId);
} else {
this.imgRight.setVisibility(8);
}
if (TextUtils.isEmpty(this.cancel)) {
this.btnCancel.setVisibility(8);
} else {
this.btnCancel.setVisibility(0);
this.btnCancel.setText(this.cancel);
}
if (TextUtils.isEmpty(this.ok)) {
this.btnOk.setVisibility(8);
} else {
this.btnOk.setVisibility(0);
this.btnOk.setText(this.ok);
}
if (TextUtils.isEmpty(this.title)) {
this.tvDialogTitle.setVisibility(4);
} else {
this.tvDialogTitle.setVisibility(0);
this.tvDialogTitle.setText(this.title);
}
if (TextUtils.isEmpty(this.content)) {
this.tvContent.setVisibility(4);
return;
}
this.tvContent.setVisibility(0);
this.tvContent.setText(this.content);
this.tvContent.setMovementMethod(ScrollingMovementMethod.getInstance());
}
private void setupWindow() {
int i;
double d;
int a;
int a2;
requestWindowFeature(1);
setContentView(R.layout.firmware_update_dialog);
Window window = getWindow();
window.setBackgroundDrawable(new ColorDrawable(0));
window.setWindowAnimations(R.style.dialogWindowAlphaIn);
WindowManager.LayoutParams attributes = window.getAttributes();
int max = Math.max(DisplayUtil.b(JimuApplication.l()), DisplayUtil.a(JimuApplication.l()));
if (JimuApplication.l().i()) {
i = (int) (max * 0.5039d);
d = 0.624d;
} else {
i = (int) (max * 0.5165d);
d = 0.6088d;
}
int i2 = (int) (i * d);
if (JimuApplication.l().i()) {
a = DisplayUtil.a(getContext(), 516.0f);
a2 = DisplayUtil.a(getContext(), 322.0f);
} else {
a = DisplayUtil.a(getContext(), 344.0f);
a2 = DisplayUtil.a(getContext(), 222.5f);
}
if (a > i || a2 > i2) {
i = a;
i2 = a2;
}
attributes.width = i;
attributes.height = i2;
attributes.gravity = 17;
window.setAttributes(attributes);
setCanceledOnTouchOutside(this.canceledOnTouchOutside);
}
@Override // android.view.View.OnClickListener
public void onClick(View view) {
if (this.mInteractionListener == null) {
}
switch (view.getId()) {
case R.id.btnCancel /* 2131296362 */:
this.mInteractionListener.onCancelClick(this);
break;
case R.id.btnOk /* 2131296369 */:
this.mInteractionListener.onOkClick(this);
break;
case R.id.imgLeft /* 2131296847 */:
this.mInteractionListener.onLeftImgClick(this);
break;
case R.id.imgRight /* 2131296875 */:
this.mInteractionListener.onRightImgClick(this);
break;
}
}
@Override // android.app.Dialog
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
setupWindow();
initView();
}
@Override // android.app.Dialog, android.view.KeyEvent.Callback
public boolean onKeyDown(int i, KeyEvent keyEvent) {
if (this.backAble) {
return super.onKeyDown(i, keyEvent);
}
return true;
}
public UpdateDialog(Context context, int i) {
super(context, i);
}
protected UpdateDialog(Context context, boolean z, DialogInterface.OnCancelListener onCancelListener) {
super(context, z, onCancelListener);
}
}

View File

@@ -0,0 +1,161 @@
package com.ubt.jimu.base.dialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.drawable.ColorDrawable;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.TextView;
import com.ubt.jimu.JimuApplication;
import com.ubt.jimu.R;
import com.ubt.jimu.base.dialog.UserExperienceDialog;
import com.ubtech.utils.DisplayUtil;
/* loaded from: classes.dex */
public class UserExperienceDialog extends Dialog implements View.OnClickListener {
public Button btnCancel;
public Button btnOk;
public String cancel;
public String content;
private Context context;
public String ok;
private DialogInterface.OnClickListener onCancelListener;
private DialogInterface.OnClickListener onOkListener;
private TextView tvTips;
public static class Builder {
private Context context;
private DialogInterface.OnClickListener onCancelListener;
private DialogInterface.OnClickListener onOkListener;
public Builder(Context context) {
this.context = context;
}
static /* synthetic */ boolean a(DialogInterface dialogInterface, int i, KeyEvent keyEvent) {
return i == 4;
}
public UserExperienceDialog build() {
int i;
double d;
int a;
int a2;
UserExperienceDialog userExperienceDialog = new UserExperienceDialog(this.context);
userExperienceDialog.setOnKeyListener(new DialogInterface.OnKeyListener() { // from class: com.ubt.jimu.base.dialog.b
@Override // android.content.DialogInterface.OnKeyListener
public final boolean onKey(DialogInterface dialogInterface, int i2, KeyEvent keyEvent) {
return UserExperienceDialog.Builder.a(dialogInterface, i2, keyEvent);
}
});
userExperienceDialog.context = this.context;
userExperienceDialog.onOkListener = this.onOkListener;
userExperienceDialog.onCancelListener = this.onCancelListener;
userExperienceDialog.requestWindowFeature(1);
userExperienceDialog.getWindow().setBackgroundDrawable(new ColorDrawable(0));
View inflate = LayoutInflater.from(this.context).inflate(R.layout.dialog_jimu_user_experience, (ViewGroup) null, false);
userExperienceDialog.intView(inflate, this);
userExperienceDialog.setContentView(inflate);
userExperienceDialog.setCanceledOnTouchOutside(false);
Window window = userExperienceDialog.getWindow();
WindowManager.LayoutParams attributes = window.getAttributes();
window.setBackgroundDrawableResource(R.color.translucent);
window.setWindowAnimations(R.style.dialogWindowAlphaIn);
int max = Math.max(DisplayUtil.b(JimuApplication.l()), DisplayUtil.a(JimuApplication.l()));
if (JimuApplication.l().i()) {
i = (int) (max * 0.5039d);
d = 0.624d;
} else {
i = (int) (max * 0.5165d);
d = 0.6088d;
}
int i2 = (int) (i * d);
if (JimuApplication.l().i()) {
a = DisplayUtil.a(this.context, 516.0f);
a2 = DisplayUtil.a(this.context, 322.0f);
} else {
a = DisplayUtil.a(this.context, 344.55f);
a2 = DisplayUtil.a(this.context, 209.75f);
}
if (a > i || a2 > i2) {
i = a;
i2 = a2;
}
attributes.width = i;
attributes.height = i2;
attributes.gravity = 17;
window.setAttributes(attributes);
return userExperienceDialog;
}
public Builder onCancel(DialogInterface.OnClickListener onClickListener) {
this.onCancelListener = onClickListener;
return this;
}
public Builder onOk(DialogInterface.OnClickListener onClickListener) {
this.onOkListener = onClickListener;
return this;
}
}
public UserExperienceDialog(Context context) {
super(context);
}
@Override // android.app.Dialog, android.content.DialogInterface
public void dismiss() {
super.dismiss();
}
public void intView(View view, Builder builder) {
this.tvTips = (TextView) view.findViewById(R.id.tvTips);
this.btnCancel = (Button) view.findViewById(R.id.btnCancel);
this.btnOk = (Button) view.findViewById(R.id.btnOk);
this.btnCancel.setOnClickListener(this);
this.btnOk.setOnClickListener(this);
this.tvTips.setText("体验优化");
this.btnOk.setText(this.context.getResources().getString(R.string.gdpr_agree));
this.btnCancel.setText("暂不同意");
this.btnCancel.setBackgroundResource(R.drawable.sel_common_negative_btn);
}
@Override // android.view.View.OnClickListener
public void onClick(View view) {
int id = view.getId();
if (id == R.id.btnCancel) {
DialogInterface.OnClickListener onClickListener = this.onCancelListener;
if (onClickListener != null) {
onClickListener.onClick(this, 0);
return;
} else {
dismiss();
return;
}
}
if (id != R.id.btnOk) {
dismiss();
return;
}
DialogInterface.OnClickListener onClickListener2 = this.onOkListener;
if (onClickListener2 != null) {
onClickListener2.onClick(this, 0);
} else {
dismiss();
}
}
public UserExperienceDialog(Context context, int i) {
super(context, i);
}
protected UserExperienceDialog(Context context, boolean z, DialogInterface.OnCancelListener onCancelListener) {
super(context, z, onCancelListener);
}
}

View File

@@ -0,0 +1,76 @@
package com.ubt.jimu.base.dialog;
import android.R;
import android.app.DialogFragment;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.TextView;
/* loaded from: classes.dex */
public class WaitDialogSupport extends DialogFragment {
private AnimationDrawable backgroundAnimation;
private Animation rotateAnimaLow;
private String tip;
private TextView tipTv;
public static DialogFragment newInstance(String str) {
WaitDialogSupport waitDialogSupport = new WaitDialogSupport();
Bundle bundle = new Bundle();
bundle.putString("tip", str);
waitDialogSupport.setArguments(bundle);
return waitDialogSupport;
}
@Override // android.app.DialogFragment
public void dismiss() {
try {
super.dismiss();
} catch (Throwable th) {
th.printStackTrace();
}
Animation animation = this.rotateAnimaLow;
if (animation != null) {
animation.cancel();
this.rotateAnimaLow = null;
}
AnimationDrawable animationDrawable = this.backgroundAnimation;
if (animationDrawable != null) {
animationDrawable.stop();
this.backgroundAnimation = null;
}
}
@Override // android.app.DialogFragment, android.app.Fragment
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
setStyle(0, R.style.Theme.Translucent.NoTitleBar.Fullscreen);
this.tip = getArguments().getString("tip");
}
@Override // android.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(com.ubt.jimu.R.layout.dialog_wait, viewGroup, false);
ImageView imageView = (ImageView) inflate.findViewById(com.ubt.jimu.R.id.wait_dialog_img);
this.tipTv = (TextView) inflate.findViewById(com.ubt.jimu.R.id.dialog_wait_tv_loading_tips);
if (TextUtils.isEmpty(this.tip)) {
this.tipTv.setVisibility(8);
} else {
this.tipTv.setText(this.tip);
}
this.rotateAnimaLow = AnimationUtils.loadAnimation(getActivity(), com.ubt.jimu.R.anim.anima_dialog_wait);
imageView.startAnimation(this.rotateAnimaLow);
this.backgroundAnimation = (AnimationDrawable) imageView.getBackground();
AnimationDrawable animationDrawable = this.backgroundAnimation;
if (animationDrawable != null) {
animationDrawable.start();
}
return inflate;
}
}

View File

@@ -0,0 +1,308 @@
package com.ubt.jimu.base.download;
import android.content.Context;
import android.text.TextUtils;
import com.ubt.jimu.JimuApplication;
import com.ubt.jimu.base.cache.Constants;
import com.ubt.jimu.base.db.DatabaseUtils;
import com.ubt.jimu.base.db.FileDownloadRecordDbHandler;
import com.ubt.jimu.base.db.course.JimuCourseDbHandler;
import com.ubt.jimu.base.entities.FileDownloadRecord;
import com.ubt.jimu.base.entities.FirmwareVersion;
import com.ubt.jimu.base.entities.PartFileInfo;
import com.ubt.jimu.base.entities.Robot;
import com.ubt.jimu.base.entities.Story;
import com.ubt.jimu.blockly.Utils;
import com.ubt.jimu.course.repository.JimuCourse;
import com.ubt.jimu.diy.DiyRobotFile;
import com.ubt.jimu.gen.PartFileInfoDao;
import com.ubt.jimu.transport.model.TransportFile;
import com.ubt.jimu.transport3.dao.TransportFileDbHandler2;
import com.ubt.jimu.unity.ModelType;
import com.ubt.jimu.utils.ExternalOverFroyoUtils;
import com.ubtrobot.log.ALog;
import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.greenrobot.greendao.query.QueryBuilder;
import org.greenrobot.greendao.query.WhereCondition;
/* loaded from: classes.dex */
public class DownloadInfo {
public static final int COURSE = 4;
public static final int COURSE_COMMON = 3;
public static final int DIY_FILE = 7;
public static final int FIRMWARE = 6;
public static final int MODEL = 0;
public static final int PARTS = 1;
public static final int STAR_COURSE = 8;
public static final int STORY_COMMON = 2;
public static final int SYNC_FILE = 5;
private static final String TAG = "DownloadInfo";
private String savePath;
private int type;
private String url;
public DownloadInfo(int i, String str, String str2) {
this.type = i;
this.url = str;
this.savePath = str2;
}
private static List<PartFileInfo> getNeedDownPart(List<PartFileInfo> list) {
ArrayList arrayList = new ArrayList();
if (list != null && list.size() != 0) {
for (PartFileInfo partFileInfo : list) {
if (!isInDB(partFileInfo) || !isInDir(partFileInfo)) {
arrayList.add(partFileInfo);
}
}
}
return arrayList;
}
public static List<DownloadInfo> getNeedDownloadCourse(JimuCourse jimuCourse) {
ArrayList arrayList = new ArrayList();
JimuCourse downloadedCourse = JimuCourseDbHandler.getDownloadedCourse(jimuCourse);
String str = Constants.COURSE_RESOURCE_PATH;
if (downloadedCourse != null && downloadedCourse.getDownload()) {
if (new File(str + jimuCourse.getId()).exists() && jimuCourse.getUpdatedTime() == downloadedCourse.getUpdatedTime()) {
return arrayList;
}
}
arrayList.add(new DownloadInfo(4, jimuCourse.getResourceZip(), str + jimuCourse.getFolderName() + ".zip"));
return arrayList;
}
public static List<DownloadInfo> getNeedDownloadDiyRobotFile(String str, List<DiyRobotFile> list) {
String str2;
ArrayList arrayList = new ArrayList();
if (list != null && list.size() != 0) {
String str3 = ExternalOverFroyoUtils.a(JimuApplication.l(), ModelType.DOWNLOAD) + str + File.separator;
for (DiyRobotFile diyRobotFile : list) {
if (513 == diyRobotFile.getFileType()) {
str2 = str3 + "actions" + File.separator + diyRobotFile.getFileName();
} else if (769 == diyRobotFile.getFileType()) {
str2 = str3 + str + Utils.BLOCKLY_ADD_PATH + File.separator + diyRobotFile.getFileName();
} else if (258 == diyRobotFile.getFileType()) {
str2 = str3 + "servos" + File.separator + diyRobotFile.getFileName();
} else if (257 == diyRobotFile.getFileType()) {
str2 = str3 + str + ".xml";
} else if (259 == diyRobotFile.getFileType()) {
str2 = str3 + str + ".jpg";
} else {
str2 = str3 + diyRobotFile.getFileName();
}
arrayList.add(new DownloadInfo(7, diyRobotFile.getFileUrl(), str2));
}
}
return arrayList;
}
public static List<DownloadInfo> getNeedDownloadFirmware(Context context, List<FirmwareVersion> list) {
ArrayList arrayList = new ArrayList();
if (list != null && list.size() != 0) {
for (FirmwareVersion firmwareVersion : list) {
arrayList.add(new DownloadInfo(6, firmwareVersion.getVersionPath(), FirmwareVersion.getPath(context, firmwareVersion)));
}
}
return arrayList;
}
public static List<DownloadInfo> getNeedDownloadInfo(List<TransportFile> list) {
ArrayList arrayList = new ArrayList();
if (list != null && list.size() != 0) {
long currentTimeMillis = System.currentTimeMillis();
for (TransportFile transportFile : list) {
String fileUrl = transportFile.getFileUrl();
if (!TextUtils.isEmpty(fileUrl)) {
int indexOf = fileUrl.indexOf("?");
fileUrl = indexOf < 0 ? fileUrl + "?t=" + currentTimeMillis : fileUrl.substring(0, indexOf) + "t=" + currentTimeMillis;
}
arrayList.add(new DownloadInfo(5, fileUrl, TransportFileDbHandler2.getAbsoluteModelFilePath(transportFile)));
}
}
return arrayList;
}
/* JADX WARN: Code restructure failed: missing block: B:13:0x009f, code lost:
if (r2.getModelUpdateTime() == r8.getModelUpdateTime()) goto L17;
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct code enable 'Show inconsistent code' option in preferences
*/
public static com.ubt.jimu.base.download.DownloadInfo getNeedDownloadModelInfo(com.ubt.jimu.base.entities.Robot r8) {
/*
java.lang.StringBuilder r0 = new java.lang.StringBuilder
r0.<init>()
com.ubt.jimu.JimuApplication r1 = com.ubt.jimu.JimuApplication.l()
com.ubt.jimu.unity.ModelType r2 = com.ubt.jimu.unity.ModelType.DEFAULT
java.lang.String r1 = com.ubt.jimu.utils.ExternalOverFroyoUtils.a(r1, r2)
r0.append(r1)
java.lang.String r1 = r8.getModelName()
r0.append(r1)
java.lang.String r0 = r0.toString()
java.lang.StringBuilder r1 = new java.lang.StringBuilder
r1.<init>()
r1.append(r0)
java.lang.String r2 = ".zip"
r1.append(r2)
java.lang.String r1 = r1.toString()
java.io.File r2 = new java.io.File
r2.<init>(r0)
r0 = 1
java.lang.Object[] r3 = new java.lang.Object[r0]
java.lang.String r4 = r8.toString()
r5 = 0
r3[r5] = r4
java.lang.String r4 = "download"
java.lang.String r6 = "robot from cache : %s"
com.ubtech.utils.XLog.a(r4, r6, r3)
boolean r2 = r2.exists()
if (r2 == 0) goto La2
com.ubt.jimu.gen.DaoSession r2 = com.ubt.jimu.base.db.DatabaseUtils.getDaoSession(r0)
com.ubt.jimu.gen.RobotDao r2 = r2.s()
org.greenrobot.greendao.query.QueryBuilder r2 = r2.k()
org.greenrobot.greendao.Property r3 = com.ubt.jimu.gen.RobotDao.Properties.ModelName
java.lang.String r6 = r8.getModelName()
org.greenrobot.greendao.query.WhereCondition r3 = r3.a(r6)
org.greenrobot.greendao.query.WhereCondition[] r6 = new org.greenrobot.greendao.query.WhereCondition[r5]
r2.a(r3, r6)
java.util.List r2 = r2.b()
if (r2 == 0) goto La2
int r3 = r2.size()
if (r3 <= 0) goto La2
int r3 = r2.size()
if (r3 <= r0) goto L7c
java.lang.String r3 = "There have more than one robot with the same modelName. Is there reinstall the app with different server"
com.ubtech.utils.XLog.b(r4, r3)
L7c:
java.lang.Object r2 = r2.get(r5)
com.ubt.jimu.base.entities.Robot r2 = (com.ubt.jimu.base.entities.Robot) r2
java.lang.Object[] r3 = new java.lang.Object[r0]
java.lang.String r6 = r2.toString()
r3[r5] = r6
java.lang.String r6 = "robot from db : %s"
com.ubtech.utils.XLog.a(r4, r6, r3)
boolean r3 = r2.getDownload()
if (r3 == 0) goto La2
long r2 = r2.getModelUpdateTime()
long r6 = r8.getModelUpdateTime()
int r4 = (r2 > r6 ? 1 : (r2 == r6 ? 0 : -1))
if (r4 != 0) goto La2
goto La3
La2:
r0 = 0
La3:
if (r0 != 0) goto Laf
com.ubt.jimu.base.download.DownloadInfo r0 = new com.ubt.jimu.base.download.DownloadInfo
java.lang.String r8 = r8.getJarUrl()
r0.<init>(r5, r8, r1)
goto Lb0
Laf:
r0 = 0
Lb0:
return r0
*/
throw new UnsupportedOperationException("Method not decompiled: com.ubt.jimu.base.download.DownloadInfo.getNeedDownloadModelInfo(com.ubt.jimu.base.entities.Robot):com.ubt.jimu.base.download.DownloadInfo");
}
public static List<DownloadInfo> getNeedDownloadStory(Context context, Story story) {
ArrayList arrayList = new ArrayList();
if (story != null && !TextUtils.isEmpty(story.getResourceZip())) {
List<FileDownloadRecord> fileDownloadRecordByUrl = FileDownloadRecordDbHandler.getFileDownloadRecordByUrl(story.getResourceZip(), FileDownloadRecord.Type.Star_Course.getValue());
if (fileDownloadRecordByUrl != null && fileDownloadRecordByUrl.size() != 0) {
Iterator<FileDownloadRecord> it = fileDownloadRecordByUrl.iterator();
while (true) {
if (!it.hasNext()) {
break;
}
FileDownloadRecord next = it.next();
if (next.getFileUrl().equals(story.getResourceZip()) && next.getUpdateTime() < story.getUpdateTime()) {
arrayList.add(new DownloadInfo(FileDownloadRecord.Type.Star_Course.getValue(), story.getResourceZip(), Story.getSdcardSavePath(context, story.getResourceZip())));
break;
}
}
} else {
arrayList.add(new DownloadInfo(FileDownloadRecord.Type.Star_Course.getValue(), story.getResourceZip(), Story.getSdcardSavePath(context, story.getResourceZip())));
}
}
return arrayList;
}
public static List<DownloadInfo> getNewDownloadPartsInfo(Robot robot) {
ArrayList arrayList;
String str = ExternalOverFroyoUtils.a(JimuApplication.l(), (ModelType) null) + Constants.PARTS;
File file = new File(str);
if (!file.exists()) {
file.mkdirs();
}
try {
List<PartFileInfo> needDownPart = getNeedDownPart(robot.getComponentsFileInfos());
arrayList = new ArrayList();
if (needDownPart != null) {
try {
if (needDownPart.size() > 0) {
for (PartFileInfo partFileInfo : needDownPart) {
if (!TextUtils.isEmpty(partFileInfo.getAndroidFilePath())) {
arrayList.add(new DownloadInfo(1, partFileInfo.getAndroidFilePath(), str + partFileInfo.getName() + ".assetbundle"));
}
}
}
} catch (Exception e) {
e = e;
e.printStackTrace();
return arrayList;
}
}
} catch (Exception e2) {
e = e2;
arrayList = null;
}
return arrayList;
}
private static boolean isInDB(PartFileInfo partFileInfo) {
if (partFileInfo == null) {
return true;
}
QueryBuilder<PartFileInfo> k = DatabaseUtils.getDaoSession(true).r().k();
k.a(PartFileInfoDao.Properties.Id.a(partFileInfo.getId()), new WhereCondition[0]);
PartFileInfo c = k.c();
if (c == null || c.getUpdateTime() != partFileInfo.getUpdateTime()) {
return false;
}
ALog.a(TAG).d("零件已是最新:" + c.getName());
return true;
}
private static boolean isInDir(PartFileInfo partFileInfo) {
if (partFileInfo == null) {
return true;
}
if (!new File(ExternalOverFroyoUtils.a(JimuApplication.l(), (ModelType) null) + Constants.PARTS).exists()) {
return false;
}
String str = ExternalOverFroyoUtils.a(JimuApplication.l(), (ModelType) null) + Constants.PARTS + partFileInfo.getName() + ".assetbundle";
if (!new File(str).exists()) {
return false;
}
ALog.a(TAG).d("零件已在文件夹:" + str);
return true;
}
public String getSavePath() {
return this.savePath;
}
public int getType() {
return this.type;
}
public String getUrl() {
return this.url;
}
}

View File

@@ -0,0 +1,44 @@
package com.ubt.jimu.base.download;
import com.liulishuo.filedownloader.BaseDownloadTask;
import com.liulishuo.filedownloader.FileDownloadListener;
import com.liulishuo.filedownloader.FileDownloadQueueSet;
import com.liulishuo.filedownloader.FileDownloader;
import java.util.ArrayList;
import java.util.List;
/* loaded from: classes.dex */
public class DownloadTask {
private FileDownloadListener fileDownloadListener;
private FileDownloadQueueSet queueSet;
public DownloadTask(List<DownloadInfo> list, IJimuFileDownloadListener iJimuFileDownloadListener) {
this(list, false, iJimuFileDownloadListener);
}
public void pause() {
if (this.queueSet != null) {
FileDownloader.e().a(this.fileDownloadListener);
}
}
public void start() {
this.queueSet.a();
}
public DownloadTask(List<DownloadInfo> list, boolean z, IJimuFileDownloadListener iJimuFileDownloadListener) {
ArrayList arrayList = new ArrayList();
for (DownloadInfo downloadInfo : list) {
BaseDownloadTask a = FileDownloader.e().a(downloadInfo.getUrl());
a.a(downloadInfo.getSavePath(), false);
a.a(Integer.valueOf(downloadInfo.getType()));
a.a(z);
a.c(3);
a.a("Accept-Encoding", "identity");
arrayList.add(a);
}
this.fileDownloadListener = new MyFileDownloadListener(arrayList.size(), iJimuFileDownloadListener);
this.queueSet = new FileDownloadQueueSet(this.fileDownloadListener);
this.queueSet.a(arrayList);
}
}

View File

@@ -0,0 +1,492 @@
package com.ubt.jimu.base.download;
import android.content.Context;
import android.text.TextUtils;
import com.liulishuo.filedownloader.BaseDownloadTask;
import com.ubt.jimu.JimuApplication;
import com.ubt.jimu.base.cache.Cache;
import com.ubt.jimu.base.cache.Constants;
import com.ubt.jimu.base.db.DatabaseUtils;
import com.ubt.jimu.base.db.FileDownloadRecordDbHandler;
import com.ubt.jimu.base.db.course.JimuCourseDbHandler;
import com.ubt.jimu.base.db.diy.DiyDetailsDbHandler;
import com.ubt.jimu.base.db.diy.DiyRobotFileDbDandler;
import com.ubt.jimu.base.db.robot.FirmwareVersionDbHandler;
import com.ubt.jimu.base.db.robot.PartFileInfoDbHandler;
import com.ubt.jimu.base.db.robot.RobotDbHandler;
import com.ubt.jimu.base.entities.FileDownloadRecord;
import com.ubt.jimu.base.entities.FirmwareVersion;
import com.ubt.jimu.base.entities.PartFileInfo;
import com.ubt.jimu.base.entities.Robot;
import com.ubt.jimu.base.entities.Story;
import com.ubt.jimu.course.repository.JimuCourse;
import com.ubt.jimu.diy.DiyRobotFile;
import com.ubt.jimu.diy.model.DiyDetailsModel;
import com.ubt.jimu.unity.ModelType;
import com.ubt.jimu.utils.ExternalOverFroyoUtils;
import com.ubt.jimu.utils.LocaleUtils;
import com.ubt.jimu.utils.NetWorkUtil;
import com.ubtech.utils.FileHelper;
import com.ubtech.utils.ThreadExecutor;
import com.ubtrobot.log.ALog;
import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.Callable;
/* loaded from: classes.dex */
public class Downloader {
private static final String TAG = "Downloader";
public interface IDownloadJimuRobotListener {
void onFailed();
void onPrepareStart();
void onProgress(int i, int i2, int i3);
void onSuccess();
}
public static final DownloadTask downloadDiy(final DiyDetailsModel diyDetailsModel, final List<DiyRobotFile> list, final IDownloadJimuRobotListener iDownloadJimuRobotListener) {
if (list == null || list.size() == 0) {
if (iDownloadJimuRobotListener != null) {
iDownloadJimuRobotListener.onFailed();
}
return null;
}
try {
return (DownloadTask) ThreadExecutor.a().a(new Callable<DownloadTask>() { // from class: com.ubt.jimu.base.download.Downloader.1
/* JADX WARN: Can't rename method to resolve collision */
@Override // java.util.concurrent.Callable
public DownloadTask call() throws Exception {
String valueOf = TextUtils.isEmpty(DiyDetailsModel.this.getCustomModelId()) ? String.valueOf(DiyDetailsModel.this.getId()) : DiyDetailsModel.this.getCustomModelId();
List<DiyRobotFile> queryDiyRobotFile = DiyRobotFileDbDandler.queryDiyRobotFile(valueOf);
final ArrayList arrayList = new ArrayList();
if (queryDiyRobotFile == null || queryDiyRobotFile.size() == 0) {
arrayList.addAll(list);
} else {
for (DiyRobotFile diyRobotFile : list) {
int i = 0;
while (true) {
if (i >= queryDiyRobotFile.size()) {
break;
}
DiyRobotFile diyRobotFile2 = queryDiyRobotFile.get(i);
if (diyRobotFile.getFileName().equals(diyRobotFile2.getFileName()) && diyRobotFile.getFileType() == diyRobotFile2.getFileType()) {
if (diyRobotFile.getUpdateDate() > diyRobotFile2.getUpdateDate()) {
arrayList.add(diyRobotFile);
}
if (!DiyRobotFile.exists(diyRobotFile)) {
arrayList.add(diyRobotFile);
}
} else {
i++;
}
}
if (i == queryDiyRobotFile.size()) {
arrayList.add(diyRobotFile);
}
}
}
if (arrayList.size() == 0) {
IDownloadJimuRobotListener iDownloadJimuRobotListener2 = iDownloadJimuRobotListener;
if (iDownloadJimuRobotListener2 != null) {
iDownloadJimuRobotListener2.onSuccess();
}
return null;
}
List<DownloadInfo> needDownloadDiyRobotFile = DownloadInfo.getNeedDownloadDiyRobotFile(valueOf, arrayList);
if (needDownloadDiyRobotFile == null || needDownloadDiyRobotFile.size() == 0) {
IDownloadJimuRobotListener iDownloadJimuRobotListener3 = iDownloadJimuRobotListener;
if (iDownloadJimuRobotListener3 != null) {
iDownloadJimuRobotListener3.onFailed();
}
return null;
}
DownloadTask downloadTask = new DownloadTask(needDownloadDiyRobotFile, new IJimuFileDownloadListener() { // from class: com.ubt.jimu.base.download.Downloader.1.1
@Override // com.ubt.jimu.base.download.IJimuFileDownloadListener
public void onBlockComplete(BaseDownloadTask baseDownloadTask) {
Cache.getInstance().getSettings().put(Constants.KEY_PROGRAM_LANGUAGE, LocaleUtils.b());
for (DiyRobotFile diyRobotFile3 : arrayList) {
if (baseDownloadTask.getUrl().equals(diyRobotFile3.getFileUrl())) {
DiyRobotFileDbDandler.saveOrUpdate(diyRobotFile3);
return;
}
}
}
@Override // com.ubt.jimu.base.download.IJimuFileDownloadListener
public void onCompleted() {
try {
DiyDetailsModel.this.setDownload(true);
new DiyDetailsDbHandler(DatabaseUtils.getDaoSession(false).e()).insertOrUpdate(DiyDetailsModel.this);
if (iDownloadJimuRobotListener != null) {
iDownloadJimuRobotListener.onProgress(1, 1, 100);
iDownloadJimuRobotListener.onSuccess();
}
} catch (Exception e) {
e.printStackTrace();
}
}
@Override // com.ubt.jimu.base.download.IJimuFileDownloadListener
public void onFailed(Throwable th) {
IDownloadJimuRobotListener iDownloadJimuRobotListener4 = iDownloadJimuRobotListener;
if (iDownloadJimuRobotListener4 != null) {
iDownloadJimuRobotListener4.onFailed();
}
}
@Override // com.ubt.jimu.base.download.IJimuFileDownloadListener
public void onProgress(int i2, int i3, int i4) {
IDownloadJimuRobotListener iDownloadJimuRobotListener4 = iDownloadJimuRobotListener;
if (iDownloadJimuRobotListener4 != null) {
iDownloadJimuRobotListener4.onProgress(i2, i3, i4);
}
}
});
IDownloadJimuRobotListener iDownloadJimuRobotListener4 = iDownloadJimuRobotListener;
if (iDownloadJimuRobotListener4 != null) {
iDownloadJimuRobotListener4.onPrepareStart();
}
downloadTask.start();
return downloadTask;
}
}).get();
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
public static DownloadTask downloadFirmware(final Context context, final List<FirmwareVersion> list, final IDownloadJimuRobotListener iDownloadJimuRobotListener) {
if (list == null) {
return null;
}
List<DownloadInfo> needDownloadFirmware = DownloadInfo.getNeedDownloadFirmware(context, list);
if (needDownloadFirmware == null || needDownloadFirmware.size() == 0) {
if (iDownloadJimuRobotListener != null) {
ALog.a(TAG).d("没有固件需要下载");
iDownloadJimuRobotListener.onSuccess();
}
return null;
}
DownloadTask downloadTask = new DownloadTask(needDownloadFirmware, new IJimuFileDownloadListener() { // from class: com.ubt.jimu.base.download.Downloader.4
private void deleteFirmware(Context context2, FirmwareVersion firmwareVersion) {
File parentFile = new File(FirmwareVersion.getPath(context2, firmwareVersion)).getParentFile();
if (parentFile.exists()) {
FileHelper.a(parentFile);
ALog.a(Downloader.TAG).d("删除已下载的固件:" + parentFile.getAbsolutePath());
}
}
@Override // com.ubt.jimu.base.download.IJimuFileDownloadListener
public void onBlockComplete(BaseDownloadTask baseDownloadTask) {
String url = baseDownloadTask.getUrl();
for (FirmwareVersion firmwareVersion : list) {
if (url.equals(firmwareVersion.getVersionPath())) {
if (FileHelper.a(firmwareVersion.getVersionCRCCode(), FirmwareVersion.getPath(context, firmwareVersion))) {
FirmwareVersionDbHandler.getInstance().insertOrUpdate(firmwareVersion);
return;
} else {
deleteFirmware(context, firmwareVersion);
return;
}
}
}
}
@Override // com.ubt.jimu.base.download.IJimuFileDownloadListener
public void onCompleted() {
IDownloadJimuRobotListener iDownloadJimuRobotListener2 = IDownloadJimuRobotListener.this;
if (iDownloadJimuRobotListener2 != null) {
iDownloadJimuRobotListener2.onProgress(1, 1, 100);
IDownloadJimuRobotListener.this.onSuccess();
}
ALog.a(Downloader.TAG).d("固件下载完成");
}
@Override // com.ubt.jimu.base.download.IJimuFileDownloadListener
public void onFailed(Throwable th) {
ALog.a(Downloader.TAG).d("固件下载失败");
FirmwareVersionDbHandler.getInstance().deleteInTx(list);
Iterator it = list.iterator();
while (it.hasNext()) {
deleteFirmware(context, (FirmwareVersion) it.next());
}
IDownloadJimuRobotListener iDownloadJimuRobotListener2 = IDownloadJimuRobotListener.this;
if (iDownloadJimuRobotListener2 != null) {
iDownloadJimuRobotListener2.onFailed();
}
}
@Override // com.ubt.jimu.base.download.IJimuFileDownloadListener
public void onProgress(int i, int i2, int i3) {
ALog.a(Downloader.TAG).d("总数:" + i + " 当前:" + i2 + " 进度:" + i3);
IDownloadJimuRobotListener iDownloadJimuRobotListener2 = IDownloadJimuRobotListener.this;
if (iDownloadJimuRobotListener2 != null) {
iDownloadJimuRobotListener2.onProgress(i, i2, i3);
}
}
});
downloadTask.start();
if (iDownloadJimuRobotListener != null) {
iDownloadJimuRobotListener.onPrepareStart();
ALog.a(TAG).d("开始下载固件");
}
return downloadTask;
}
public static DownloadTask downloadJimuCourse(final JimuCourse jimuCourse, final IDownloadJimuRobotListener iDownloadJimuRobotListener) {
if (jimuCourse == null) {
return null;
}
List<DownloadInfo> needDownloadCourse = DownloadInfo.getNeedDownloadCourse(jimuCourse);
if (needDownloadCourse == null || needDownloadCourse.size() == 0) {
iDownloadJimuRobotListener.onSuccess();
return null;
}
DownloadTask downloadTask = new DownloadTask(needDownloadCourse, new IJimuFileDownloadListener() { // from class: com.ubt.jimu.base.download.Downloader.3
@Override // com.ubt.jimu.base.download.IJimuFileDownloadListener
public void onBlockComplete(BaseDownloadTask baseDownloadTask) {
File file = new File(baseDownloadTask.w());
File file2 = new File(file.getParent() + File.separator + jimuCourse.getId());
if (file2.exists()) {
FileHelper.a(file2);
}
try {
FileHelper.a(baseDownloadTask.w(), file.getParent() + File.separator + jimuCourse.getId(), true);
file.delete();
JimuCourseDbHandler.updateAllUserCourseDownloaded(jimuCourse, true);
} catch (Exception e) {
e.printStackTrace();
ALog.a(Downloader.TAG).d("解压JimuCourse失败");
IDownloadJimuRobotListener iDownloadJimuRobotListener2 = IDownloadJimuRobotListener.this;
if (iDownloadJimuRobotListener2 != null) {
iDownloadJimuRobotListener2.onFailed();
}
}
}
@Override // com.ubt.jimu.base.download.IJimuFileDownloadListener
public void onCompleted() {
IDownloadJimuRobotListener iDownloadJimuRobotListener2 = IDownloadJimuRobotListener.this;
if (iDownloadJimuRobotListener2 != null) {
iDownloadJimuRobotListener2.onProgress(1, 1, 100);
IDownloadJimuRobotListener.this.onSuccess();
}
}
@Override // com.ubt.jimu.base.download.IJimuFileDownloadListener
public void onFailed(Throwable th) {
IDownloadJimuRobotListener iDownloadJimuRobotListener2 = IDownloadJimuRobotListener.this;
if (iDownloadJimuRobotListener2 != null) {
iDownloadJimuRobotListener2.onFailed();
}
}
@Override // com.ubt.jimu.base.download.IJimuFileDownloadListener
public void onProgress(int i, int i2, int i3) {
IDownloadJimuRobotListener iDownloadJimuRobotListener2 = IDownloadJimuRobotListener.this;
if (iDownloadJimuRobotListener2 != null) {
iDownloadJimuRobotListener2.onProgress(i, i2, i3);
}
}
});
if (iDownloadJimuRobotListener != null) {
iDownloadJimuRobotListener.onPrepareStart();
}
downloadTask.start();
return downloadTask;
}
public static DownloadTask downloadJimuRobot(final Robot robot, final IDownloadJimuRobotListener iDownloadJimuRobotListener) {
final ArrayList arrayList = new ArrayList();
DownloadInfo needDownloadModelInfo = DownloadInfo.getNeedDownloadModelInfo(robot);
if (needDownloadModelInfo != null) {
arrayList.add(needDownloadModelInfo);
}
List<DownloadInfo> newDownloadPartsInfo = DownloadInfo.getNewDownloadPartsInfo(robot);
if (newDownloadPartsInfo == null) {
if (iDownloadJimuRobotListener != null) {
iDownloadJimuRobotListener.onFailed();
}
return null;
}
if (newDownloadPartsInfo.size() > 0) {
arrayList.addAll(newDownloadPartsInfo);
}
if (arrayList.size() == 0) {
if (iDownloadJimuRobotListener != null) {
iDownloadJimuRobotListener.onSuccess();
}
return null;
}
DownloadTask downloadTask = new DownloadTask(arrayList, new IJimuFileDownloadListener() { // from class: com.ubt.jimu.base.download.Downloader.2
@Override // com.ubt.jimu.base.download.IJimuFileDownloadListener
public void onBlockComplete(BaseDownloadTask baseDownloadTask) {
if (baseDownloadTask.a() == null || !(baseDownloadTask.a() instanceof Integer)) {
return;
}
int intValue = ((Integer) baseDownloadTask.a()).intValue();
if (intValue == 0) {
Downloader.onModelBlockComplete(robot, baseDownloadTask);
return;
}
if (intValue == 1) {
Downloader.onPartBlockComplete(robot, baseDownloadTask);
} else if (intValue == 2) {
Downloader.onStoryCommonBlockComplete(robot, baseDownloadTask);
} else if (intValue == 3 || intValue != 4) {
}
}
@Override // com.ubt.jimu.base.download.IJimuFileDownloadListener
public void onCompleted() {
FileDownloadRecordDbHandler.writeRecord(robot.getModelId(), robot.getJarUrl(), (ExternalOverFroyoUtils.a(JimuApplication.l(), ModelType.DEFAULT) + robot.getModelName()) + ".zip", FileDownloadRecord.Type.Robot.getValue(), robot.getModelUpdateTime());
IDownloadJimuRobotListener iDownloadJimuRobotListener2 = IDownloadJimuRobotListener.this;
if (iDownloadJimuRobotListener2 != null) {
iDownloadJimuRobotListener2.onProgress(arrayList.size(), arrayList.size(), 100);
IDownloadJimuRobotListener.this.onSuccess();
}
}
@Override // com.ubt.jimu.base.download.IJimuFileDownloadListener
public void onFailed(Throwable th) {
IDownloadJimuRobotListener iDownloadJimuRobotListener2 = IDownloadJimuRobotListener.this;
if (iDownloadJimuRobotListener2 != null) {
iDownloadJimuRobotListener2.onFailed();
}
}
@Override // com.ubt.jimu.base.download.IJimuFileDownloadListener
public void onProgress(int i, int i2, int i3) {
IDownloadJimuRobotListener iDownloadJimuRobotListener2 = IDownloadJimuRobotListener.this;
if (iDownloadJimuRobotListener2 != null) {
iDownloadJimuRobotListener2.onProgress(i, i2, i3);
}
}
});
downloadTask.start();
if (iDownloadJimuRobotListener != null) {
iDownloadJimuRobotListener.onPrepareStart();
}
return downloadTask;
}
public static DownloadTask downloadStarCourse(final Story story, final IDownloadJimuRobotListener iDownloadJimuRobotListener) {
if (story == null) {
return null;
}
if (story.getIsLocked() > 0) {
if (iDownloadJimuRobotListener != null) {
iDownloadJimuRobotListener.onFailed();
}
return null;
}
final Context applicationContext = JimuApplication.l().getApplicationContext();
List<DownloadInfo> needDownloadStory = DownloadInfo.getNeedDownloadStory(applicationContext, story);
if (needDownloadStory == null || needDownloadStory.size() == 0) {
if (iDownloadJimuRobotListener != null) {
iDownloadJimuRobotListener.onSuccess();
}
return null;
}
if (!NetWorkUtil.b(applicationContext)) {
if (iDownloadJimuRobotListener != null) {
iDownloadJimuRobotListener.onFailed();
}
return null;
}
DownloadTask downloadTask = new DownloadTask(needDownloadStory, new IJimuFileDownloadListener() { // from class: com.ubt.jimu.base.download.Downloader.5
@Override // com.ubt.jimu.base.download.IJimuFileDownloadListener
public void onBlockComplete(BaseDownloadTask baseDownloadTask) {
Downloader.onStarCourseBlockComplete(Long.valueOf(story.getId()).longValue(), baseDownloadTask.getUrl(), Story.getSdcardSavePath(applicationContext, story.getResourceZip()), story.getUpdateTime());
}
@Override // com.ubt.jimu.base.download.IJimuFileDownloadListener
public void onCompleted() {
ALog.a(Downloader.TAG).d("文件下载成功:");
IDownloadJimuRobotListener iDownloadJimuRobotListener2 = IDownloadJimuRobotListener.this;
if (iDownloadJimuRobotListener2 != null) {
iDownloadJimuRobotListener2.onProgress(1, 1, 100);
IDownloadJimuRobotListener.this.onSuccess();
}
}
@Override // com.ubt.jimu.base.download.IJimuFileDownloadListener
public void onFailed(Throwable th) {
ALog.a(Downloader.TAG).d("文件下载失败:");
IDownloadJimuRobotListener iDownloadJimuRobotListener2 = IDownloadJimuRobotListener.this;
if (iDownloadJimuRobotListener2 != null) {
iDownloadJimuRobotListener2.onFailed();
}
}
@Override // com.ubt.jimu.base.download.IJimuFileDownloadListener
public void onProgress(int i, int i2, int i3) {
IDownloadJimuRobotListener iDownloadJimuRobotListener2 = IDownloadJimuRobotListener.this;
if (iDownloadJimuRobotListener2 != null) {
iDownloadJimuRobotListener2.onProgress(i, i2, i3);
}
ALog.a(Downloader.TAG).d("totalCount" + i + " current:" + i2 + " progress:" + i3);
}
});
if (iDownloadJimuRobotListener != null) {
iDownloadJimuRobotListener.onPrepareStart();
}
downloadTask.start();
return downloadTask;
}
/* JADX INFO: Access modifiers changed from: private */
public static void onModelBlockComplete(Robot robot, BaseDownloadTask baseDownloadTask) {
File file = new File(baseDownloadTask.w());
File file2 = new File(file.getParent() + File.separator + robot.getModelName());
if (file2.exists()) {
FileHelper.a(file2);
}
try {
FileHelper.a(baseDownloadTask.w(), file.getParent(), true);
robot.setDownload(true);
RobotDbHandler.setRobotDownloadState(robot);
file.delete();
} catch (Exception e) {
e.printStackTrace();
}
}
/* JADX INFO: Access modifiers changed from: private */
public static void onPartBlockComplete(Robot robot, BaseDownloadTask baseDownloadTask) {
for (PartFileInfo partFileInfo : robot.getComponentsFileInfos()) {
if (baseDownloadTask.getUrl().equals(partFileInfo.getAndroidFilePath())) {
new PartFileInfoDbHandler(DatabaseUtils.getDaoSession(true).r()).insertOrUpdate((PartFileInfoDbHandler) partFileInfo);
return;
}
}
}
/* JADX INFO: Access modifiers changed from: private */
public static void onStarCourseBlockComplete(long j, String str, String str2, long j2) {
File file = new File(str2);
String substring = str2.substring(str2.lastIndexOf("/") + 1, str2.lastIndexOf("."));
String parent = file.getParent();
File file2 = new File(parent, substring);
if (file2.exists()) {
file2.delete();
}
try {
FileHelper.a(str2, parent, true);
file.delete();
FileDownloadRecordDbHandler.writeRecord(j, str, str2, FileDownloadRecord.Type.Star_Course.getValue(), j2);
} catch (Exception e) {
e.printStackTrace();
}
}
/* JADX INFO: Access modifiers changed from: private */
public static void onStoryCommonBlockComplete(Robot robot, BaseDownloadTask baseDownloadTask) {
}
}

View File

@@ -0,0 +1,14 @@
package com.ubt.jimu.base.download;
import com.liulishuo.filedownloader.BaseDownloadTask;
/* loaded from: classes.dex */
public interface IJimuFileDownloadListener {
void onBlockComplete(BaseDownloadTask baseDownloadTask);
void onCompleted();
void onFailed(Throwable th);
void onProgress(int i, int i2, int i3);
}

View File

@@ -0,0 +1,86 @@
package com.ubt.jimu.base.download;
import android.util.Log;
import com.liulishuo.filedownloader.BaseDownloadTask;
import com.liulishuo.filedownloader.FileDownloadListener;
import com.liulishuo.filedownloader.FileDownloader;
import com.ubt.jimu.base.entities.Course;
/* loaded from: classes.dex */
class MyFileDownloadListener extends FileDownloadListener {
private IJimuFileDownloadListener downloadListener;
private volatile int needDownloadSize;
private final String TAG = MyFileDownloadListener.class.getSimpleName();
private int downloadedCount = 0;
public MyFileDownloadListener(int i, IJimuFileDownloadListener iJimuFileDownloadListener) {
this.needDownloadSize = i;
this.downloadListener = iJimuFileDownloadListener;
}
@Override // com.liulishuo.filedownloader.FileDownloadListener
protected void blockComplete(BaseDownloadTask baseDownloadTask) throws Throwable {
IJimuFileDownloadListener iJimuFileDownloadListener = this.downloadListener;
if (iJimuFileDownloadListener != null) {
iJimuFileDownloadListener.onBlockComplete(baseDownloadTask);
}
Log.i(this.TAG, "blockComplete:" + this.downloadedCount);
}
@Override // com.liulishuo.filedownloader.FileDownloadListener
protected void completed(BaseDownloadTask baseDownloadTask) {
IJimuFileDownloadListener iJimuFileDownloadListener;
Log.i(this.TAG, Course.STATUS_COMPLETED);
synchronized (this) {
this.downloadedCount++;
}
if (this.downloadedCount != this.needDownloadSize || (iJimuFileDownloadListener = this.downloadListener) == null) {
return;
}
iJimuFileDownloadListener.onCompleted();
}
@Override // com.liulishuo.filedownloader.FileDownloadListener
protected void error(BaseDownloadTask baseDownloadTask, Throwable th) {
Log.i(this.TAG, "error:" + th.getMessage() + " url=" + baseDownloadTask.getUrl());
FileDownloader.e().a(this);
IJimuFileDownloadListener iJimuFileDownloadListener = this.downloadListener;
if (iJimuFileDownloadListener != null) {
iJimuFileDownloadListener.onFailed(th);
}
}
@Override // com.liulishuo.filedownloader.FileDownloadListener
protected void paused(BaseDownloadTask baseDownloadTask, int i, int i2) {
Log.i(this.TAG, "paused");
}
@Override // com.liulishuo.filedownloader.FileDownloadListener
protected void pending(BaseDownloadTask baseDownloadTask, int i, int i2) {
Log.i(this.TAG, "pending");
}
@Override // com.liulishuo.filedownloader.FileDownloadListener
protected void progress(BaseDownloadTask baseDownloadTask, int i, int i2) {
IJimuFileDownloadListener iJimuFileDownloadListener = this.downloadListener;
if (iJimuFileDownloadListener != null) {
int i3 = (int) ((i / (i2 * 1.0f)) * 100.0f);
iJimuFileDownloadListener.onProgress(this.needDownloadSize, this.downloadedCount + 1, i3);
StringBuilder sb = new StringBuilder();
sb.append(this.downloadedCount + 1);
sb.append("/");
sb.append(this.needDownloadSize);
sb.append("(");
sb.append(i3);
sb.append(")");
sb.append("soFarBytes:" + i);
sb.append(" totalBytes:" + i2 + " int max2147483647");
Log.i(this.TAG, sb.toString());
}
}
@Override // com.liulishuo.filedownloader.FileDownloadListener
protected void warn(BaseDownloadTask baseDownloadTask) {
Log.i(this.TAG, "warn");
}
}

View File

@@ -0,0 +1,160 @@
package com.ubt.jimu.base.entities;
import java.util.List;
/* loaded from: classes.dex */
public class AArticle {
private int browseNum;
private int commentNum;
private String compressImagePath;
private long fileCreatedTime;
private String filePath;
private List<ArticleFileInfo> files;
private int isReleased;
private long modelId;
private String modelName;
private String nickName;
private int praiseNum;
private int shareNum;
private String userImage;
private String userName;
private String workDescription;
private int workId;
private String workName;
public int getBrowseNum() {
return this.browseNum;
}
public int getCommentNum() {
return this.commentNum;
}
public String getCompressImagePath() {
return this.compressImagePath;
}
public long getFileCreatedTime() {
return this.fileCreatedTime;
}
public String getFilePath() {
return this.filePath;
}
public List<ArticleFileInfo> getFiles() {
return this.files;
}
public int getIsReleased() {
return this.isReleased;
}
public long getModelId() {
return this.modelId;
}
public String getModelName() {
return this.modelName;
}
public String getNickName() {
return this.nickName;
}
public int getPraiseNum() {
return this.praiseNum;
}
public int getShareNum() {
return this.shareNum;
}
public String getUserImage() {
return this.userImage;
}
public String getUserName() {
return this.userName;
}
public String getWorkDescription() {
return this.workDescription;
}
public int getWorkId() {
return this.workId;
}
public String getWorkName() {
return this.workName;
}
public void setBrowseNum(int i) {
this.browseNum = i;
}
public void setCommentNum(int i) {
this.commentNum = i;
}
public void setCompressImagePath(String str) {
this.compressImagePath = str;
}
public void setFileCreatedTime(long j) {
this.fileCreatedTime = j;
}
public void setFilePath(String str) {
this.filePath = str;
}
public void setFiles(List<ArticleFileInfo> list) {
this.files = list;
}
public void setIsReleased(int i) {
this.isReleased = i;
}
public void setModelId(long j) {
this.modelId = j;
}
public void setModelName(String str) {
this.modelName = str;
}
public void setNickName(String str) {
this.nickName = str;
}
public void setPraiseNum(int i) {
this.praiseNum = i;
}
public void setShareNum(int i) {
this.shareNum = i;
}
public void setUserImage(String str) {
this.userImage = str;
}
public void setUserName(String str) {
this.userName = str;
}
public void setWorkDescription(String str) {
this.workDescription = str;
}
public void setWorkId(int i) {
this.workId = i;
}
public void setWorkName(String str) {
this.workName = str;
}
}

View File

@@ -0,0 +1,240 @@
package com.ubt.jimu.base.entities;
import android.text.TextUtils;
import java.io.Serializable;
import java.util.List;
/* loaded from: classes.dex */
public class Act implements Serializable {
private String activityDesc;
private int activityId;
private String activityStatus;
private int activityType;
private String award;
private String banner;
private int bannerType;
private String displayImage;
private long endTime;
private String heading;
private String listImage;
private long releaseTime;
private String rewardsName;
private long startTime;
private String subheading;
private List<String> userImages;
private String videoUrl;
private int workCount;
public enum ActivityType {
Image(1),
Video(2),
Program(3),
Robot(4);
private int type;
ActivityType(int i) {
this.type = i;
}
public int getType() {
return this.type;
}
public void setType(int i) {
this.type = i;
}
}
public enum BannerType {
Image(1),
Video(2);
private int type;
BannerType(int i) {
this.type = i;
}
public int getType() {
return this.type;
}
public void setType(int i) {
this.type = i;
}
}
public enum State {
Plan(1),
Unstart(2),
Running(3),
Awards(4),
Finished(5);
private int code;
State(int i) {
this.code = i;
}
public int getCode() {
return this.code;
}
public void setCode(int i) {
this.code = i;
}
}
public String getActivityDesc() {
return this.activityDesc;
}
public int getActivityId() {
return this.activityId;
}
public String getActivityStatus() {
return this.activityStatus;
}
public int getActivityType() {
return this.activityType;
}
public String getAward() {
return this.award;
}
public String getBanner() {
return this.banner;
}
public int getBannerType() {
return this.bannerType;
}
public String getDisplayImage() {
return this.displayImage;
}
public long getEndTime() {
return this.endTime;
}
public String getHeading() {
return this.heading;
}
public String getListImage() {
return this.listImage;
}
public long getReleaseTime() {
return this.releaseTime;
}
public String getRewardsName() {
return this.rewardsName;
}
public long getStartTime() {
return this.startTime;
}
public String getSubheading() {
return this.subheading;
}
public List<String> getUserImages() {
return this.userImages;
}
public String getVideoUrl() {
return this.videoUrl;
}
public int getWorkCount() {
return this.workCount;
}
public boolean isRunning() {
if (TextUtils.isEmpty(this.activityStatus)) {
return false;
}
return this.activityStatus.equals("Running");
}
public void setActivityDesc(String str) {
this.activityDesc = str;
}
public void setActivityId(int i) {
this.activityId = i;
}
public void setActivityStatus(String str) {
this.activityStatus = str;
}
public void setActivityType(int i) {
this.activityType = i;
}
public void setAward(String str) {
this.award = str;
}
public void setBanner(String str) {
this.banner = str;
}
public void setBannerType(int i) {
this.bannerType = i;
}
public void setDisplayImage(String str) {
this.displayImage = str;
}
public void setEndTime(long j) {
this.endTime = j;
}
public void setHeading(String str) {
this.heading = str;
}
public void setListImage(String str) {
this.listImage = str;
}
public void setReleaseTime(long j) {
this.releaseTime = j;
}
public void setRewardsName(String str) {
this.rewardsName = str;
}
public void setStartTime(long j) {
this.startTime = j;
}
public void setSubheading(String str) {
this.subheading = str;
}
public void setUserImages(List<String> list) {
this.userImages = list;
}
public void setVideoUrl(String str) {
this.videoUrl = str;
}
public void setWorkCount(int i) {
this.workCount = i;
}
}

View File

@@ -0,0 +1,456 @@
package com.ubt.jimu.base.entities;
import java.io.Serializable;
/* loaded from: classes.dex */
public class ActionResult implements Serializable {
public static final String KEY_ART = "capArt";
public static final String KEY_ENGINEER = "capEngineering";
public static final String KEY_MATH = "capMath";
public static final String KEY_SCIENCE = "capScience";
public static final String KEY_SPACE = "capSpace";
private int architect;
private int artist;
private int capArt;
private int capEngineering;
private int capMath;
private int capScience;
private int capSpace;
private AbValue course;
private int engineer;
private int exp;
private int flag;
private int isUpgrate;
private int programmer;
private int scientist;
private int score;
private AbValue task;
private AUser user;
public class AUser implements Serializable {
int capArt;
int capEngineering;
int capMath;
int capScience;
int capSpace;
int level;
int levelExtraScore;
int levelMaxValue;
int userExp;
int userScore;
String userTitle;
public AUser() {
}
public int getCapArt() {
return this.capArt;
}
public int getCapEngineering() {
return this.capEngineering;
}
public int getCapMath() {
return this.capMath;
}
public int getCapScience() {
return this.capScience;
}
public int getCapSpace() {
return this.capSpace;
}
public int getLevel() {
return this.level;
}
public int getLevelExtraScore() {
return this.levelExtraScore;
}
public int getLevelMaxValue() {
return this.levelMaxValue;
}
public int getUserExp() {
return this.userExp;
}
public int getUserScore() {
return this.userScore;
}
public String getUserTitle() {
return this.userTitle;
}
public void setCapArt(int i) {
this.capArt = i;
}
public void setCapEngineering(int i) {
this.capEngineering = i;
}
public void setCapMath(int i) {
this.capMath = i;
}
public void setCapScience(int i) {
this.capScience = i;
}
public void setCapSpace(int i) {
this.capSpace = i;
}
public void setLevel(int i) {
this.level = i;
}
public void setLevelExtraScore(int i) {
this.levelExtraScore = i;
}
public void setLevelMaxValue(int i) {
this.levelMaxValue = i;
}
public void setUserExp(int i) {
this.userExp = i;
}
public void setUserScore(int i) {
this.userScore = i;
}
public void setUserTitle(String str) {
this.userTitle = str;
}
}
public class AbValue implements Serializable {
private String address;
private String addressee;
private int capArt;
private int capEngineering;
private int capMath;
private int capScience;
private int capSpace;
private String contactInfo;
private int curExp;
private int emailValid;
private int exp;
private int expLength;
private int level;
private int levelMaxValue;
private int score;
private int userId;
public AbValue() {
}
public String getAddress() {
return this.address;
}
public String getAddressee() {
return this.addressee;
}
public int getCapArt() {
return this.capArt;
}
public int getCapEngineering() {
return this.capEngineering;
}
public int getCapMath() {
return this.capMath;
}
public int getCapScience() {
return this.capScience;
}
public int getCapSpace() {
return this.capSpace;
}
public String getContactInfo() {
return this.contactInfo;
}
public int getCurExp() {
return this.curExp;
}
public int getEmailValid() {
return this.emailValid;
}
public int getExp() {
return this.exp;
}
public int getExpLength() {
return this.expLength;
}
public int getLevel() {
return this.level;
}
public int getLevelMaxValue() {
return this.levelMaxValue;
}
public int getScore() {
return this.score;
}
public int getUpgradeCount() {
int i = this.capArt > 0 ? 1 : 0;
if (this.capScience > 0) {
i++;
}
if (this.capSpace > 0) {
i++;
}
if (this.capMath > 0) {
i++;
}
return this.capEngineering > 0 ? i + 1 : i;
}
public int getUserId() {
return this.userId;
}
public boolean hasZeroValue() {
return this.capArt == 0 || this.capScience == 0 || this.capSpace == 0 || this.capMath == 0 || this.capEngineering == 0;
}
public void setAddress(String str) {
this.address = str;
}
public void setAddressee(String str) {
this.addressee = str;
}
public void setCapArt(int i) {
this.capArt = i;
}
public void setCapEngineering(int i) {
this.capEngineering = i;
}
public void setCapMath(int i) {
this.capMath = i;
}
public void setCapScience(int i) {
this.capScience = i;
}
public void setCapSpace(int i) {
this.capSpace = i;
}
public void setContactInfo(String str) {
this.contactInfo = str;
}
public void setCurExp(int i) {
this.curExp = i;
}
public void setEmailValid(int i) {
this.emailValid = i;
}
public void setExp(int i) {
this.exp = i;
}
public void setExpLength(int i) {
this.expLength = i;
}
public void setLevel(int i) {
this.level = i;
}
public void setLevelMaxValue(int i) {
this.levelMaxValue = i;
}
public void setScore(int i) {
this.score = i;
}
public void setUserId(int i) {
this.userId = i;
}
public String toString() {
return "AbValue{capArt=" + this.capArt + ", exp=" + this.exp + ", capScience=" + this.capScience + ", capSpace=" + this.capSpace + ", capMath=" + this.capMath + ", score=" + this.score + ", capEngineering=" + this.capEngineering + ", userId=" + this.userId + ", level=" + this.level + ", levelMaxValue=" + this.levelMaxValue + '}';
}
}
public int getArchitect() {
return this.architect;
}
public int getArtist() {
return this.artist;
}
public int getCapArt() {
return this.capArt;
}
public int getCapEngineering() {
return this.capEngineering;
}
public int getCapMath() {
return this.capMath;
}
public int getCapScience() {
return this.capScience;
}
public int getCapSpace() {
return this.capSpace;
}
public int getChangedCount() {
int i = this.architect == 1 ? 1 : 0;
if (this.programmer == 1) {
i++;
}
if (this.engineer == 1) {
i++;
}
if (this.scientist == 1) {
i++;
}
return this.artist == 1 ? i + 1 : i;
}
public AbValue getCourse() {
return this.course;
}
public int getEngineer() {
return this.engineer;
}
public int getExp() {
return this.exp;
}
public int getFlag() {
return this.flag;
}
public int getIsUpgrate() {
return this.isUpgrate;
}
public int getProgrammer() {
return this.programmer;
}
public int getScientist() {
return this.scientist;
}
public int getScore() {
return this.score;
}
public AbValue getTask() {
return this.task;
}
public AUser getUser() {
return this.user;
}
public void setArchitect(int i) {
this.architect = i;
}
public void setArtist(int i) {
this.artist = i;
}
public void setCapArt(int i) {
this.capArt = i;
}
public void setCapEngineering(int i) {
this.capEngineering = i;
}
public void setCapMath(int i) {
this.capMath = i;
}
public void setCapScience(int i) {
this.capScience = i;
}
public void setCapSpace(int i) {
this.capSpace = i;
}
public void setCourse(AbValue abValue) {
this.course = abValue;
}
public void setEngineer(int i) {
this.engineer = i;
}
public void setExp(int i) {
this.exp = i;
}
public void setFlag(int i) {
this.flag = i;
}
public void setIsUpgrate(int i) {
this.isUpgrate = i;
}
public void setProgrammer(int i) {
this.programmer = i;
}
public void setScientist(int i) {
this.scientist = i;
}
public void setScore(int i) {
this.score = i;
}
public void setTask(AbValue abValue) {
this.task = abValue;
}
public void setUser(AUser aUser) {
this.user = aUser;
}
}

View File

@@ -0,0 +1,8 @@
package com.ubt.jimu.base.entities;
/* loaded from: classes.dex */
public class ActiveStat {
public long activeTime;
public String equipmentUid;
public String serialNumber;
}

View File

@@ -0,0 +1,43 @@
package com.ubt.jimu.base.entities;
import java.io.Serializable;
/* loaded from: classes.dex */
public class AddressInfo implements Serializable {
private String address;
private String addressee;
private String contactInfo;
private int userId;
public String getAddress() {
return this.address;
}
public String getAddressee() {
return this.addressee;
}
public String getContactInfo() {
return this.contactInfo;
}
public int getUserId() {
return this.userId;
}
public void setAddress(String str) {
this.address = str;
}
public void setAddressee(String str) {
this.addressee = str;
}
public void setContactInfo(String str) {
this.contactInfo = str;
}
public void setUserId(int i) {
this.userId = i;
}
}

View File

@@ -0,0 +1,52 @@
package com.ubt.jimu.base.entities;
import java.util.List;
/* loaded from: classes.dex */
public class ApiRecord<T> {
private int current;
private int pages;
private List<T> records;
private int size;
private int total;
public int getCurrent() {
return this.current;
}
public int getPages() {
return this.pages;
}
public List<T> getRecords() {
return this.records;
}
public int getSize() {
return this.size;
}
public int getTotal() {
return this.total;
}
public void setCurrent(int i) {
this.current = i;
}
public void setPages(int i) {
this.pages = i;
}
public void setRecords(List<T> list) {
this.records = list;
}
public void setSize(int i) {
this.size = i;
}
public void setTotal(int i) {
this.total = i;
}
}

View File

@@ -0,0 +1,34 @@
package com.ubt.jimu.base.entities;
import java.util.List;
/* loaded from: classes.dex */
public class ApiResult<T> {
private String info;
private List<T> models;
private boolean status;
public String getInfo() {
return this.info;
}
public List<T> getModels() {
return this.models;
}
public boolean isStatus() {
return this.status;
}
public void setInfo(String str) {
this.info = str;
}
public void setModels(List<T> list) {
this.models = list;
}
public void setStatus(boolean z) {
this.status = z;
}
}

View File

@@ -0,0 +1,25 @@
package com.ubt.jimu.base.entities;
import java.io.Serializable;
/* loaded from: classes.dex */
public class ApiStatus implements Serializable {
private int code;
private String message;
public int getCode() {
return this.code;
}
public String getMessage() {
return this.message;
}
public void setCode(int i) {
this.code = i;
}
public void setMessage(String str) {
this.message = str;
}
}

View File

@@ -0,0 +1,112 @@
package com.ubt.jimu.base.entities;
import java.util.List;
/* loaded from: classes.dex */
public class ArticleBean {
private int current;
private int pages;
private List<Article> records;
private int size;
private int total;
public class Article {
private int activityId;
private String browseNum;
private String content;
private int id;
private List<JImage> imgLsit;
private String title;
public Article() {
}
public int getActivityId() {
return this.activityId;
}
public String getBrowseNum() {
return this.browseNum;
}
public String getContent() {
return this.content;
}
public int getId() {
return this.id;
}
public List<JImage> getImgLsit() {
return this.imgLsit;
}
public String getTitle() {
return this.title;
}
public void setActivityId(int i) {
this.activityId = i;
}
public void setBrowseNum(String str) {
this.browseNum = str;
}
public void setContent(String str) {
this.content = str;
}
public void setId(int i) {
this.id = i;
}
public void setImgLsit(List<JImage> list) {
this.imgLsit = list;
}
public void setTitle(String str) {
this.title = str;
}
}
public int getCurrent() {
return this.current;
}
public int getPages() {
return this.pages;
}
public List<Article> getRecords() {
return this.records;
}
public int getSize() {
return this.size;
}
public int getTotal() {
return this.total;
}
public void setCurrent(int i) {
this.current = i;
}
public void setPages(int i) {
this.pages = i;
}
public void setRecords(List<Article> list) {
this.records = list;
}
public void setSize(int i) {
this.size = i;
}
public void setTotal(int i) {
this.total = i;
}
}

View File

@@ -0,0 +1,16 @@
package com.ubt.jimu.base.entities;
/* loaded from: classes.dex */
public class ArticleFileInfo {
public static final String TYPE_IMAGE = "1";
public static final String TYPE_VIDEO = "3";
public int fileId;
public String fileName;
public String filePath;
public String fileString;
public String fileType;
public int modelId;
public int orderNum;
public String sourcePath;
public int userId;
}

View File

@@ -0,0 +1,106 @@
package com.ubt.jimu.base.entities;
import java.io.Serializable;
/* loaded from: classes.dex */
public class Award implements Serializable {
private int activityId;
private String award;
private String awardsDesc;
private long createTime;
private int empiricalValue;
private int orderId;
private int quantity;
private int rewardsId;
private String rewardsName;
private int score;
private long updateTime;
public int getActivityId() {
return this.activityId;
}
public String getAward() {
return this.award;
}
public String getAwardsDesc() {
return this.awardsDesc;
}
public long getCreateTime() {
return this.createTime;
}
public int getEmpiricalValue() {
return this.empiricalValue;
}
public int getOrderId() {
return this.orderId;
}
public int getQuantity() {
return this.quantity;
}
public int getRewardsId() {
return this.rewardsId;
}
public String getRewardsName() {
return this.rewardsName;
}
public int getScore() {
return this.score;
}
public long getUpdateTime() {
return this.updateTime;
}
public void setActivityId(int i) {
this.activityId = i;
}
public void setAward(String str) {
this.award = str;
}
public void setAwardsDesc(String str) {
this.awardsDesc = str;
}
public void setCreateTime(long j) {
this.createTime = j;
}
public void setEmpiricalValue(int i) {
this.empiricalValue = i;
}
public void setOrderId(int i) {
this.orderId = i;
}
public void setQuantity(int i) {
this.quantity = i;
}
public void setRewardsId(int i) {
this.rewardsId = i;
}
public void setRewardsName(String str) {
this.rewardsName = str;
}
public void setScore(int i) {
this.score = i;
}
public void setUpdateTime(long j) {
this.updateTime = j;
}
}

View File

@@ -0,0 +1,70 @@
package com.ubt.jimu.base.entities;
import java.util.List;
/* loaded from: classes.dex */
public class AwardItem {
private int activityId;
private List<AArticle> articles;
private int awardsId;
private int orderId;
private int quantity;
private int rewardsId;
private String rewardsName;
public int getActivityId() {
return this.activityId;
}
public List<AArticle> getArticles() {
return this.articles;
}
public int getAwardsId() {
return this.awardsId;
}
public int getOrderId() {
return this.orderId;
}
public int getQuantity() {
return this.quantity;
}
public int getRewardsId() {
return this.rewardsId;
}
public String getRewardsName() {
return this.rewardsName;
}
public void setActivityId(int i) {
this.activityId = i;
}
public void setArticles(List<AArticle> list) {
this.articles = list;
}
public void setAwardsId(int i) {
this.awardsId = i;
}
public void setOrderId(int i) {
this.orderId = i;
}
public void setQuantity(int i) {
this.quantity = i;
}
public void setRewardsId(int i) {
this.rewardsId = i;
}
public void setRewardsName(String str) {
this.rewardsName = str;
}
}

View File

@@ -0,0 +1,32 @@
package com.ubt.jimu.base.entities;
import java.io.Serializable;
@Deprecated
/* loaded from: classes.dex */
public class Collect implements Serializable {
private static final long serialVersionUID = 1;
private String targetImage;
private String targetTitle;
public Collect(String str, String str2) {
this.targetTitle = str;
this.targetImage = str2;
}
public String getTargetImage() {
return this.targetImage;
}
public String getTargetTitle() {
return this.targetTitle;
}
public void setTargetImage(String str) {
this.targetImage = str;
}
public void setTargetTitle(String str) {
this.targetTitle = str;
}
}

View File

@@ -0,0 +1,448 @@
package com.ubt.jimu.base.entities;
import java.util.List;
/* loaded from: classes.dex */
public class CollectionEntities {
private int current;
private int pages;
private List<RecordsBean> records;
private int size;
private int total;
public static class RecordsBean {
private int activityId;
private int browseNum;
private int collectNum;
private int commentNum;
private int complainNum;
private String content;
private int countryCode;
private long createTime;
private int createUser;
private int id;
private List<ImgLsitBean> imgLsit;
private int isChoice;
private int isCreative;
private int isDeleted;
private boolean isSelect = false;
private String postCoverName;
private String postCoverUrl;
private int postIcon;
private int praiseNum;
private int product;
private String resourceUrl;
private int shareNum;
private int status;
private String tags;
private String title;
private UserBaseInfoBean userBaseInfo;
public static class ImgLsitBean {
private long createTime;
private String description;
private Object fileName;
private String fileUrl;
private int id;
private int isDeleted;
private Object order;
private int postId;
private int type;
private Object userId;
public long getCreateTime() {
return this.createTime;
}
public String getDescription() {
return this.description;
}
public Object getFileName() {
return this.fileName;
}
public String getFileUrl() {
return this.fileUrl;
}
public int getId() {
return this.id;
}
public int getIsDeleted() {
return this.isDeleted;
}
public Object getOrder() {
return this.order;
}
public int getPostId() {
return this.postId;
}
public int getType() {
return this.type;
}
public Object getUserId() {
return this.userId;
}
public void setCreateTime(long j) {
this.createTime = j;
}
public void setDescription(String str) {
this.description = str;
}
public void setFileName(Object obj) {
this.fileName = obj;
}
public void setFileUrl(String str) {
this.fileUrl = str;
}
public void setId(int i) {
this.id = i;
}
public void setIsDeleted(int i) {
this.isDeleted = i;
}
public void setOrder(Object obj) {
this.order = obj;
}
public void setPostId(int i) {
this.postId = i;
}
public void setType(int i) {
this.type = i;
}
public void setUserId(Object obj) {
this.userId = obj;
}
}
public static class UserBaseInfoBean {
private Object descKey;
private int level;
private String nickName;
private Object titleKey;
private int userId;
private String userImage;
private String userName;
public Object getDescKey() {
return this.descKey;
}
public int getLevel() {
return this.level;
}
public String getNickName() {
return this.nickName;
}
public Object getTitleKey() {
return this.titleKey;
}
public int getUserId() {
return this.userId;
}
public String getUserImage() {
return this.userImage;
}
public String getUserName() {
return this.userName;
}
public void setDescKey(Object obj) {
this.descKey = obj;
}
public void setLevel(int i) {
this.level = i;
}
public void setNickName(String str) {
this.nickName = str;
}
public void setTitleKey(Object obj) {
this.titleKey = obj;
}
public void setUserId(int i) {
this.userId = i;
}
public void setUserImage(String str) {
this.userImage = str;
}
public void setUserName(String str) {
this.userName = str;
}
}
public int getActivityId() {
return this.activityId;
}
public int getBrowseNum() {
return this.browseNum;
}
public int getCollectNum() {
return this.collectNum;
}
public int getCommentNum() {
return this.commentNum;
}
public int getComplainNum() {
return this.complainNum;
}
public String getContent() {
return this.content;
}
public int getCountryCode() {
return this.countryCode;
}
public long getCreateTime() {
return this.createTime;
}
public int getCreateUser() {
return this.createUser;
}
public int getId() {
return this.id;
}
public List<ImgLsitBean> getImgLsit() {
return this.imgLsit;
}
public int getIsChoice() {
return this.isChoice;
}
public int getIsCreative() {
return this.isCreative;
}
public int getIsDeleted() {
return this.isDeleted;
}
public String getPostCoverName() {
return this.postCoverName;
}
public String getPostCoverUrl() {
return this.postCoverUrl;
}
public int getPostIcon() {
return this.postIcon;
}
public int getPraiseNum() {
return this.praiseNum;
}
public int getProduct() {
return this.product;
}
public String getResourceUrl() {
return this.resourceUrl;
}
public int getShareNum() {
return this.shareNum;
}
public int getStatus() {
return this.status;
}
public Object getTags() {
return this.tags;
}
public String getTitle() {
return this.title;
}
public UserBaseInfoBean getUserBaseInfo() {
return this.userBaseInfo;
}
public boolean isSelect() {
return this.isSelect;
}
public void setActivityId(int i) {
this.activityId = i;
}
public void setBrowseNum(int i) {
this.browseNum = i;
}
public void setCollectNum(int i) {
this.collectNum = i;
}
public void setCommentNum(int i) {
this.commentNum = i;
}
public void setComplainNum(int i) {
this.complainNum = i;
}
public void setContent(String str) {
this.content = str;
}
public void setCountryCode(int i) {
this.countryCode = i;
}
public void setCreateTime(long j) {
this.createTime = j;
}
public void setCreateUser(int i) {
this.createUser = i;
}
public void setId(int i) {
this.id = i;
}
public void setImgLsit(List<ImgLsitBean> list) {
this.imgLsit = list;
}
public void setIsChoice(int i) {
this.isChoice = i;
}
public void setIsCreative(int i) {
this.isCreative = i;
}
public void setIsDeleted(int i) {
this.isDeleted = i;
}
public void setPostCoverName(String str) {
this.postCoverName = str;
}
public void setPostCoverUrl(String str) {
this.postCoverUrl = str;
}
public void setPostIcon(int i) {
this.postIcon = i;
}
public void setPraiseNum(int i) {
this.praiseNum = i;
}
public void setProduct(int i) {
this.product = i;
}
public void setResourceUrl(String str) {
this.resourceUrl = str;
}
public void setSelect(boolean z) {
this.isSelect = z;
}
public void setShareNum(int i) {
this.shareNum = i;
}
public void setStatus(int i) {
this.status = i;
}
public void setTags(String str) {
this.tags = str;
}
public void setTitle(String str) {
this.title = str;
}
public void setUserBaseInfo(UserBaseInfoBean userBaseInfoBean) {
this.userBaseInfo = userBaseInfoBean;
}
}
public int getCurrent() {
return this.current;
}
public int getPages() {
return this.pages;
}
public List<RecordsBean> getRecords() {
return this.records;
}
public int getSize() {
return this.size;
}
public int getTotal() {
return this.total;
}
public void setCurrent(int i) {
this.current = i;
}
public void setPages(int i) {
this.pages = i;
}
public void setRecords(List<RecordsBean> list) {
this.records = list;
}
public void setSize(int i) {
this.size = i;
}
public void setTotal(int i) {
this.total = i;
}
}

View File

@@ -0,0 +1,145 @@
package com.ubt.jimu.base.entities;
import java.util.List;
/* loaded from: classes.dex */
public class CommentBean {
private int current;
private int pages;
private List<RecordsBean> records;
private int size;
private int total;
public static class RecordsBean {
private String author;
private String content;
private long createTime;
private int id;
private int postId;
private int replyTo;
private String replyUser;
private int type;
private int userId;
private String userImage;
public String getAuthor() {
return this.author;
}
public String getContent() {
return this.content;
}
public long getCreateTime() {
return this.createTime;
}
public int getId() {
return this.id;
}
public int getPostId() {
return this.postId;
}
public int getReplyTo() {
return this.replyTo;
}
public String getReplyUser() {
return this.replyUser;
}
public int getType() {
return this.type;
}
public int getUserId() {
return this.userId;
}
public String getUserImage() {
return this.userImage;
}
public void setAuthor(String str) {
this.author = str;
}
public void setContent(String str) {
this.content = str;
}
public void setCreateTime(long j) {
this.createTime = j;
}
public void setId(int i) {
this.id = i;
}
public void setPostId(int i) {
this.postId = i;
}
public void setReplyTo(int i) {
this.replyTo = i;
}
public void setReplyUser(String str) {
this.replyUser = str;
}
public void setType(int i) {
this.type = i;
}
public void setUserId(int i) {
this.userId = i;
}
public void setUserImage(String str) {
this.userImage = str;
}
}
public int getCurrent() {
return this.current;
}
public int getPages() {
return this.pages;
}
public List<RecordsBean> getRecords() {
return this.records;
}
public int getSize() {
return this.size;
}
public int getTotal() {
return this.total;
}
public void setCurrent(int i) {
this.current = i;
}
public void setPages(int i) {
this.pages = i;
}
public void setRecords(List<RecordsBean> list) {
this.records = list;
}
public void setSize(int i) {
this.size = i;
}
public void setTotal(int i) {
this.total = i;
}
}

View File

@@ -0,0 +1,86 @@
package com.ubt.jimu.base.entities;
/* loaded from: classes.dex */
public class CommentEntities {
private String content;
private String createTime;
private int id;
private String isDeleted;
private int postId;
private int product;
private int replyTo;
private int type;
private int userId;
public String getContent() {
return this.content;
}
public String getCreateTime() {
return this.createTime;
}
public int getId() {
return this.id;
}
public String getIsDeleted() {
return this.isDeleted;
}
public int getPostId() {
return this.postId;
}
public int getProduct() {
return this.product;
}
public int getReplyTo() {
return this.replyTo;
}
public int getType() {
return this.type;
}
public int getUserId() {
return this.userId;
}
public void setContent(String str) {
this.content = str;
}
public void setCreateTime(String str) {
this.createTime = str;
}
public void setId(int i) {
this.id = i;
}
public void setIsDeleted(String str) {
this.isDeleted = str;
}
public void setPostId(int i) {
this.postId = i;
}
public void setProduct(int i) {
this.product = i;
}
public void setReplyTo(int i) {
this.replyTo = i;
}
public void setType(int i) {
this.type = i;
}
public void setUserId(int i) {
this.userId = i;
}
}

View File

@@ -0,0 +1,875 @@
package com.ubt.jimu.base.entities;
import java.io.Serializable;
import java.util.List;
/* loaded from: classes.dex */
public class CommunityReturnBean implements Serializable {
private String choicestCoverUrl;
private ChoiestPostBean choiestPost;
private String creativeCoverUrl;
private int curExp;
private int expLength;
private String favouriteCoverUrl;
private List<HotPostsBean> hotPosts;
private int level;
private String nickName;
private int score;
private List<ScrollbarBean> scrollbar;
private List<SectionsBean> sections;
private String title;
private String userImage;
private int viewUserId;
public static class ChoiestPostBean {
private String content;
private int id;
private String nickName;
private String title;
public String getContent() {
return this.content;
}
public int getId() {
return this.id;
}
public String getNickName() {
return this.nickName;
}
public String getTitle() {
return this.title;
}
public void setContent(String str) {
this.content = str;
}
public void setId(int i) {
this.id = i;
}
public void setNickName(String str) {
this.nickName = str;
}
public void setTitle(String str) {
this.title = str;
}
}
public static class HotPostsBean {
private int activityId;
private int browseNum;
private int collectNum;
private int commentNum;
private int complainNum;
private Object content;
private String countryCode;
private long createTime;
private int createUser;
private int id;
private List<ImgLsitBean> imgLsit;
private int isChoice;
private Object isCreative;
private int isDeleted;
private Object postCoverName;
private Object postCoverUrl;
private int postIcon;
private int praiseNum;
private Object product;
private Object resourceUrl;
private int shareNum;
private int status;
private Object tags;
private String title;
private UserBaseInfoBean userBaseInfo;
public static class ImgLsitBean implements Serializable {
private long createTime;
private String description;
private Object fileName;
private String fileUrl;
private int id;
private int isDeleted;
private Object order;
private int postId;
private int type;
private Object userId;
public long getCreateTime() {
return this.createTime;
}
public String getDescription() {
return this.description;
}
public Object getFileName() {
return this.fileName;
}
public String getFileUrl() {
return this.fileUrl;
}
public int getId() {
return this.id;
}
public int getIsDeleted() {
return this.isDeleted;
}
public Object getOrder() {
return this.order;
}
public int getPostId() {
return this.postId;
}
public int getType() {
return this.type;
}
public Object getUserId() {
return this.userId;
}
public void setCreateTime(long j) {
this.createTime = j;
}
public void setDescription(String str) {
this.description = str;
}
public void setFileName(Object obj) {
this.fileName = obj;
}
public void setFileUrl(String str) {
this.fileUrl = str;
}
public void setId(int i) {
this.id = i;
}
public void setIsDeleted(int i) {
this.isDeleted = i;
}
public void setOrder(Object obj) {
this.order = obj;
}
public void setPostId(int i) {
this.postId = i;
}
public void setType(int i) {
this.type = i;
}
public void setUserId(Object obj) {
this.userId = obj;
}
}
public static class UserBaseInfoBean implements Serializable {
private Object descKey;
private int level;
private Object nickName;
private String titleKey;
private int userId;
private Object userImage;
private Object userName;
public Object getDescKey() {
return this.descKey;
}
public int getLevel() {
return this.level;
}
public Object getNickName() {
return this.nickName;
}
public String getTitleKey() {
return this.titleKey;
}
public int getUserId() {
return this.userId;
}
public Object getUserImage() {
return this.userImage;
}
public Object getUserName() {
return this.userName;
}
public void setDescKey(Object obj) {
this.descKey = obj;
}
public void setLevel(int i) {
this.level = i;
}
public void setNickName(Object obj) {
this.nickName = obj;
}
public void setTitleKey(String str) {
this.titleKey = str;
}
public void setUserId(int i) {
this.userId = i;
}
public void setUserImage(Object obj) {
this.userImage = obj;
}
public void setUserName(Object obj) {
this.userName = obj;
}
}
public int getActivityId() {
return this.activityId;
}
public int getBrowseNum() {
return this.browseNum;
}
public int getCollectNum() {
return this.collectNum;
}
public int getCommentNum() {
return this.commentNum;
}
public int getComplainNum() {
return this.complainNum;
}
public Object getContent() {
return this.content;
}
public String getCountryCode() {
return this.countryCode;
}
public long getCreateTime() {
return this.createTime;
}
public int getCreateUser() {
return this.createUser;
}
public int getId() {
return this.id;
}
public List<ImgLsitBean> getImgLsit() {
return this.imgLsit;
}
public int getIsChoice() {
return this.isChoice;
}
public Object getIsCreative() {
return this.isCreative;
}
public int getIsDeleted() {
return this.isDeleted;
}
public Object getPostCoverName() {
return this.postCoverName;
}
public Object getPostCoverUrl() {
return this.postCoverUrl;
}
public int getPostIcon() {
return this.postIcon;
}
public int getPraiseNum() {
return this.praiseNum;
}
public Object getProduct() {
return this.product;
}
public Object getResourceUrl() {
return this.resourceUrl;
}
public int getShareNum() {
return this.shareNum;
}
public int getStatus() {
return this.status;
}
public Object getTags() {
return this.tags;
}
public String getTitle() {
return this.title;
}
public UserBaseInfoBean getUserBaseInfo() {
return this.userBaseInfo;
}
public void setActivityId(int i) {
this.activityId = i;
}
public void setBrowseNum(int i) {
this.browseNum = i;
}
public void setCollectNum(int i) {
this.collectNum = i;
}
public void setCommentNum(int i) {
this.commentNum = i;
}
public void setComplainNum(int i) {
this.complainNum = i;
}
public void setContent(Object obj) {
this.content = obj;
}
public void setCountryCode(String str) {
this.countryCode = str;
}
public void setCreateTime(long j) {
this.createTime = j;
}
public void setCreateUser(int i) {
this.createUser = i;
}
public void setId(int i) {
this.id = i;
}
public void setImgLsit(List<ImgLsitBean> list) {
this.imgLsit = list;
}
public void setIsChoice(int i) {
this.isChoice = i;
}
public void setIsCreative(Object obj) {
this.isCreative = obj;
}
public void setIsDeleted(int i) {
this.isDeleted = i;
}
public void setPostCoverName(Object obj) {
this.postCoverName = obj;
}
public void setPostCoverUrl(Object obj) {
this.postCoverUrl = obj;
}
public void setPostIcon(int i) {
this.postIcon = i;
}
public void setPraiseNum(int i) {
this.praiseNum = i;
}
public void setProduct(Object obj) {
this.product = obj;
}
public void setResourceUrl(Object obj) {
this.resourceUrl = obj;
}
public void setShareNum(int i) {
this.shareNum = i;
}
public void setStatus(int i) {
this.status = i;
}
public void setTags(Object obj) {
this.tags = obj;
}
public void setTitle(String str) {
this.title = str;
}
public void setUserBaseInfo(UserBaseInfoBean userBaseInfoBean) {
this.userBaseInfo = userBaseInfoBean;
}
}
public static class ScrollbarBean implements Serializable {
private Object appVersion;
private int createdBy;
private long createdTime;
private int displayOrder;
private int id;
private int imageHeight;
private String imageUrl;
private int imageWidth;
private int isDeleted;
private Object key;
private String link;
private String name;
private Object product;
private int sourceId;
private String sourceType;
private String systemLanguage;
private String type;
private int updatedBy;
private long updatedTime;
public Object getAppVersion() {
return this.appVersion;
}
public int getCreatedBy() {
return this.createdBy;
}
public long getCreatedTime() {
return this.createdTime;
}
public int getDisplayOrder() {
return this.displayOrder;
}
public int getId() {
return this.id;
}
public int getImageHeight() {
return this.imageHeight;
}
public String getImageUrl() {
return this.imageUrl;
}
public int getImageWidth() {
return this.imageWidth;
}
public int getIsDeleted() {
return this.isDeleted;
}
public Object getKey() {
return this.key;
}
public String getLink() {
return this.link;
}
public String getName() {
return this.name;
}
public Object getProduct() {
return this.product;
}
public int getSourceId() {
return this.sourceId;
}
public String getSourceType() {
return this.sourceType;
}
public String getSystemLanguage() {
return this.systemLanguage;
}
public String getType() {
return this.type;
}
public int getUpdatedBy() {
return this.updatedBy;
}
public long getUpdatedTime() {
return this.updatedTime;
}
public void setAppVersion(Object obj) {
this.appVersion = obj;
}
public void setCreatedBy(int i) {
this.createdBy = i;
}
public void setCreatedTime(long j) {
this.createdTime = j;
}
public void setDisplayOrder(int i) {
this.displayOrder = i;
}
public void setId(int i) {
this.id = i;
}
public void setImageHeight(int i) {
this.imageHeight = i;
}
public void setImageUrl(String str) {
this.imageUrl = str;
}
public void setImageWidth(int i) {
this.imageWidth = i;
}
public void setIsDeleted(int i) {
this.isDeleted = i;
}
public void setKey(Object obj) {
this.key = obj;
}
public void setLink(String str) {
this.link = str;
}
public void setName(String str) {
this.name = str;
}
public void setProduct(Object obj) {
this.product = obj;
}
public void setSourceId(int i) {
this.sourceId = i;
}
public void setSourceType(String str) {
this.sourceType = str;
}
public void setSystemLanguage(String str) {
this.systemLanguage = str;
}
public void setType(String str) {
this.type = str;
}
public void setUpdatedBy(int i) {
this.updatedBy = i;
}
public void setUpdatedTime(long j) {
this.updatedTime = j;
}
}
public static class SectionsBean implements Serializable {
private List<ContentsBean> contents;
private int displayOrder;
private int id;
private String name;
public static class ContentsBean implements Serializable {
private Object content;
private int createUser;
private int id;
private String nickName;
private String postCoverName;
private String postCoverUrl;
private int postIcon;
private String tags;
private String title;
private String userImage;
public Object getContent() {
return this.content;
}
public int getCreateUser() {
return this.createUser;
}
public int getId() {
return this.id;
}
public String getNickName() {
return this.nickName;
}
public String getPostCoverName() {
return this.postCoverName;
}
public String getPostCoverUrl() {
return this.postCoverUrl;
}
public int getPostIcon() {
return this.postIcon;
}
public String getTags() {
return this.tags;
}
public String getTitle() {
return this.title;
}
public String getUserImage() {
return this.userImage;
}
public void setContent(Object obj) {
this.content = obj;
}
public void setCreateUser(int i) {
this.createUser = i;
}
public void setId(int i) {
this.id = i;
}
public void setNickName(String str) {
this.nickName = str;
}
public void setPostCoverName(String str) {
this.postCoverName = str;
}
public void setPostCoverUrl(String str) {
this.postCoverUrl = str;
}
public void setPostIcon(int i) {
this.postIcon = i;
}
public void setTags(String str) {
this.tags = str;
}
public void setTitle(String str) {
this.title = str;
}
public void setUserImage(String str) {
this.userImage = str;
}
}
public List<ContentsBean> getContents() {
return this.contents;
}
public int getDisplayOrder() {
return this.displayOrder;
}
public int getId() {
return this.id;
}
public String getName() {
return this.name;
}
public void setContents(List<ContentsBean> list) {
this.contents = list;
}
public void setDisplayOrder(int i) {
this.displayOrder = i;
}
public void setId(int i) {
this.id = i;
}
public void setName(String str) {
this.name = str;
}
}
public String getChoicestCoverUrl() {
return this.choicestCoverUrl;
}
public ChoiestPostBean getChoiestPost() {
return this.choiestPost;
}
public String getCreativeCoverUrl() {
return this.creativeCoverUrl;
}
public int getCurExp() {
return this.curExp;
}
public int getExpLength() {
return this.expLength;
}
public String getFavouriteCoverUrl() {
return this.favouriteCoverUrl;
}
public List<HotPostsBean> getHotPosts() {
return this.hotPosts;
}
public int getLevel() {
return this.level;
}
public String getNickName() {
return this.nickName;
}
public int getScore() {
return this.score;
}
public List<ScrollbarBean> getScrollbar() {
return this.scrollbar;
}
public List<SectionsBean> getSections() {
return this.sections;
}
public String getTitle() {
return this.title;
}
public String getUserImage() {
return this.userImage;
}
public int getViewUserId() {
return this.viewUserId;
}
public void setChoicestCoverUrl(String str) {
this.choicestCoverUrl = str;
}
public void setChoiestPost(ChoiestPostBean choiestPostBean) {
this.choiestPost = choiestPostBean;
}
public void setCreativeCoverUrl(String str) {
this.creativeCoverUrl = str;
}
public void setCurExp(int i) {
this.curExp = i;
}
public void setExpLength(int i) {
this.expLength = i;
}
public void setFavouriteCoverUrl(String str) {
this.favouriteCoverUrl = str;
}
public void setHotPosts(List<HotPostsBean> list) {
this.hotPosts = list;
}
public void setLevel(int i) {
this.level = i;
}
public void setNickName(String str) {
this.nickName = str;
}
public void setScore(int i) {
this.score = i;
}
public void setScrollbar(List<ScrollbarBean> list) {
this.scrollbar = list;
}
public void setSections(List<SectionsBean> list) {
this.sections = list;
}
public void setTitle(String str) {
this.title = str;
}
public void setUserImage(String str) {
this.userImage = str;
}
public void setViewUserId(int i) {
this.viewUserId = i;
}
}

View File

@@ -0,0 +1,206 @@
package com.ubt.jimu.base.entities;
/* loaded from: classes.dex */
public class Constant {
public static class Base {
public static final int ACCOUNT_TYPE_EMAIL = 1;
public static final int ACCOUNT_TYPE_PHONE = 0;
public static final String ACTIVITY_START_ACTION = "activity_start_action";
public static final int ACTIVITY_START_ACTION_OTHER = 10002;
public static final int ACTIVITY_START_ACTION_REGISTER = 10001;
public static final String ACTIVITY_START_PACKAGE = "com.ubt.jimu.packageId";
public static final String ACTIVITY_START_REDIRECTION = "com.ubt.jimu.redirection";
public static final String ACTIVITY_START_ROBOT = "com.ubt.jimu.robotId";
public static final int APP_ID = 400010011;
public static final int PURPOSE_FIND_PASSWORD = 2;
public static final int PURPOSE_REGISTER = 1;
}
public static class Black {
public static final String BLACK_MODEL_TYPE_KEY = "BLACK_MODEL_TYPE_KEY";
}
public static class Cache {
public static final String APP_VERSION = "app_version";
public static final String APP_VERSION_CODE = "app_version_code";
public static String CACHE_DIR = "jimuCacheDir";
public static final String COMMUNITY_CREATIVITY_CACHE_KEY = "/community/app/postInfo/creative";
public static final String COMMUNITY_HOME_KEY = "/community/app/index/detail";
public static final String COMMUNITY_QUESTION_CACHE_KEY = "/community/app/question/list";
public static int DISK_CACHE_INDEX = 0;
public static long DISK_CACHE_SIZE = 10485760;
public static final String QINIU_TOKEN_KEY = "/jimu/file/getToken?";
public static final String SHOP_DATE_KEY = "/jimu/common/queryPurchaseChannels";
public static final String SP_KEY_DOWNLOAD_ROBOT_ID = "download_robot_id";
public static final String SP_KEY_TTS_TOKEN = "tts_token";
public static int TIMEOUT_CONNECT = 5;
public static int TIMEOUT_DISCONNECT = 604800;
}
public static class Community {
public static final String CREATIVITY_LOAD_COUNT = "111";
public static final int CREATIVITY_LOAD_MORE = 6;
public static final int CREATIVITY_PULL_DOWN = 5;
public static final String LIST_TYPE_CREATIVITY = "CREATIVITY";
public static final String LIST_TYPE_QUESTTIONS = "QUESTTIONS";
public static final String MORE_DATA_KEY = "more_data";
public static final String MORE_TIELE_KEY = "more_title";
public static int NO_MORE_DATA = -2;
public static final String QUESTION_LOAD_COUNT = "5";
public static final int QUESTION_LOAD_MORE = 4;
public static final int QUESTION_PULL_DOWN = 3;
public static final String SOURCE_ACTIVITY_TYPE = "activity";
public static final String SOURCE_LINK_TYPE = "link";
public static final String SOURCE_POST_TYPE = "post";
public enum LinkEmptyState {
NotLoggedIn,
NotSubscription,
HasSubscription
}
}
public static class Course {
public static final String LAST_ALTER_LANGUAGE_KEY = "LAST_ALTER_LANGUAGE";
public static final String ONCLICK_IGETIT_KEY = "ONCLICK_IGETIT_KEY";
}
public static class DataStatistics {
public static final String APP_PACKAGE_DOWNLOAD = "app_package_download";
public static final String DATA_STATISTICS_PACKAGE_ID = "package_id";
}
public static class Network {
public static final int LOADING = 2;
public static final int LOAD_FAILURE = -1;
public static final int LOAD_SUCCEED = 1;
public static final int NO_DATA = 0;
public static final String QINIU_HOST_IMAGE_PATH = "jimu_photo";
public static final String QINIU_HOST_PATH_BASE = "https://video.ubtrobot.com";
public static final String QINIU_HOST_video_PATH = "jimu_video";
}
public static class NoviceGuide {
public static final String AGREE_LEGAL_EXAMINE = "SHOW_LEGAL";
public static final String ALL_COMPLETE_KEY = "ALL_COMPLETE";
public static final String APP_HAS_PAUSE = "APP_HAS_PAUSE";
public static final int CODE_ONCLICK = 10;
public static final int CODING = 4;
public static final String COURSE_GUIDE_FLAG_KEY = "COURSE_GUIDE_FLAG_KEY";
public static final String COURSE_GUIDE_SHOW_KEY = "COURSE_GUIDE_SHOW_KEY";
public static final int FACTORY = 1;
public static final int FACTORY_ONCLICK = 7;
public static final String GUIDANCE_KEY = "GUIDANCE_KEY";
public static final String GUIDANCE_SECOND_KEY = "GUIDANCE_SECOND_KEY";
public static final int HINT_GAUSSIAN_BLUR = 6;
public static final int IS_SKIP_ALL_GUIDE = 0;
public static final String IS_SKIP_ALL_GUIDE_KEY = "IS_SKIP_ALL_GUIDE_KEY";
public static final String JOIN_USER_EXPERIENCE = "join_user_experience";
public static final int NO_SKIP_ALL_GUIDE = 1;
public static final int NULL = -2;
public static final String OFFICIAL_DIY_GUIDE_FLAG_KEY = "OFFICIAL_DIY_GUIDE_FLAG_KEY";
public static final String OFFICIAL_DIY_GUIDE_ON_CLOCK = "OFFICIAL_DIY_GUIDE_ON_CLOCK";
public static final String OFFICIAL_DIY_GUIDE_SHOW_KEY = "COURSE_GUIDE_SHOW_KEY";
public static final String PACKAGE_GUIDE_FLAG_KEY = "package_guide_flag_key";
public static final int RD = 5;
public static final int RD_ONCLICK = 11;
public static final int RD_ONCLICKED = 12;
public static final int SELECT_NULL = -2;
public static final String SHOW_GUIDE = "SHOW_GUIDE";
public static final int TESTING = 2;
public static final int TESTING_ONCLICK = 8;
public static final String TITLE_NOVICE_GUIDE_KEY = "TITLE_NOVICE_GUIDE_KEY";
public static final String TITLE_NOVICE_ONCLICK_KEY = "TITLE_NOVICE_ONCLICK_KEY";
public static final int TRAINNING = 3;
public static final int TRAINNING_ONCLICK = 9;
public static final String USER_DIY_GUIDE_FLAG_KEY = "USER_DIY_GUIDE_FLAG_KEY";
public static final int WELCOME = -1;
public static final int WELCOME_2 = 0;
}
public static class Privacy {
public static final String SP_KEY_CHILD_PRIVACY_POLICY_VERSION = "sp_key_child_privacy_policy_version";
public static final String SP_KEY_PRIVACY_POLICY_VERSION = "sp_key_privacy_policy_version";
}
public static class Publish {
public static final String ACTIVITY_ID_KEY = "ACTIVITYID_KEY";
public static final int COMPLETED_PHOTO_RESULT_CODE = 105;
public static final String DRAFTS = "DRAFTS";
public static final String DRAFTS_EDIT_KEY = "DRAFTS_EDIT_KEY";
public static final String DRAFTS_KEY = "DRAFTS_KEY";
public static final String IS_SHOW_CONFIRM_KEY = "IS_SHOW_CONFIRM_KEY";
public static final int LOGIN_REQUEST = 201;
public static final int MAX_PIC_OR_VIDEO = 10;
public static final int PREVIEW_BACK_RESULT_CODE = 101;
public static final int REQUEST_CODE_PICK_FILE = 202;
public static final String SAVE_DRAFT_SUCCEED_DHINT_KEY = "SAVE_DRAFT_SUCCEED_DHINT_KEY";
public static final String SUCCEED_HINT_KEY = "SUCCEED_HINT_KEY";
public static final String VIDEO_BG_KEY = "VIDEO_BG_KEY";
public static final String VIDEO_IMAGE_URL = "?vframe/png/offset/1/w/800/h/450";
public static final String VIDEO_PATH_KEY = "VideoPath";
public static final String VIDEO_TITLE_KEY = "VIDEO_TITLE_KEY";
}
public static class SelectRobot {
public static final int ACTIVITY_DOWNLOAD_FAIL_RESULT_CODE = -100;
public static final int ACTIVITY_DOWNLOAD_OK_RESULT_CODE = 100;
public static final int ACTIVITY_DOWNLOAD_REQUEST_CODE = 9;
public static final int ACTIVITY_DOWNLOAD_RESULT_CODE = 8;
public static final int ACTIVITY_FIND_REQUEST = 11;
public static final String ADVANCED = "Advanced";
public static final String ASTROBOT_MINI = "AstroBot_Mini";
public static final String BUNDLE_KEY_FROM = "world_from";
public static final String DOWNLAOD_ROBOT_DATA_KEY = "robot";
public static final String INTERSTELLAR_ADVENTURE_NEW_PACKAGE_COSMOS = "Astrobot_Cosmos";
public static final String INTERSTELLAR_ADVENTURE_NEW_PACKAGE_STEM = "Astrobot_STEM";
public static final String INTERSTELLAR_ADVENTURE_NEW_PACKAGE_UPGRADED = "Astrobot_Upgraded";
public static final String INTERSTELLAR_ADVENTURE_OLD_PACKAGE_CN = "Astrobot_CN";
public static final String INTERSTELLAR_ADVENTURE_OLD_PACKAGE_GLOBAL = "Astrobot_Global";
public static final String INTERSTELLAR_ADVENTURE_OLD_PACKAGE_NA = "Astrobot_NA";
public static final String INTERSTELLAR_ADVENTURE_SELECT_PACKAGE_KEY = "INTERSTELLAR_ADVENTURE_SELECT_PACKAGE_KEY";
public static final String LOCAL_USER_COSMOS_FLAG_NEW = "LOCAL_USER_COSMOS_FLAG_NEW";
public static final String LOCAL_USER_COSMOS_FLAG_OLD = "LOCAL_USER_COSMOS_FLAG_OLD";
public static final String MIDDLE = "Middle";
public static final String PACKAGEID_KEY = "packageId";
public static final String PACKAGEID_LIST_KEY = "PACKAGEID_LIST_KEY";
public static final String PACKAGE_IMAGE_PATH_KEY = "PACKAGE_IMAGE_PATH_KEY";
public static final String PACKAGE_KEY = "PACKAGE";
public static final String PACKAGE_NAME_KEY = "packageName";
public static final String PRIMARY = "Primary";
private static final int REQUEST_CODE_ASK_PERMISSION_READ_STORAGE = 18;
public static final int REQUEST_CODE_MESSAGE_CENTER = 19;
public static final int UNITY_MODE_TYPE_OFFICIAL = 0;
public static final int UNITY_MODE_TYPE_USER = 1;
public static final int WORLD_FROM_AR = 11;
public static final int WORLD_FROM_CODE = 3;
public static final int WORLD_FROM_CONNECT = 5;
public static final int WORLD_FROM_COURSE = 7;
public static final int WORLD_FROM_CUSTOME = 0;
public static final int WORLD_FROM_DISCONNECT = 6;
public static final int WORLD_FROM_EXPEDITION = 10;
public static final int WORLD_FROM_FACTORY = 1;
public static final int WORLD_FROM_TEST = 2;
public static final int WORLD_FROM_TRAIN = 4;
}
public static class Shop {
public static final String APPLE_URL = "https://www.apple.com/cn/search/Jimu+Robot?src=globalnav";
public static final String TAOBAO_URL = "https://ubtech.tmall.com/category-1266476937.htm?spm=a1z10.1-b-s.w12055762-15612338374.4.kAMl3o&search=y&catName=Jimu%BB%FD%C4%BE%BB%FA%C6%F7%C8%CB&scene=taobao_shop";
public static final String TITLE = "title";
public static final String UBTECH_URL = "http://www.cn.ubtrobot.com/product/index12.html";
public static final String URL_KEY = "url";
}
public static class SyncDate {
public static final String ACTION_DIR = "actions";
public static final String DEFAULT = "default";
public static final String IS_DELETE = "1";
public static final String NOT_DELETE = "0";
public static final String OFFICIAL_MODEL = "1";
public static final int OFFICIAL_MODEL_TYPE = 1;
public static final String PLAYERDATA = "playerdata";
public static final String USER_LOCAL = "local";
}
}

View File

@@ -0,0 +1,453 @@
package com.ubt.jimu.base.entities;
import android.text.TextUtils;
import java.io.Serializable;
/* loaded from: classes.dex */
public class Course implements Serializable {
public static final String STATUS_COMPLETED = "completed";
public static final String STATUS_RUNNING = "running";
public static final String STATUS_WAITING = "waiting";
public static final String TYPE_BLOCKLY = "code";
public static final String TYPE_BUILD = "build";
private static final long serialVersionUID = 1;
private String answerPath;
private int capArt;
private int capEngineering;
private int capMath;
private int capScience;
private int capSpace;
private long commonResUpdatedTime;
private String commonResource;
private String courseName;
private String courseThumbnail;
private String courseThumbnailLock;
private int createdBy;
private long createdTime;
private String descKey;
private boolean download;
private long downloadTime;
private int exp;
private String finishedFlag;
private long id;
private int isAvailable;
private String isDeleted;
private String lan;
private long langResUpdatedTime;
private String languageResource;
private int level;
private int modelId;
private String nameKey;
private String nextCourse;
private String resourceZip;
private boolean robotDownloaded;
private int score;
private String status;
private String storyName;
private String successStoryVideo;
private int t_id;
private String taskDescKey;
private int updatedBy;
private long updatedTime;
private boolean useable;
private int userId;
public Course() {
}
public String getAnswerPath() {
return this.answerPath;
}
public int getCapArt() {
return this.capArt;
}
public int getCapEngineering() {
return this.capEngineering;
}
public int getCapMath() {
return this.capMath;
}
public int getCapScience() {
return this.capScience;
}
public int getCapSpace() {
return this.capSpace;
}
public long getCommonResUpdatedTime() {
return this.commonResUpdatedTime;
}
public String getCommonResource() {
return this.commonResource;
}
public String getCourseName() {
return this.courseName;
}
public String getCourseThumbnail() {
return this.courseThumbnail;
}
public String getCourseThumbnailLock() {
return this.courseThumbnailLock;
}
public int getCourseType() {
return (TextUtils.isEmpty(this.finishedFlag) || this.finishedFlag.equals("build") || !this.finishedFlag.equals(TYPE_BLOCKLY)) ? 0 : 1;
}
public int getCreatedBy() {
return this.createdBy;
}
public long getCreatedTime() {
return this.createdTime;
}
public int getCurrentStatus() {
if (TextUtils.isEmpty(this.status) || this.status.equals(STATUS_WAITING)) {
return 0;
}
if (this.status.equals(STATUS_RUNNING)) {
return 1;
}
return this.status.equals(STATUS_COMPLETED) ? 2 : 0;
}
public String getDescKey() {
return this.descKey;
}
public boolean getDownload() {
return this.download;
}
public long getDownloadTime() {
return this.downloadTime;
}
public int getExp() {
return this.exp;
}
public String getFinishedFlag() {
return this.finishedFlag;
}
public long getId() {
return this.id;
}
public int getIsAvailable() {
return this.isAvailable;
}
public String getIsDeleted() {
return this.isDeleted;
}
public String getLan() {
return this.lan;
}
public long getLangResUpdatedTime() {
return this.langResUpdatedTime;
}
public String getLanguageResource() {
return this.languageResource;
}
public int getLevel() {
return this.level;
}
public int getModelId() {
return this.modelId;
}
public String getNameKey() {
return this.nameKey;
}
public String getNextCourse() {
return this.nextCourse;
}
public String getResourceZip() {
return this.resourceZip;
}
public boolean getRobotDownloaded() {
return this.robotDownloaded;
}
public int getScore() {
return this.score;
}
public String getStatus() {
return this.status;
}
public String getStoryName() {
return this.storyName;
}
public String getSuccessStoryVideo() {
return this.successStoryVideo;
}
public int getT_id() {
return this.t_id;
}
public String getTaskDescKey() {
return this.taskDescKey;
}
public int getUpdatedBy() {
return this.updatedBy;
}
public long getUpdatedTime() {
return this.updatedTime;
}
public boolean getUseable() {
return this.useable;
}
public int getUserId() {
return this.userId;
}
public boolean isDownload() {
return this.download;
}
public boolean isUseable() {
return this.useable;
}
public void setAnswerPath(String str) {
this.answerPath = str;
}
public void setCapArt(int i) {
this.capArt = i;
}
public void setCapEngineering(int i) {
this.capEngineering = i;
}
public void setCapMath(int i) {
this.capMath = i;
}
public void setCapScience(int i) {
this.capScience = i;
}
public void setCapSpace(int i) {
this.capSpace = i;
}
public void setCommonResUpdatedTime(long j) {
this.commonResUpdatedTime = j;
}
public void setCommonResource(String str) {
this.commonResource = str;
}
public void setCourseName(String str) {
this.courseName = str;
}
public void setCourseThumbnail(String str) {
this.courseThumbnail = str;
}
public void setCourseThumbnailLock(String str) {
this.courseThumbnailLock = str;
}
public void setCreatedBy(int i) {
this.createdBy = i;
}
public void setCreatedTime(long j) {
this.createdTime = j;
}
public void setDescKey(String str) {
this.descKey = str;
}
public void setDownload(boolean z) {
this.download = z;
}
public void setDownloadTime(long j) {
this.downloadTime = j;
}
public void setExp(int i) {
this.exp = i;
}
public void setFinishedFlag(String str) {
this.finishedFlag = str;
}
public void setId(int i) {
this.id = i;
}
public void setIsAvailable(int i) {
this.isAvailable = i;
}
public void setIsDeleted(String str) {
this.isDeleted = str;
}
public void setLan(String str) {
this.lan = str;
}
public void setLangResUpdatedTime(long j) {
this.langResUpdatedTime = j;
}
public void setLanguageResource(String str) {
this.languageResource = str;
}
public void setLevel(int i) {
this.level = i;
}
public void setModelId(int i) {
this.modelId = i;
}
public void setNameKey(String str) {
this.nameKey = str;
}
public void setNextCourse(String str) {
this.nextCourse = str;
}
public void setResourceZip(String str) {
this.resourceZip = str;
}
public void setRobotDownloaded(boolean z) {
this.robotDownloaded = z;
}
public void setScore(int i) {
this.score = i;
}
public void setStatus(String str) {
this.status = str;
}
public void setStoryName(String str) {
this.storyName = str;
}
public void setSuccessStoryVideo(String str) {
this.successStoryVideo = str;
}
public void setT_id(int i) {
this.t_id = i;
}
public void setTaskDescKey(String str) {
this.taskDescKey = str;
}
public void setUpdatedBy(int i) {
this.updatedBy = i;
}
public void setUpdatedTime(long j) {
this.updatedTime = j;
}
public void setUseable(boolean z) {
this.useable = z;
}
public void setUserId(int i) {
this.userId = i;
}
public Course(int i, String str, String str2, String str3) {
this.id = i;
this.nameKey = str;
this.finishedFlag = str2;
this.useable = true;
}
public void setId(long j) {
this.id = j;
}
public Course(int i, long j, String str, String str2, String str3, String str4, int i2, int i3, String str5, String str6, String str7, String str8, String str9, String str10, int i4, long j2, int i5, long j3, String str11, int i6, String str12, int i7, int i8, int i9, int i10, int i11, int i12, int i13, int i14, boolean z, long j4, boolean z2, String str13, String str14, String str15, boolean z3, String str16, long j5, String str17, long j6) {
this.t_id = i;
this.id = j;
this.storyName = str;
this.nameKey = str2;
this.descKey = str3;
this.taskDescKey = str4;
this.modelId = i2;
this.level = i3;
this.courseName = str5;
this.nextCourse = str6;
this.successStoryVideo = str7;
this.finishedFlag = str8;
this.answerPath = str9;
this.resourceZip = str10;
this.createdBy = i4;
this.createdTime = j2;
this.updatedBy = i5;
this.updatedTime = j3;
this.isDeleted = str11;
this.userId = i6;
this.lan = str12;
this.isAvailable = i7;
this.score = i8;
this.exp = i9;
this.capScience = i10;
this.capSpace = i11;
this.capMath = i12;
this.capEngineering = i13;
this.capArt = i14;
this.download = z;
this.downloadTime = j4;
this.useable = z2;
this.courseThumbnail = str13;
this.courseThumbnailLock = str14;
this.status = str15;
this.robotDownloaded = z3;
this.commonResource = str16;
this.commonResUpdatedTime = j5;
this.languageResource = str17;
this.langResUpdatedTime = j6;
}
}

View File

@@ -0,0 +1,154 @@
package com.ubt.jimu.base.entities;
import java.util.List;
/* loaded from: classes.dex */
public class CreativeListResultBean {
private int current;
private int pages;
private List<RecordsBean> records;
private int size;
private int total;
public static class RecordsBean {
private String categoryName;
private String content;
private String coverUrl;
private int createUser;
private int id;
private String nickName;
private int postIcon;
private int postId;
private String tags;
private String title;
private String userImage;
public String getCategoryName() {
return this.categoryName;
}
public String getContent() {
return this.content;
}
public String getCoverUrl() {
return this.coverUrl;
}
public int getCreateUser() {
return this.createUser;
}
public int getId() {
return this.id;
}
public String getNickName() {
return this.nickName;
}
public int getPostIcon() {
return this.postIcon;
}
public int getPostId() {
return this.postId;
}
public String getTags() {
return this.tags;
}
public String getTitle() {
return this.title;
}
public String getUserImage() {
return this.userImage;
}
public void setCategoryName(String str) {
this.categoryName = str;
}
public void setContent(String str) {
this.content = str;
}
public void setCoverUrl(String str) {
this.coverUrl = str;
}
public void setCreateUser(int i) {
this.createUser = i;
}
public void setId(int i) {
this.id = i;
}
public void setNickName(String str) {
this.nickName = str;
}
public void setPostIcon(int i) {
this.postIcon = i;
}
public void setPostId(int i) {
this.postId = i;
}
public void setTags(String str) {
this.tags = str;
}
public void setTitle(String str) {
this.title = str;
}
public void setUserImage(String str) {
this.userImage = str;
}
}
public int getCurrent() {
return this.current;
}
public int getPages() {
return this.pages;
}
public List<RecordsBean> getRecords() {
return this.records;
}
public int getSize() {
return this.size;
}
public int getTotal() {
return this.total;
}
public void setCurrent(int i) {
this.current = i;
}
public void setPages(int i) {
this.pages = i;
}
public void setRecords(List<RecordsBean> list) {
this.records = list;
}
public void setSize(int i) {
this.size = i;
}
public void setTotal(int i) {
this.total = i;
}
}

View File

@@ -0,0 +1,146 @@
package com.ubt.jimu.base.entities;
import java.io.Serializable;
import java.util.List;
/* loaded from: classes.dex */
public class CreativeResultBean implements Serializable {
private int current;
private int pages;
private List<RecordsBean> records;
private int size;
private int total;
public static class RecordsBean {
private String content;
private int createUser;
private int id;
private String nickName;
private String postCoverName;
private String postCoverUrl;
private int postIcon;
private String tags;
private String title;
private String userImage;
public String getContent() {
return this.content;
}
public int getCreateUser() {
return this.createUser;
}
public int getId() {
return this.id;
}
public String getNickName() {
return this.nickName;
}
public String getPostCoverName() {
return this.postCoverName;
}
public String getPostCoverUrl() {
return this.postCoverUrl;
}
public int getPostIcon() {
return this.postIcon;
}
public String getTags() {
return this.tags;
}
public String getTitle() {
return this.title;
}
public String getUserImage() {
return this.userImage;
}
public void setContent(String str) {
this.content = str;
}
public void setCreateUser(int i) {
this.createUser = i;
}
public void setId(int i) {
this.id = i;
}
public void setNickName(String str) {
this.nickName = str;
}
public void setPostCoverName(String str) {
this.postCoverName = str;
}
public void setPostCoverUrl(String str) {
this.postCoverUrl = str;
}
public void setPostIcon(int i) {
this.postIcon = i;
}
public void setTags(String str) {
this.tags = str;
}
public void setTitle(String str) {
this.title = str;
}
public void setUserImage(String str) {
this.userImage = str;
}
}
public int getCurrent() {
return this.current;
}
public int getPages() {
return this.pages;
}
public List<RecordsBean> getRecords() {
return this.records;
}
public int getSize() {
return this.size;
}
public int getTotal() {
return this.total;
}
public void setCurrent(int i) {
this.current = i;
}
public void setPages(int i) {
this.pages = i;
}
public void setRecords(List<RecordsBean> list) {
this.records = list;
}
public void setSize(int i) {
this.size = i;
}
public void setTotal(int i) {
this.total = i;
}
}

View File

@@ -0,0 +1,23 @@
package com.ubt.jimu.base.entities;
/* loaded from: classes.dex */
public class DeletePostEntities {
private String message;
private boolean status;
public String getMessage() {
return this.message;
}
public boolean isStatus() {
return this.status;
}
public void setMessage(String str) {
this.message = str;
}
public void setStatus(boolean z) {
this.status = z;
}
}

View File

@@ -0,0 +1,17 @@
package com.ubt.jimu.base.entities;
import java.io.Serializable;
import java.util.LinkedHashMap;
/* loaded from: classes.dex */
public class DraftsListBean implements Serializable {
private LinkedHashMap<String, PublishItemBean> mLinkedHashMap = new LinkedHashMap<>();
public LinkedHashMap<String, PublishItemBean> getLinkedHashMap() {
return this.mLinkedHashMap;
}
public void setLinkedHashMap(LinkedHashMap<String, PublishItemBean> linkedHashMap) {
this.mLinkedHashMap = linkedHashMap;
}
}

View File

@@ -0,0 +1,89 @@
package com.ubt.jimu.base.entities;
import java.io.Serializable;
/* loaded from: classes.dex */
public class Fans implements Serializable {
private static final long serialVersionUID = 1;
private String descKey;
private int isSubscribed;
private int level;
private String nickName;
private String title;
private String titleKey;
private long userId;
private String userImage;
private String userName;
public String getDescKey() {
return this.descKey;
}
public int getIsSubscribed() {
return this.isSubscribed;
}
public int getLevel() {
return this.level;
}
public String getNickName() {
return this.nickName;
}
public String getTitle() {
return this.title;
}
public String getTitleKey() {
return this.titleKey;
}
public long getUserId() {
return this.userId;
}
public String getUserImage() {
return this.userImage;
}
public String getUserName() {
return this.userName;
}
public void setDescKey(String str) {
this.descKey = str;
}
public void setIsSubscribed(int i) {
this.isSubscribed = i;
}
public void setLevel(int i) {
this.level = i;
}
public void setNickName(String str) {
this.nickName = str;
}
public void setTitle(String str) {
this.title = str;
}
public void setTitleKey(String str) {
this.titleKey = str;
}
public void setUserId(long j) {
this.userId = j;
}
public void setUserImage(String str) {
this.userImage = str;
}
public void setUserName(String str) {
this.userName = str;
}
}

View File

@@ -0,0 +1,448 @@
package com.ubt.jimu.base.entities;
import java.util.List;
/* loaded from: classes.dex */
public class FavouriteBean {
private int current;
private int pages;
private List<RecordsBean> records;
private int size;
private int total;
public static class RecordsBean extends LoveEntities {
private int activityId;
private int browseNum;
private int collectNum;
private int commentNum;
private int complainNum;
private String content;
private String countryCode;
private long createTime;
private int createUser;
private int id;
private List<ImgListBean> imgLsit;
private int isChoice;
private int isCreative;
private int isDeleted;
private String postCoverName;
private String postCoverUrl;
private int postIcon;
private int praiseNum;
private int product;
private String resourceUrl;
private int shareNum;
private int status;
private Object tags;
private String title;
private UserBaseInfoBean userBaseInfo;
public static class ImgListBean {
private String createTime;
private String description;
private String fileName;
private String fileUrl;
private int id;
private int isDeleted;
private int order;
private int postId;
private String thumbnail;
private int type;
private int userId;
public String getCreateTime() {
return this.createTime;
}
public String getDescription() {
return this.description;
}
public String getFileName() {
return this.fileName;
}
public String getFileUrl() {
return this.fileUrl;
}
public int getId() {
return this.id;
}
public int getIsDeleted() {
return this.isDeleted;
}
public int getOrder() {
return this.order;
}
public int getPostId() {
return this.postId;
}
public String getThumbnail() {
return this.thumbnail;
}
public int getType() {
return this.type;
}
public int getUserId() {
return this.userId;
}
public void setCreateTime(String str) {
this.createTime = str;
}
public void setDescription(String str) {
this.description = str;
}
public void setFileName(String str) {
this.fileName = str;
}
public void setFileUrl(String str) {
this.fileUrl = str;
}
public void setId(int i) {
this.id = i;
}
public void setIsDeleted(int i) {
this.isDeleted = i;
}
public void setOrder(int i) {
this.order = i;
}
public void setPostId(int i) {
this.postId = i;
}
public void setThumbnail(String str) {
this.thumbnail = str;
}
public void setType(int i) {
this.type = i;
}
public void setUserId(int i) {
this.userId = i;
}
}
public static class UserBaseInfoBean {
private Object descKey;
private int level;
private String nickName;
private String titleKey;
private int userId;
private String userImage;
private String userName;
public Object getDescKey() {
return this.descKey;
}
public int getLevel() {
return this.level;
}
public String getNickName() {
return this.nickName;
}
public String getTitleKey() {
return this.titleKey;
}
public int getUserId() {
return this.userId;
}
public String getUserImage() {
return this.userImage;
}
public String getUserName() {
return this.userName;
}
public void setDescKey(Object obj) {
this.descKey = obj;
}
public void setLevel(int i) {
this.level = i;
}
public void setNickName(String str) {
this.nickName = str;
}
public void setTitleKey(String str) {
this.titleKey = str;
}
public void setUserId(int i) {
this.userId = i;
}
public void setUserImage(String str) {
this.userImage = str;
}
public void setUserName(String str) {
this.userName = str;
}
}
public int getActivityId() {
return this.activityId;
}
public int getBrowseNum() {
return this.browseNum;
}
public int getCollectNum() {
return this.collectNum;
}
public int getCommentNum() {
return this.commentNum;
}
public int getComplainNum() {
return this.complainNum;
}
public String getContent() {
return this.content;
}
public String getCountryCode() {
return this.countryCode;
}
public long getCreateTime() {
return this.createTime;
}
public int getCreateUser() {
return this.createUser;
}
public int getId() {
return this.id;
}
public List<ImgListBean> getImgLsit() {
return this.imgLsit;
}
public int getIsChoice() {
return this.isChoice;
}
public int getIsCreative() {
return this.isCreative;
}
public int getIsDeleted() {
return this.isDeleted;
}
public String getPostCoverName() {
return this.postCoverName;
}
public String getPostCoverUrl() {
return this.postCoverUrl;
}
public int getPostIcon() {
return this.postIcon;
}
public int getPraiseNum() {
return this.praiseNum;
}
public int getProduct() {
return this.product;
}
public String getResourceUrl() {
return this.resourceUrl;
}
public int getShareNum() {
return this.shareNum;
}
public int getStatus() {
return this.status;
}
public Object getTags() {
return this.tags;
}
public String getTitle() {
return this.title;
}
public UserBaseInfoBean getUserBaseInfo() {
return this.userBaseInfo;
}
public void setActivityId(int i) {
this.activityId = i;
}
public void setBrowseNum(int i) {
this.browseNum = i;
}
public void setCollectNum(int i) {
this.collectNum = i;
}
public void setCommentNum(int i) {
this.commentNum = i;
}
public void setComplainNum(int i) {
this.complainNum = i;
}
public void setContent(String str) {
this.content = str;
}
public void setCountryCode(String str) {
this.countryCode = str;
}
public void setCreateTime(long j) {
this.createTime = j;
}
public void setCreateUser(int i) {
this.createUser = i;
}
public void setId(int i) {
this.id = i;
}
public void setImgLsit(List<ImgListBean> list) {
this.imgLsit = list;
}
public void setIsChoice(int i) {
this.isChoice = i;
}
public void setIsCreative(int i) {
this.isCreative = i;
}
public void setIsDeleted(int i) {
this.isDeleted = i;
}
public void setPostCoverName(String str) {
this.postCoverName = str;
}
public void setPostCoverUrl(String str) {
this.postCoverUrl = str;
}
public void setPostIcon(int i) {
this.postIcon = i;
}
public void setPraiseNum(int i) {
this.praiseNum = i;
}
public void setProduct(int i) {
this.product = i;
}
public void setResourceUrl(String str) {
this.resourceUrl = str;
}
public void setShareNum(int i) {
this.shareNum = i;
}
public void setStatus(int i) {
this.status = i;
}
public void setTags(Object obj) {
this.tags = obj;
}
public void setTitle(String str) {
this.title = str;
}
public void setUserBaseInfo(UserBaseInfoBean userBaseInfoBean) {
this.userBaseInfo = userBaseInfoBean;
}
}
public int getCurrent() {
return this.current;
}
public int getPages() {
return this.pages;
}
public List<RecordsBean> getRecords() {
return this.records;
}
public int getSize() {
return this.size;
}
public int getTotal() {
return this.total;
}
public void setCurrent(int i) {
this.current = i;
}
public void setPages(int i) {
this.pages = i;
}
public void setRecords(List<RecordsBean> list) {
this.records = list;
}
public void setSize(int i) {
this.size = i;
}
public void setTotal(int i) {
this.total = i;
}
}

Some files were not shown because too many files have changed in this diff Show More