思特奇智慧酒店云平台 v0.0.5版本的 MD5 值为:dedb172bb322639d79d7e0e26262fb5c
以下内容为反编译后的 LocalActivity.java 源代码,内容仅作参考
package com.sitech.oncon.weex;
import android.content.Context;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import androidx.appcompat.app.AppCompatActivity;
import com.sitech.oncon.R;
import com.taobao.weex.IWXRenderListener;
import com.taobao.weex.WXSDKInstance;
import com.taobao.weex.common.WXRenderStrategy;
import com.taobao.weex.utils.WXFileUtils;
import com.taobao.weex.utils.WXLogUtils;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
public class LocalActivity extends AppCompatActivity implements IWXRenderListener {
public WXSDKInstance mWXSDKInstance;
public String url;
public static String loadAssetttt(String str, Context context) {
FileInputStream fileInputStream;
StringBuilder sb;
BufferedReader bufferedReader;
BufferedReader bufferedReader2 = null;
if (context == null || TextUtils.isEmpty(str)) {
return null;
}
try {
fileInputStream = new FileInputStream(new File(str));
try {
try {
sb = new StringBuilder(fileInputStream.available() + 10);
bufferedReader = new BufferedReader(new InputStreamReader(fileInputStream));
} catch (IOException e) {
e = e;
}
} catch (Throwable th) {
th = th;
}
try {
char[] cArr = new char[4096];
while (true) {
int read = bufferedReader.read(cArr);
if (read <= 0) {
break;
}
sb.append(cArr, 0, read);
}
String sb2 = sb.toString();
try {
bufferedReader.close();
} catch (IOException e2) {
WXLogUtils.e("WXFileUtils loadAssetttt: ", e2);
}
try {
fileInputStream.close();
} catch (IOException e3) {
WXLogUtils.e("WXFileUtils loadAssetttt: ", e3);
}
return sb2;
} catch (IOException e4) {
e = e4;
bufferedReader2 = bufferedReader;
e.printStackTrace();
WXLogUtils.e("", e);
if (bufferedReader2 != null) {
try {
bufferedReader2.close();
} catch (IOException e5) {
WXLogUtils.e("WXFileUtils loadAssetttt: ", e5);
}
}
if (fileInputStream != null) {
try {
fileInputStream.close();
} catch (IOException e6) {
WXLogUtils.e("WXFileUtils loadAssetttt: ", e6);
}
}
return "";
} catch (Throwable th2) {
th = th2;
bufferedReader2 = bufferedReader;
if (bufferedReader2 != null) {
try {
bufferedReader2.close();
} catch (IOException e7) {
WXLogUtils.e("WXFileUtils loadAssetttt: ", e7);
}
}
if (fileInputStream != null) {
try {
fileInputStream.close();
} catch (IOException e8) {
WXLogUtils.e("WXFileUtils loadAssetttt: ", e8);
}
}
throw th;
}
} catch (IOException e9) {
e = e9;
fileInputStream = null;
} catch (Throwable th3) {
th = th3;
fileInputStream = null;
}
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.weex_activity_local);
this.mWXSDKInstance = new WXSDKInstance(this);
this.mWXSDKInstance.registerRenderListener(this);
this.url = getIntent().getStringExtra("url");
HashMap hashMap = new HashMap();
if (TextUtils.isEmpty(this.url)) {
hashMap.put("bundleUrl", "file://hello.js");
this.mWXSDKInstance.render("App", WXFileUtils.loadAsset("app.js", this), null, null, -1, -1, WXRenderStrategy.APPEND_ASYNC);
return;
}
hashMap.put("bundleUrl", this.url);
this.mWXSDKInstance.render("WXSample", loadAssetttt(this.url, this), (Map<String, Object>) null, (String) null, WXRenderStrategy.APPEND_ASYNC);
}
@Override
public void onDestroy() {
super.onDestroy();
WXSDKInstance wXSDKInstance = this.mWXSDKInstance;
if (wXSDKInstance != null) {
wXSDKInstance.onActivityDestroy();
}
}
@Override
public void onException(WXSDKInstance wXSDKInstance, String str, String str2) {
}
@Override
public void onPause() {
super.onPause();
WXSDKInstance wXSDKInstance = this.mWXSDKInstance;
if (wXSDKInstance != null) {
wXSDKInstance.onActivityPause();
}
}
@Override
public void onRefreshSuccess(WXSDKInstance wXSDKInstance, int i, int i2) {
}
@Override
public void onRenderSuccess(WXSDKInstance wXSDKInstance, int i, int i2) {
}
@Override
public void onResume() {
super.onResume();
WXSDKInstance wXSDKInstance = this.mWXSDKInstance;
if (wXSDKInstance != null) {
wXSDKInstance.onActivityResume();
}
}
@Override
public void onStop() {
super.onStop();
WXSDKInstance wXSDKInstance = this.mWXSDKInstance;
if (wXSDKInstance != null) {
wXSDKInstance.onActivityStop();
}
}
@Override
public void onViewCreated(WXSDKInstance wXSDKInstance, View view) {
setContentView(view);
}
}