Treasure v4.2版本的 MD5 值为:3630fc8ae6ba14f3b4334d51b35fef76
以下内容为反编译后的 clj.java 源代码,内容仅作参考
package rabten.eu.CL;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.AssetFileDescriptor;
import android.content.res.AssetManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.LinearGradient;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Shader;
import android.graphics.Typeface;
import android.media.MediaPlayer;
import android.net.Uri;
import android.util.Log;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import androidx.core.view.InputDeviceCompat;
import androidx.core.view.ViewCompat;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.text.SimpleDateFormat;
import java.util.Calendar;
public class clj {
static Paint PNT = null;
private static byte[] bmBuf = null;
public static int cmdFlg = 0;
public static clCmdView cmdView = null;
private static int docHeight = 0;
public static ImageView imgView = null;
public static int jflg = 0;
public static Rect jr = null;
public static int kbdFlg = 0;
public static clKbdView kbdView = null;
private static int lastFntRef = -1;
public static int playFlg = 0;
private static MediaPlayer player = null;
private static char[] pntBuf0 = null;
private static char[] pntBuf1 = null;
private static int pntCnt0 = 0;
private static int pntCnt1 = 0;
private static float viewscale = 1.0f;
public static float abs(float f) {
return f <= 0.0f ? 0.0f - f : f;
}
public static int invertColor(int i) {
return (-16777216) | (ViewCompat.MEASURED_SIZE_MASK - (i & ViewCompat.MEASURED_SIZE_MASK));
}
public clj() {
PNT = new Paint(1);
}
public static boolean hasCmdView() {
return cmdFlg != 0;
}
public static boolean hasKbdView() {
return kbdFlg != 0;
}
public static boolean removeCmdView() {
if (cmdFlg == 0) {
return false;
}
cmdView.release();
App.thisLayout.removeView(cmdView);
return true;
}
public static boolean removeKbdView() {
if (kbdFlg == 0) {
return false;
}
kbdView.release();
App.thisLayout.removeView(kbdView);
return true;
}
public static void invokeCmdView(int i, int i2, int i3, int i4) {
removeCmdView();
int loadCommandView = App.thisMain.loadCommandView(App.cmdViewX, i4, i, i3);
if (loadCommandView == 0) {
return;
}
Log.v("HH", "invokeCMDVIEW pXi: " + loadCommandView + " ivX: " + i4);
clCmdView clcmdview = new clCmdView(App.thisContext, loadCommandView);
cmdView = clcmdview;
clcmdview.setAlpha(0.9f);
int ccall = clc.ccall(2, 0);
docHeight = ccall;
clCmdView.docHeight = ccall;
clCmdView.viewHeight = clc.ccall(3, 0);
int i5 = App.screenX < App.screenY ? App.screenX : App.screenY;
int i6 = App.screenX < App.screenY ? App.screenY : App.screenX;
int i7 = (i5 - App.cmdViewX) / 2;
if (App.isLandscape == 0) {
i5 = i6;
}
if (clCmdView.viewHeight + i2 > i5) {
i2 = (i5 - clCmdView.viewHeight) - 40;
}
Rect rect = new Rect(i7, i2, App.cmdViewX + i7, clCmdView.viewHeight + i2);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(rect.width(), rect.height());
layoutParams.leftMargin = rect.left;
layoutParams.topMargin = rect.top;
cmdView.storePosition(rect.left, rect.top);
App.thisLayout.addView(cmdView, layoutParams);
}
public static void invokeKbdView(int i, int i2) {
removeCmdView();
removeKbdView();
int i3 = App.isLandscape == 0 ? App.screenX : App.screenX / 2;
int i4 = App.screenY;
int loadKeyboardView = App.thisMain.loadKeyboardView(i3, i);
if (loadKeyboardView == 0) {
return;
}
clKbdView clkbdview = new clKbdView(App.thisContext, loadKeyboardView);
kbdView = clkbdview;
clkbdview.setAlpha(1.0f);
int ccall = clc.ccall(2, 0);
docHeight = ccall;
clKbdView.docHeight = ccall;
clKbdView.viewHeight = clc.ccall(3, 0);
int i5 = App.isLandscape != 0 ? App.screenX - i3 : 0;
Rect rect = new Rect(i5, i4 - clKbdView.viewHeight, i3 + i5, i4);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(rect.width(), rect.height());
layoutParams.leftMargin = rect.left;
layoutParams.topMargin = rect.top;
kbdView.storePosition(rect.left, rect.top);
App.thisLayout.addView(kbdView, layoutParams);
}
public static int scale(float f) {
return (int) (f * viewscale);
}
public static void setTypeFace(int i, boolean z) {
int i2 = lastFntRef;
if (i2 == i) {
return;
}
int i3 = i >> 8;
if ((i2 & 255) != (i & 255)) {
if ((i & 16) != 0) {
PNT.setTypeface(Typeface.createFromAsset(App.thisAsset, "fonts/RABTEN.ttf"));
} else if ((i & 3) == 3) {
PNT.setTypeface(Typeface.create("sans-serif-light", 3));
} else if ((i & 1) != 0) {
PNT.setTypeface(Typeface.create("sans-serif-light", 1));
} else if ((i & 2) != 0) {
PNT.setTypeface(Typeface.create("sans-serif-light", 2));
} else {
PNT.setTypeface(Typeface.create("sans-serif-light", 0));
}
}
PNT.setTextSize(z ? scale(i3) : i3);
lastFntRef = i;
}
public static int runPaint(Canvas canvas, int i) {
float f;
int i2;
int i3;
int i4;
int i5;
int i6;
int i7;
int i8;
int i9;
int i10;
int i11;
int i12;
int i13;
int i14;
int i15;
int i16;
int i17 = i;
float f2 = docHeight / viewscale;
char[] cArr = i17 == 0 ? pntBuf0 : pntBuf1;
int i18 = i17 == 0 ? pntCnt0 : pntCnt1;
lastFntRef = -1;
char c = 0;
int i19 = 0;
int i20 = 0;
while (i19 < i18) {
char c2 = cArr[i19];
i19++;
if (c2 == 33300) {
char c3 = cArr[i19];
int i21 = i19 + 1;
int i22 = (cArr[i21 + 1] << 16) + cArr[i21];
int i23 = i21 + 2;
int i24 = (cArr[i23 + 1] << 16) + cArr[i23];
int i25 = i23 + 2;
int i26 = (cArr[i25 + 1] << 16) + cArr[i25];
int i27 = i25 + 2;
int i28 = (cArr[i27 + 1] << 16) + cArr[i27];
int i29 = i27 + 2;
float f3 = i22 / i24;
viewscale = f3;
docHeight = i26;
float f4 = i26 / f3;
Log.v("HH", "XXX-viewscale:" + i17 + ", " + i22 + "/" + i24 + " " + viewscale + " docHeight:" + docHeight + " yHeight:" + f4 + " ofsY:" + i28);
if (c3 != 0) {
if (i17 == 0 && i28 >= 0) {
App.ClScrollView().scrollTo(c, i28);
}
cArr[i19] = c;
}
i19 = i29;
f = f4;
} else {
f = f2;
}
if (c2 == 33310) {
int i30 = (cArr[i19 + 1] << 16) + cArr[i19];
int i31 = i19 + 2;
int i32 = (cArr[i31 + 1] << 16) + cArr[i31];
int i33 = i31 + 2;
int i34 = (cArr[i33 + 1] << 16) + cArr[i33];
int i35 = i33 + 2;
int i36 = (cArr[i35 + 1] << 16) + cArr[i35];
int i37 = i35 + 2;
int i38 = (cArr[i37 + 1] << 16) + cArr[i37];
i19 = i37 + 2;
int scale = scale(f - i34);
Rect rect = new Rect(scale(i32), scale, scale(i32 + i36), scale(i38 + 8) + scale);
PNT.setStyle(Paint.Style.FILL);
if (i30 != i20) {
PNT.setColor(i30);
i20 = i30;
}
canvas.drawRect(rect, PNT);
}
if (c2 == 33311) {
char c4 = cArr[i19];
int i39 = i19 + 1;
int i40 = (cArr[i39 + 1] << 16) + cArr[i39];
int i41 = i39 + 2;
int i42 = (cArr[i41 + 1] << 16) + cArr[i41];
int i43 = i41 + 2;
int i44 = (cArr[i43 + 1] << 16) + cArr[i43];
int i45 = i43 + 2;
int i46 = (cArr[i45 + 1] << 16) + cArr[i45];
int i47 = i45 + 2;
int i48 = (cArr[i47 + 1] << 16) + cArr[i47];
int i49 = i47 + 2;
int i50 = (cArr[i49 + 1] << 16) + cArr[i49];
int i51 = i49 + 2;
int i52 = (cArr[i51 + 1] << 16) + cArr[i51];
int i53 = i51 + 2;
int i54 = (cArr[i53 + 1] << 16) + cArr[i53];
int i55 = i53 + 2;
int i56 = (cArr[i55 + 1] << 16) + cArr[i55];
int i57 = i55 + 2;
if (c4 != 0) {
i40 = invertColor(i40);
i42 = invertColor(i42);
i44 = invertColor(i44);
}
int scale2 = scale(f - i52);
int scale3 = scale(i50);
int scale4 = scale(i50 + i54);
int scale5 = scale(i56) + scale2;
Rect rect2 = new Rect(scale3, scale2, scale4, scale5);
if (i48 > 0) {
rect2.left += ((rect2.right - rect2.left) * i48) / 256;
i40++;
i42 = i40 + 1;
i44 = i42;
i46 = 11;
}
if (i46 == 11) {
i15 = i57;
i40 = i44;
i16 = scale2;
scale4 = 0;
scale3 = 0;
} else if (i46 != 12) {
i15 = i57;
i16 = 0;
scale5 = 0;
} else {
i15 = i57;
i16 = scale5;
scale5 = scale2;
}
int[] iArr = {i40, i44};
int[] iArr2 = {i40, i42, i44};
PNT.setStyle(Paint.Style.FILL);
if (i40 != i20) {
PNT.setColor(i40);
i20 = i40;
}
PNT.setShader(new LinearGradient(scale3, i16, scale4, scale5, (i42 & ViewCompat.MEASURED_SIZE_MASK) == 0 ? iArr : iArr2, (float[]) null, Shader.TileMode.MIRROR));
canvas.drawRect(rect2, PNT);
PNT.setShader(null);
i19 = i15;
}
if (c2 == 33301 || c2 == 33302) {
char c5 = cArr[i19];
int i58 = i19 + 1;
int i59 = i58 + 2;
int i60 = (cArr[i59 + 1] << 16) + cArr[i59];
int scale6 = scale((cArr[i2 + 1] << 16) + cArr[i2]);
int i61 = i59 + 2 + 2;
int i62 = (cArr[i61 + 1] << 16) + cArr[i61];
int i63 = i61 + 2;
char c6 = cArr[i63];
int i64 = i63 + 1;
int scale7 = scale(f - i62);
setTypeFace((cArr[i58 + 1] << 16) + cArr[i58], true);
PNT.setStyle(Paint.Style.FILL);
if (i60 != i20) {
PNT.setColor(i60);
i3 = i60;
} else {
i3 = i20;
}
if (c2 == 33301) {
if (c5 == 0) {
canvas.drawText(cArr, i64, c6, scale6, scale7, PNT);
} else {
double d = c5 + 'Z';
Path path = new Path();
path.moveTo(scale6, scale7);
path.rLineTo((int) (Math.sin(Math.toRadians(d)) * 500.0d), (int) (Math.cos(Math.toRadians(d)) * 500.0d));
canvas.drawTextOnPath(cArr, i64, c6, path, 0.0f, 0.0f, PNT);
}
}
if (c2 == 33302) {
for (int i65 = 0; i65 < c6; i65++) {
canvas.drawText(cArr, i64, 1, scale(cArr[i64 + c6]), scale7, PNT);
i64++;
}
}
i19 = i64 + c6;
i20 = i3;
}
if (c2 == 33312) {
char c7 = cArr[i19];
i19++;
float strokeWidth = PNT.getStrokeWidth();
int i66 = 0;
while (i66 < c7) {
int i67 = (cArr[i19 + 1] << 16) + cArr[i19];
int i68 = i19 + 2;
int i69 = (cArr[i68 + 1] << 16) + cArr[i68];
int i70 = i68 + 2;
int i71 = (cArr[i70 + 1] << 16) + cArr[i70];
int i72 = i70 + 2;
int i73 = (cArr[i72 + 1] << 16) + cArr[i72];
int i74 = i72 + 2;
int i75 = (cArr[i74 + 1] << 16) + cArr[i74];
int i76 = i74 + 2;
char c8 = c7;
int i77 = (cArr[i76 + 1] << 16) + cArr[i76];
int i78 = i76 + 2;
int i79 = i18;
int i80 = (cArr[i78 + 1] << 16) + cArr[i78];
int i81 = i78 + 2;
PNT.setStyle(Paint.Style.STROKE);
if (i67 != i20) {
PNT.setColor(i67);
i14 = i67;
} else {
i14 = i20;
}
if (i69 == 0) {
PNT.setStrokeWidth(i71 != 0 ? scale(i71) : 1.0f);
canvas.drawLine(scale(i73), scale(f - i75), scale(i77), scale(f - i80), PNT);
} else if (i73 >= 0 && i75 >= 0) {
int scale8 = scale(f - i75);
Rect rect3 = new Rect(scale(i73), scale8 - scale(i80), scale(i73 + i77), scale8);
PNT.setStrokeWidth(i71 != 0 ? scale(i71) : 1.0f);
canvas.drawRect(rect3, PNT);
}
i66++;
i19 = i81;
c7 = c8;
i18 = i79;
i20 = i14;
}
i4 = i18;
PNT.setStrokeWidth(strokeWidth);
} else {
i4 = i18;
}
if (c2 == 33320) {
char c9 = cArr[i19];
int i82 = i19 + 1;
int i83 = (cArr[i82 + 1] << 16) + cArr[i82];
int i84 = i82 + 2;
int i85 = (cArr[i84 + 1] << 16) + cArr[i84];
int i86 = i84 + 2;
int i87 = (cArr[i86 + 1] << 16) + cArr[i86];
int i88 = i86 + 2;
int i89 = (cArr[i88 + 1] << 16) + cArr[i88];
int i90 = i88 + 2;
int i91 = (cArr[i90 + 1] << 16) + cArr[i90];
int i92 = i90 + 2;
int i93 = (cArr[i92 + 1] << 16) + cArr[i92];
int i94 = i92 + 2;
int i95 = (cArr[i94 + 1] << 16) + cArr[i94];
int i96 = i94 + 2;
int i97 = (cArr[i96 + 1] << 16) + cArr[i96];
int i98 = i96 + 2;
int i99 = i98 + 2;
i5 = i20;
i19 = i99 + 2;
new BitmapFactory();
Bitmap decodeByteArray = BitmapFactory.decodeByteArray(bmBuf, (cArr[i98 + 1] << 16) + cArr[i98], (cArr[i99 + 1] << 16) + cArr[i99]);
int width = decodeByteArray != null ? decodeByteArray.getWidth() : i95;
int height = decodeByteArray != null ? decodeByteArray.getHeight() : i97;
if (c9 != 0) {
i6 = i95 - (i87 + i83);
i7 = i97 - (i85 + i89);
int i100 = (height * i6) / i7;
int i101 = (width * i7) / i6;
if (i100 > width) {
int i102 = ((height - i101) / 2) + 0;
height = i101;
i13 = i102;
i12 = 0;
} else {
i12 = ((width - i100) / 2) + 0;
width = i100;
i13 = 0;
}
i8 = i91 + i83;
i9 = i93 + i89;
i11 = i13;
i10 = i12;
} else {
i6 = i95 - (i87 + i83);
i7 = i97 - (i85 + i89);
int i103 = (i7 * width) / height;
int i104 = (i6 * height) / width;
if (i103 > i6) {
i93 += (i7 - i104) / 2;
i7 = i104;
} else {
i91 += (i6 - i103) / 2;
i6 = i103;
}
i8 = i91 + i83;
i9 = i93 + i89;
i10 = 0;
i11 = 0;
}
int scale9 = scale(f - (i9 + i7));
Rect rect4 = new Rect(scale(i8), scale9, scale(i8 + i6), scale(i7) + scale9);
if (decodeByteArray != null) {
canvas.drawBitmap(decodeByteArray, new Rect(i10, i11, width, height), rect4, PNT);
} else {
Paint paint = new Paint();
paint.setStyle(Paint.Style.FILL);
paint.setColor(-35);
canvas.drawRect(rect4, paint);
}
} else {
i5 = i20;
}
i17 = i;
f2 = f;
i20 = i5;
i18 = i4;
c = 0;
}
lastFntRef = -1;
return 999;
}
public static int jPaintNow(char[] cArr, int i, byte[] bArr, int i2, int i3) {
removeImgView();
App.onPage = 0;
if (i3 != 0) {
if (i3 != 1) {
return 222;
}
pntBuf1 = cArr;
pntCnt1 = i;
return 222;
}
App.ClView().requestLayout();
pntBuf0 = cArr;
pntCnt0 = i;
bmBuf = bArr;
return 222;
}
public static int jScaleCanvas(int i, float f, float f2) {
docHeight = (int) f2;
viewscale = f;
App.ClView().requestLayout();
if (i >= 0) {
App.ClScrollView().scrollTo(0, i);
return 777;
}
return 777;
}
public static int jScrollTo(int i) {
removeImgView();
App.ClScrollView().scrollTo(0, i);
return 777;
}
public static int jGetCharWidthW(int i, int i2, int i3, float[] fArr) {
setTypeFace(i, false);
char c = (char) i2;
char[] cArr = new char[256];
int i4 = 0;
while (i4 < 256) {
cArr[i4] = c;
i4++;
c = (char) (c + 1);
}
PNT.getTextWidths(cArr, 0, 255, fArr);
Paint.FontMetrics fontMetrics = PNT.getFontMetrics();
fArr[256] = fontMetrics.leading;
fArr[257] = -fontMetrics.ascent;
fArr[258] = fontMetrics.descent;
fArr[259] = fontMetrics.top;
return 1;
}
public static int jMeasureString(int i, char[] cArr, int i2) {
setTypeFace(i, false);
float[] fArr = new float[i2];
PNT.getTextWidths(cArr, 0, i2, fArr);
return clc.jBACKmeasureString(fArr);
}
public static int jQueryInt(int i) {
if (i == 100) {
Calendar calendar = Calendar.getInstance();
return Integer.parseInt(new SimpleDateFormat("D").format(calendar.getTime())) | (Integer.parseInt(new SimpleDateFormat("y").format(calendar.getTime())) << 16);
} else if (i == 101) {
return App.ClScrollView().getScrollY();
} else {
return 0;
}
}
public static boolean hasImgView() {
return jflg == 3;
}
public static void removeImgView() {
if (jflg == 3) {
App.thisLayout.removeView(imgView);
jflg = 0;
}
}
public static int jPaintHiLight(int i, int i2, int i3, int i4) {
Rect rect = new Rect(i, i2, i3 + i, i2 + i4);
jr = rect;
int i5 = i4 / 5;
rect.left -= i5;
jr.right += i5;
Bitmap createBitmap = Bitmap.createBitmap(jr.width(), jr.height(), Bitmap.Config.ARGB_4444);
Paint paint = new Paint();
paint.setStyle(Paint.Style.FILL);
paint.setColor(InputDeviceCompat.SOURCE_ANY);
Canvas canvas = new Canvas(createBitmap);
RectF rectF = new RectF();
rectF.right = jr.width();
rectF.bottom = jr.height();
float height = rectF.height() / 2.0f;
canvas.drawRoundRect(rectF, height, height, paint);
if (hasImgView()) {
App.thisLayout.removeView(imgView);
}
ImageView imageView = new ImageView(App.thisContext);
imgView = imageView;
imageView.setImageBitmap(createBitmap);
imgView.setAlpha(0.5f);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(jr.width(), jr.height());
layoutParams.leftMargin = jr.left;
layoutParams.topMargin = jr.top;
App.thisLayout.addView(imgView, layoutParams);
jflg = 3;
return 333;
}
public static int jPutPreference(int i, int i2) {
SharedPreferences.Editor edit = App.thisContext.getSharedPreferences("RabCalPref", 0).edit();
if (i2 == 1) {
edit.putInt("PREFLNG", i);
} else if (i2 == 2) {
edit.putInt("LNGMASK", i);
} else if (i2 == 3) {
edit.putInt("FLAGS", i);
} else if (i2 == 4) {
edit.putInt("PREFKBD", i);
}
edit.commit();
return 0;
}
public static int jGetPreference(int i) {
SharedPreferences sharedPreferences = App.thisContext.getSharedPreferences("RabCalPref", 0);
if (i != 1) {
if (i != 2) {
if (i != 3) {
if (i != 4) {
return 0;
}
return sharedPreferences.getInt("PREFKBD", 0);
}
return sharedPreferences.getInt("FLAGS", 0);
}
return sharedPreferences.getInt("LNGMASK", 0);
}
return sharedPreferences.getInt("PREFLNG", 0);
}
public static int jRunString(char[] cArr, int i) {
String copyValueOf = String.copyValueOf(cArr);
if (copyValueOf.charAt(0) == '$') {
String[] split = copyValueOf.substring(1).split("\\$");
App.thisContext.startActivity(new Intent("android.intent.action.VIEW", Uri.parse("http://maps.google.com/maps?daddr=" + split[1] + "," + split[2] + " (" + split[0] + ")")));
return 333;
}
Intent intent = new Intent("android.intent.action.VIEW");
intent.setData(Uri.parse(copyValueOf));
App.thisMain.startActivity(intent);
return 333;
}
public static int jCommand(int i, int i2) {
if (i2 == 0) {
App.ClView().invalidate();
return 0;
} else if (i2 == 1) {
App.ClScrollView().invalidate();
return 0;
} else if (i2 == 5) {
App.backgroundColor = i;
return 0;
} else if (i2 == 20) {
App.thisMain.remakeFilesDir();
return 0;
} else if (i2 == 30) {
clc.removeView();
App.ClView().invalidate();
return 0;
} else if (i2 != 41) {
switch (i2) {
case 10:
invokeCmdView(0, App.screenY / 2, App.screenY / 2, i);
return 0;
case 11:
invokeKbdView(0, 0);
return 0;
case 12:
kbdView.invalidate();
return 0;
case 13:
removeKbdView();
return 0;
case 14:
invokeKbdView(1, 0);
return 0;
case 15:
removeCmdView();
return 0;
default:
return 0;
}
} else {
return App.screenY;
}
}
public static int jPlayFile(char[] cArr, int i, int i2) {
String copyValueOf = String.copyValueOf(cArr);
Log.v("CL", "jPlayFile: " + copyValueOf + ", cmd: " + i2);
if (playFlg == 0) {
playFlg = 1;
MediaPlayer mediaPlayer = new MediaPlayer();
player = mediaPlayer;
mediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer mediaPlayer2) {
MainActivity mainActivity = App.thisMain;
MainActivity.storePath(BuildConfig.FLAVOR, 10);
}
});
}
if (i2 == 0) {
player.reset();
if (copyValueOf.charAt(0) == '&') {
try {
AssetFileDescriptor openFd = App.thisAsset.openFd(copyValueOf.replace("&", "mp3"));
player.setDataSource(openFd.getFileDescriptor(), openFd.getStartOffset(), openFd.getLength());
player.prepare();
player.start();
return 444;
} catch (Exception e) {
e.printStackTrace();
return 444;
}
} else if (copyValueOf.charAt(0) == '=') {
String replace = copyValueOf.replace("=", BuildConfig.FLAVOR);
String path = App.thisContext.getFilesDir().getPath();
try {
player.setDataSource(path + "/sounds" + replace);
player.prepare();
player.start();
return 444;
} catch (IOException e2) {
e2.printStackTrace();
return 444;
}
} else {
return 444;
}
} else if (i2 == 1) {
player.reset();
try {
player.setDataSource(copyValueOf);
player.prepare();
player.start();
return 555;
} catch (IOException e3) {
e3.printStackTrace();
return 555;
}
} else if (i2 == 2) {
if (player.isPlaying()) {
player.pause();
return 3;
}
player.start();
return 2;
} else if (i2 == 4 && player.isPlaying()) {
player.pause();
return 4;
} else if (i2 == 5 && !player.isPlaying()) {
player.start();
return 5;
} else if (i2 == 6) {
return player.getCurrentPosition();
} else {
if (i2 == 7) {
return player.getDuration();
}
if (i2 == 8) {
player.seekTo(player.getCurrentPosition() + (player.getDuration() / 25));
return 333;
} else if (i2 != 9) {
if (i2 == 20) {
new File(copyValueOf).delete();
}
return 0;
} else {
player.seekTo(player.getCurrentPosition() - (player.getDuration() / 25));
return 333;
}
}
}
public static int jFileCommand(char[] cArr, int i, int i2) {
String copyValueOf = String.copyValueOf(cArr);
Log.v("HH", "jFileCommand: " + copyValueOf + ", cmd: " + i2);
if (i2 == 1) {
copyAsset(copyValueOf, "Collection", 0);
}
if (i2 == 2) {
MainActivity mainActivity = App.thisMain;
copyAsset(copyValueOf, "Praylist", MainActivity.praylistHigh + 1);
}
if (i2 == 10) {
String path = App.thisContext.getFilesDir().getPath();
if (new File(path + "/" + copyValueOf).delete()) {
App.thisMain.remakeFilesDir();
}
}
return 0;
}
private static void copyFile(InputStream inputStream, OutputStream outputStream) throws IOException {
byte[] bArr = new byte[1024];
while (true) {
int read = inputStream.read(bArr);
if (read == -1) {
return;
}
outputStream.write(bArr, 0, read);
}
}
private static void copyAsset(String str, String str2, int i) {
FileOutputStream fileOutputStream;
AssetManager assets = App.thisContext.getAssets();
String path = App.thisContext.getFilesDir().getPath();
String substring = str.substring(str.lastIndexOf("/") + 1);
String str3 = String.format("%04d", Integer.valueOf(i)) + ".rab";
StringBuilder sb = new StringBuilder();
sb.append(path);
sb.append("/");
sb.append(str2);
sb.append("/");
if (i != 0) {
substring = str3;
}
sb.append(substring);
String sb2 = sb.toString();
Log.v("HH", "COPYASSET: " + sb2);
InputStream inputStream = null;
try {
InputStream open = assets.open(str);
try {
fileOutputStream = new FileOutputStream(sb2);
try {
copyFile(open, fileOutputStream);
App.thisMain.remakeFilesDir();
if (open != null) {
try {
open.close();
} catch (IOException unused) {
}
}
} catch (IOException unused2) {
inputStream = open;
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException unused3) {
}
}
if (fileOutputStream == null) {
return;
}
fileOutputStream.close();
} catch (Throwable th) {
th = th;
inputStream = open;
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException unused4) {
}
}
if (fileOutputStream != null) {
try {
fileOutputStream.close();
} catch (IOException unused5) {
}
}
throw th;
}
} catch (IOException unused6) {
fileOutputStream = null;
} catch (Throwable th2) {
th = th2;
fileOutputStream = null;
}
} catch (IOException unused7) {
fileOutputStream = null;
} catch (Throwable th3) {
th = th3;
fileOutputStream = null;
}
try {
fileOutputStream.close();
} catch (IOException unused8) {
}
}
}