├── README.md ├── bitter └── jnibridge │ └── JNIBridge.java ├── com └── unity3d │ └── player │ ├── NativeLoader.java │ ├── ReflectionHelper.java │ ├── UnityPlayer.java │ ├── UnityPlayerActivity.java │ ├── UnityPlayerNativeActivity.java │ ├── UnityPlayerProxyActivity.java │ ├── UnityWebRequest.java │ ├── WWW.java │ ├── a.java │ ├── b.java │ ├── c.java │ ├── d.java │ ├── e.java │ ├── f.java │ ├── g.java │ ├── h.java │ ├── i.java │ ├── j.java │ ├── k.java │ ├── l.java │ ├── m.java │ ├── n.java │ ├── o.java │ ├── p.java │ ├── q.java │ ├── r.java │ ├── s.java │ ├── t.java │ ├── u.java │ ├── v.java │ └── w.java └── org └── fmod ├── FMODAudioDevice.java └── a.java /README.md: -------------------------------------------------------------------------------- 1 | Decompiled Java sources of **Unity Player for Android** at the time of Unity 5.3.2. 2 | -------------------------------------------------------------------------------- /bitter/jnibridge/JNIBridge.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | */ 4 | package bitter.jnibridge; 5 | 6 | import java.lang.reflect.InvocationHandler; 7 | import java.lang.reflect.Method; 8 | import java.lang.reflect.Proxy; 9 | 10 | public class JNIBridge { 11 | static native Object invoke(long var0, Class var2, Method var3, Object[] var4); 12 | 13 | static native void delete(long var0); 14 | 15 | static Object newInterfaceProxy(long l2, Class[] arrclass) { 16 | return Proxy.newProxyInstance(JNIBridge.class.getClassLoader(), arrclass, new a(l2)); 17 | } 18 | 19 | static void disableInterfaceProxy(Object object) { 20 | ((a)Proxy.getInvocationHandler(object)).a(); 21 | } 22 | 23 | private static final class a 24 | implements InvocationHandler { 25 | private Object a = new Object[0]; 26 | private long b; 27 | 28 | public a(long l2) { 29 | this.b = l2; 30 | } 31 | 32 | @Override 33 | public final Object invoke(Object object, Method method, Object[] arrobject) { 34 | object = this.a; 35 | synchronized (object) { 36 | if (this.b == 0) { 37 | return null; 38 | } 39 | return JNIBridge.invoke(this.b, method.getDeclaringClass(), method, arrobject); 40 | } 41 | } 42 | 43 | public final void finalize() { 44 | Object object = this.a; 45 | synchronized (object) { 46 | if (this.b == 0) { 47 | return; 48 | } 49 | JNIBridge.delete(this.b); 50 | return; 51 | } 52 | } 53 | 54 | public final void a() { 55 | Object object = this.a; 56 | synchronized (object) { 57 | this.b = 0; 58 | return; 59 | } 60 | } 61 | } 62 | 63 | } 64 | 65 | -------------------------------------------------------------------------------- /com/unity3d/player/NativeLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | */ 4 | package com.unity3d.player; 5 | 6 | public class NativeLoader { 7 | static final native boolean load(String var0); 8 | 9 | static final native boolean unload(); 10 | } 11 | 12 | -------------------------------------------------------------------------------- /com/unity3d/player/ReflectionHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | */ 4 | package com.unity3d.player; 5 | 6 | import com.unity3d.player.m; 7 | import java.lang.reflect.Array; 8 | import java.lang.reflect.Constructor; 9 | import java.lang.reflect.Field; 10 | import java.lang.reflect.InvocationHandler; 11 | import java.lang.reflect.Member; 12 | import java.lang.reflect.Method; 13 | import java.lang.reflect.Modifier; 14 | import java.lang.reflect.Proxy; 15 | import java.util.ArrayList; 16 | 17 | final class ReflectionHelper { 18 | protected static boolean LOG = false; 19 | protected static final boolean LOGV = false; 20 | private static a[] a = new a[4096]; 21 | 22 | ReflectionHelper() { 23 | } 24 | 25 | private static boolean a(a a2) { 26 | a a3 = a[a2.hashCode() & a.length - 1]; 27 | if (!a2.equals(a3)) { 28 | return false; 29 | } 30 | a2.a = a3.a; 31 | return true; 32 | } 33 | 34 | private static void a(a a2, Member member) { 35 | a2.a = member; 36 | ReflectionHelper.a[a2.hashCode() & ReflectionHelper.a.length - 1] = a2; 37 | } 38 | 39 | protected static Constructor getConstructorID(Class class_, String string) { 40 | Constructor constructor = null; 41 | a a2 = new a(class_, "", string); 42 | if (ReflectionHelper.a(a2)) { 43 | constructor = (Constructor)a2.a; 44 | } else { 45 | Class[] arrclass = ReflectionHelper.a(string); 46 | float f2 = 0.0f; 47 | for (Constructor constructor2 : class_.getConstructors()) { 48 | float f3 = ReflectionHelper.a(Void.TYPE, constructor2.getParameterTypes(), arrclass); 49 | if (f3 <= f2) continue; 50 | constructor = constructor2; 51 | f2 = f3; 52 | if (f2 == 1.0f) break; 53 | } 54 | ReflectionHelper.a(a2, constructor); 55 | } 56 | if (constructor == null) { 57 | throw new NoSuchMethodError("" + string + " in class " + class_.getName()); 58 | } 59 | return constructor; 60 | } 61 | 62 | protected static Method getMethodID(Class class_, String string, String string2, boolean bl) { 63 | Method method = null; 64 | a a2 = new a(class_, string, string2); 65 | if (ReflectionHelper.a(a2)) { 66 | method = (Method)a2.a; 67 | } else { 68 | Class[] arrclass = ReflectionHelper.a(string2); 69 | float f2 = 0.0f; 70 | while (class_ != null) { 71 | for (Method method2 : class_.getDeclaredMethods()) { 72 | float f3; 73 | if (bl != Modifier.isStatic(method2.getModifiers()) || method2.getName().compareTo(string) != 0 || (f3 = ReflectionHelper.a(method2.getReturnType(), method2.getParameterTypes(), arrclass)) <= f2) continue; 74 | method = method2; 75 | f2 = f3; 76 | if (f2 == 1.0f) break; 77 | } 78 | if (f2 == 1.0f || class_.isPrimitive() || class_.isInterface() || class_.equals(Object.class) || class_.equals(Void.TYPE)) break; 79 | class_ = class_.getSuperclass(); 80 | } 81 | ReflectionHelper.a(a2, method); 82 | } 83 | if (method == null) { 84 | Object[] arrobject = new Object[4]; 85 | arrobject[0] = bl ? "non-static" : "static"; 86 | arrobject[1] = string; 87 | arrobject[2] = string2; 88 | arrobject[3] = class_.getName(); 89 | throw new NoSuchMethodError(String.format("no %s method with name='%s' signature='%s' in class L%s;", arrobject)); 90 | } 91 | return method; 92 | } 93 | 94 | protected static Field getFieldID(Class class_, String string, String string2, boolean bl) { 95 | Field field = null; 96 | a a2 = new a(class_, string, string2); 97 | if (ReflectionHelper.a(a2)) { 98 | field = (Field)a2.a; 99 | } else { 100 | Class[] arrclass = ReflectionHelper.a(string2); 101 | float f2 = 0.0f; 102 | while (class_ != null) { 103 | for (Field field2 : class_.getDeclaredFields()) { 104 | float f3; 105 | if (bl != Modifier.isStatic(field2.getModifiers()) || field2.getName().compareTo(string) != 0 || (f3 = ReflectionHelper.a(field2.getType(), null, arrclass)) <= f2) continue; 106 | field = field2; 107 | f2 = f3; 108 | if (f2 == 1.0f) break; 109 | } 110 | if (f2 == 1.0f || class_.isPrimitive() || class_.isInterface() || class_.equals(Object.class) || class_.equals(Void.TYPE)) break; 111 | class_ = class_.getSuperclass(); 112 | } 113 | ReflectionHelper.a(a2, field); 114 | } 115 | if (field == null) { 116 | Object[] arrobject = new Object[4]; 117 | arrobject[0] = bl ? "non-static" : "static"; 118 | arrobject[1] = string; 119 | arrobject[2] = string2; 120 | arrobject[3] = class_.getName(); 121 | throw new NoSuchFieldError(String.format("no %s field with name='%s' signature='%s' in class L%s;", arrobject)); 122 | } 123 | return field; 124 | } 125 | 126 | private static float a(Class class_, Class class_2) { 127 | if (class_.equals(class_2)) { 128 | return 1.0f; 129 | } 130 | if (!class_.isPrimitive() && !class_2.isPrimitive()) { 131 | try { 132 | if (class_.asSubclass(class_2) != null) { 133 | return 0.5f; 134 | } 135 | } 136 | catch (ClassCastException v0) {} 137 | try { 138 | if (class_2.asSubclass(class_) != null) { 139 | return 0.1f; 140 | } 141 | } 142 | catch (ClassCastException v1) {} 143 | } 144 | return 0.0f; 145 | } 146 | 147 | private static float a(Class class_, Class[] arrclass, Class[] arrclass2) { 148 | if (arrclass2.length == 0) { 149 | return 0.1f; 150 | } 151 | if ((arrclass == null ? 0 : arrclass.length) + 1 != arrclass2.length) { 152 | return 0.0f; 153 | } 154 | float f2 = 1.0f; 155 | int n2 = 0; 156 | if (arrclass != null) { 157 | for (Class class_2 : arrclass) { 158 | f2 *= ReflectionHelper.a(class_2, arrclass2[n2++]); 159 | } 160 | } 161 | return f2 * ReflectionHelper.a(class_, arrclass2[arrclass2.length - 1]); 162 | } 163 | 164 | private static Class[] a(String arrclass) { 165 | Class class_; 166 | int[] arrn = new int[]{0}; 167 | ArrayList serializable2 = new ArrayList(); 168 | while (arrn[0] < arrclass.length() && (class_ = ReflectionHelper.a((String)arrclass, arrn)) != null) { 169 | serializable2.add(class_); 170 | } 171 | int n2 = 0; 172 | arrclass = new Class[serializable2.size()]; 173 | for (Class class_2 : serializable2) { 174 | arrclass[n2++] = class_2; 175 | } 176 | return arrclass; 177 | } 178 | 179 | private static Class a(String object, int[] arrn) { 180 | while (arrn[0] < object.length()) { 181 | int[] arrn2 = arrn; 182 | int n2 = arrn2[0]; 183 | arrn2[0] = n2 + 1; 184 | int n3 = object.charAt(n2); 185 | if (n3 == 40 || n3 == 41) continue; 186 | if (n3 == 76) { 187 | n3 = object.indexOf(59, arrn[0]); 188 | if (n3 == -1) break; 189 | object = object.substring(arrn[0], n3); 190 | arrn[0] = n3 + 1; 191 | object = object.replace('/', '.'); 192 | try { 193 | object = Class.forName((String)object); 194 | } 195 | catch (ClassNotFoundException v2) { 196 | break; 197 | } 198 | return object; 199 | } 200 | if (n3 == 90) { 201 | return Boolean.TYPE; 202 | } 203 | if (n3 == 73) { 204 | return Integer.TYPE; 205 | } 206 | if (n3 == 70) { 207 | return Float.TYPE; 208 | } 209 | if (n3 == 86) { 210 | return Void.TYPE; 211 | } 212 | if (n3 == 66) { 213 | return Byte.TYPE; 214 | } 215 | if (n3 == 83) { 216 | return Short.TYPE; 217 | } 218 | if (n3 == 74) { 219 | return Long.TYPE; 220 | } 221 | if (n3 == 68) { 222 | return Double.TYPE; 223 | } 224 | if (n3 == 91) { 225 | return Array.newInstance(ReflectionHelper.a((String)object, arrn), 0).getClass(); 226 | } 227 | m.Log(5, "! parseType; " + (char)n3 + " is not known!"); 228 | break; 229 | } 230 | return null; 231 | } 232 | 233 | private static native Object nativeProxyInvoke(int var0, String var1, Object[] var2); 234 | 235 | private static native void nativeProxyFinalize(int var0); 236 | 237 | protected static Object newProxyInstance(int n2, Class class_) { 238 | return ReflectionHelper.newProxyInstance(n2, new Class[]{class_}); 239 | } 240 | 241 | protected static Object newProxyInstance(final int n2, final Class[] arrclass) { 242 | return Proxy.newProxyInstance(ReflectionHelper.class.getClassLoader(), arrclass, new InvocationHandler(){ 243 | 244 | @Override 245 | public final Object invoke(Object object, Method method, Object[] arrobject) { 246 | return ReflectionHelper.nativeProxyInvoke(n2, method.getName(), arrobject); 247 | } 248 | 249 | protected final void finalize() { 250 | try { 251 | ReflectionHelper.nativeProxyFinalize(n2); 252 | return; 253 | } 254 | finally { 255 | super.finalize(); 256 | } 257 | } 258 | }); 259 | } 260 | 261 | private static final class a { 262 | private final Class b; 263 | private final String c; 264 | private final String d; 265 | private final int e; 266 | public volatile Member a; 267 | 268 | a(Class class_, String string, String string2) { 269 | this.b = class_; 270 | this.c = string; 271 | this.d = string2; 272 | int n2 = 527 + this.b.hashCode(); 273 | n2 = 31 * n2 + this.c.hashCode(); 274 | this.e = n2 = 31 * n2 + this.d.hashCode(); 275 | } 276 | 277 | public final int hashCode() { 278 | return this.e; 279 | } 280 | 281 | public final boolean equals(Object object) { 282 | if (object == this) { 283 | return true; 284 | } 285 | if (object instanceof a) { 286 | object = (a)object; 287 | if (this.e == object.e && this.d.equals(object.d) && this.c.equals(object.c) && this.b.equals(object.b)) { 288 | return true; 289 | } 290 | return false; 291 | } 292 | return false; 293 | } 294 | } 295 | 296 | } 297 | 298 | -------------------------------------------------------------------------------- /com/unity3d/player/UnityPlayer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | * 4 | * Could not load the following classes: 5 | * android.app.Activity 6 | * android.app.AlertDialog 7 | * android.app.AlertDialog$Builder 8 | * android.app.NativeActivity 9 | * android.content.BroadcastReceiver 10 | * android.content.Context 11 | * android.content.ContextWrapper 12 | * android.content.DialogInterface 13 | * android.content.DialogInterface$OnClickListener 14 | * android.content.pm.ApplicationInfo 15 | * android.content.pm.PackageInfo 16 | * android.content.pm.PackageManager 17 | * android.content.pm.PackageManager$NameNotFoundException 18 | * android.content.res.AssetManager 19 | * android.content.res.Configuration 20 | * android.hardware.Camera 21 | * android.hardware.Camera$CameraInfo 22 | * android.hardware.Camera$Size 23 | * android.net.NetworkInfo 24 | * android.os.Bundle 25 | * android.os.Environment 26 | * android.os.Process 27 | * android.util.AttributeSet 28 | * android.view.InputEvent 29 | * android.view.KeyEvent 30 | * android.view.MotionEvent 31 | * android.view.Surface 32 | * android.view.SurfaceHolder 33 | * android.view.SurfaceHolder$Callback 34 | * android.view.SurfaceView 35 | * android.view.View 36 | * android.view.ViewGroup 37 | * android.view.ViewGroup$LayoutParams 38 | * android.view.Window 39 | * android.view.WindowManager 40 | * android.widget.FrameLayout 41 | * android.widget.FrameLayout$LayoutParams 42 | * android.widget.ProgressBar 43 | * org.xmlpull.v1.XmlPullParser 44 | * org.xmlpull.v1.XmlPullParserFactory 45 | */ 46 | package com.unity3d.player; 47 | 48 | import android.app.Activity; 49 | import android.app.AlertDialog; 50 | import android.app.NativeActivity; 51 | import android.content.BroadcastReceiver; 52 | import android.content.Context; 53 | import android.content.ContextWrapper; 54 | import android.content.DialogInterface; 55 | import android.content.pm.ApplicationInfo; 56 | import android.content.pm.PackageInfo; 57 | import android.content.pm.PackageManager; 58 | import android.content.res.AssetManager; 59 | import android.content.res.Configuration; 60 | import android.hardware.Camera; 61 | import android.net.NetworkInfo; 62 | import android.os.Bundle; 63 | import android.os.Environment; 64 | import android.os.Process; 65 | import android.util.AttributeSet; 66 | import android.view.InputEvent; 67 | import android.view.KeyEvent; 68 | import android.view.MotionEvent; 69 | import android.view.Surface; 70 | import android.view.SurfaceHolder; 71 | import android.view.SurfaceView; 72 | import android.view.View; 73 | import android.view.ViewGroup; 74 | import android.view.Window; 75 | import android.view.WindowManager; 76 | import android.widget.FrameLayout; 77 | import android.widget.ProgressBar; 78 | import com.unity3d.player.NativeLoader; 79 | import com.unity3d.player.UnityWebRequest; 80 | import com.unity3d.player.WWW; 81 | import com.unity3d.player.a; 82 | import com.unity3d.player.f; 83 | import com.unity3d.player.g; 84 | import com.unity3d.player.h; 85 | import com.unity3d.player.i; 86 | import com.unity3d.player.j; 87 | import com.unity3d.player.m; 88 | import com.unity3d.player.o; 89 | import com.unity3d.player.p; 90 | import com.unity3d.player.q; 91 | import com.unity3d.player.r; 92 | import com.unity3d.player.s; 93 | import com.unity3d.player.t; 94 | import com.unity3d.player.u; 95 | import com.unity3d.player.v; 96 | import com.unity3d.player.w; 97 | import java.io.File; 98 | import java.io.FileInputStream; 99 | import java.io.FileNotFoundException; 100 | import java.io.IOException; 101 | import java.io.InputStream; 102 | import java.security.MessageDigest; 103 | import java.security.NoSuchAlgorithmException; 104 | import java.util.ArrayList; 105 | import java.util.Iterator; 106 | import java.util.List; 107 | import java.util.Vector; 108 | import java.util.concurrent.ArrayBlockingQueue; 109 | import java.util.concurrent.ConcurrentLinkedQueue; 110 | import java.util.concurrent.Semaphore; 111 | import java.util.concurrent.TimeUnit; 112 | import java.util.concurrent.locks.Lock; 113 | import java.util.concurrent.locks.ReentrantLock; 114 | import org.xmlpull.v1.XmlPullParser; 115 | import org.xmlpull.v1.XmlPullParserFactory; 116 | 117 | public class UnityPlayer 118 | extends FrameLayout 119 | implements a.a { 120 | public static Activity currentActivity = null; 121 | private boolean c = false; 122 | private boolean d = false; 123 | private boolean e = true; 124 | private final j f; 125 | private final t g; 126 | private boolean h = false; 127 | private v i = new v(); 128 | private final ConcurrentLinkedQueue j = new ConcurrentLinkedQueue(); 129 | private BroadcastReceiver k = null; 130 | private boolean l = false; 131 | b a; 132 | private ContextWrapper m; 133 | private SurfaceView n; 134 | private WindowManager o; 135 | private static boolean p; 136 | private boolean q; 137 | private boolean r; 138 | private int s; 139 | private int t; 140 | private final r u; 141 | private String v; 142 | private NetworkInfo w; 143 | private Bundle x; 144 | private List y; 145 | private w z; 146 | s b; 147 | private ProgressBar A; 148 | private Runnable B; 149 | private Runnable C; 150 | private static Lock D; 151 | 152 | public UnityPlayer(ContextWrapper contextWrapper) { 153 | super((Context)contextWrapper); 154 | this.a = new b(); 155 | this.r = true; 156 | this.s = 0; 157 | this.t = 0; 158 | this.v = null; 159 | this.w = null; 160 | this.x = new Bundle(); 161 | this.y = new ArrayList(); 162 | this.b = null; 163 | this.A = null; 164 | this.B = new Runnable(){ 165 | 166 | @Override 167 | public final void run() { 168 | int n2 = UnityPlayer.this.nativeActivityIndicatorStyle(); 169 | if (n2 >= 0) { 170 | if (UnityPlayer.this.A == null) { 171 | int[] arrn = new int[]{16842874, 16843401, 16842873, 16843400}; 172 | UnityPlayer.this.A = new ProgressBar((Context)UnityPlayer.this.m, null, arrn[n2]); 173 | UnityPlayer.this.A.setIndeterminate(true); 174 | UnityPlayer.this.A.setLayoutParams((ViewGroup.LayoutParams)new FrameLayout.LayoutParams(-2, -2, 51)); 175 | UnityPlayer.this.addView((View)UnityPlayer.this.A); 176 | } 177 | UnityPlayer.this.A.setVisibility(0); 178 | UnityPlayer.this.bringChildToFront((View)UnityPlayer.this.A); 179 | } 180 | } 181 | }; 182 | this.C = new Runnable(){ 183 | 184 | @Override 185 | public final void run() { 186 | if (UnityPlayer.this.A != null) { 187 | UnityPlayer.this.A.setVisibility(8); 188 | UnityPlayer.this.removeView((View)UnityPlayer.this.A); 189 | UnityPlayer.this.A = null; 190 | } 191 | } 192 | }; 193 | if (contextWrapper instanceof Activity) { 194 | currentActivity = (Activity)contextWrapper; 195 | } 196 | this.g = new t((ViewGroup)this); 197 | this.m = contextWrapper; 198 | this.f = contextWrapper instanceof Activity ? new p(contextWrapper) : null; 199 | this.u = new r((Context)contextWrapper, this); 200 | this.a(); 201 | if (q.a) { 202 | q.i.a((View)this); 203 | } 204 | this.setFullscreen(true); 205 | UnityPlayer.a(this.m.getApplicationInfo()); 206 | if (!v.c()) { 207 | contextWrapper = new AlertDialog.Builder((Context)this.m).setTitle((CharSequence)"Failure to initialize!").setPositiveButton((CharSequence)"OK", new DialogInterface.OnClickListener(){ 208 | 209 | public final void onClick(DialogInterface dialogInterface, int n2) { 210 | UnityPlayer.this.b(); 211 | } 212 | }).setMessage((CharSequence)"Your hardware does not support this application, sorry!").create(); 213 | contextWrapper.setCancelable(false); 214 | contextWrapper.show(); 215 | return; 216 | } 217 | this.nativeFile(this.m.getPackageCodePath()); 218 | this.j(); 219 | this.n = new SurfaceView((Context)contextWrapper); 220 | this.n.getHolder().setFormat(2); 221 | this.n.getHolder().addCallback(new SurfaceHolder.Callback(){ 222 | 223 | public final void surfaceCreated(SurfaceHolder surfaceHolder) { 224 | UnityPlayer.this.a(0, surfaceHolder.getSurface()); 225 | } 226 | 227 | public final void surfaceChanged(SurfaceHolder surfaceHolder, int n2, int n3, int n4) { 228 | UnityPlayer.this.a(0, surfaceHolder.getSurface()); 229 | } 230 | 231 | public final void surfaceDestroyed(SurfaceHolder surfaceHolder) { 232 | UnityPlayer.this.a(0, null); 233 | } 234 | }); 235 | this.n.setFocusable(true); 236 | this.n.setFocusableInTouchMode(true); 237 | this.g.c((View)this.n); 238 | this.q = false; 239 | this.c(); 240 | this.initJni((Context)contextWrapper); 241 | this.nativeInitWWW(WWW.class); 242 | this.nativeInitWebRequest(UnityWebRequest.class); 243 | if (q.e) { 244 | q.l.a(this, (Context)this.m); 245 | } 246 | if (q.h && currentActivity != null) { 247 | q.m.a(currentActivity, new Runnable(){ 248 | 249 | @Override 250 | public final void run() { 251 | UnityPlayer.this.b(new Runnable(){ 252 | 253 | @Override 254 | public final void run() { 255 | UnityPlayer.this.i.d(); 256 | UnityPlayer.this.g(); 257 | } 258 | }); 259 | } 260 | 261 | }); 262 | } 263 | if (q.d) { 264 | q.k.a(this); 265 | } 266 | this.o = (WindowManager)this.m.getSystemService("window"); 267 | this.k(); 268 | this.a.start(); 269 | } 270 | 271 | private void a(int n2, Surface surface) { 272 | if (this.c) { 273 | return; 274 | } 275 | this.b(0, surface); 276 | } 277 | 278 | private boolean b(int n2, Surface surface) { 279 | if (!v.c()) { 280 | return false; 281 | } 282 | this.nativeRecreateGfxState(n2, surface); 283 | return true; 284 | } 285 | 286 | public boolean displayChanged(int n2, Surface surface) { 287 | if (n2 == 0) { 288 | this.c = surface != null; 289 | this.b(new Runnable(){ 290 | 291 | @Override 292 | public final void run() { 293 | if (UnityPlayer.this.c) { 294 | UnityPlayer.this.g.d((View)UnityPlayer.this.n); 295 | return; 296 | } 297 | UnityPlayer.this.g.c((View)UnityPlayer.this.n); 298 | } 299 | }); 300 | } 301 | return this.b(n2, surface); 302 | } 303 | 304 | protected boolean installPresentationDisplay(int n2) { 305 | if (q.e) { 306 | return q.l.a(this, (Context)this.m, n2); 307 | } 308 | return false; 309 | } 310 | 311 | private void a() { 312 | try { 313 | Object object = new File(this.m.getPackageCodePath(), "assets/bin/Data/settings.xml"); 314 | object = object.exists() ? new FileInputStream((File)object) : this.m.getAssets().open("bin/Data/settings.xml"); 315 | XmlPullParserFactory xmlPullParserFactory = XmlPullParserFactory.newInstance(); 316 | xmlPullParserFactory.setNamespaceAware(true); 317 | xmlPullParserFactory = xmlPullParserFactory.newPullParser(); 318 | xmlPullParserFactory.setInput((InputStream)object, null); 319 | object = null; 320 | String string = null; 321 | int n2 = xmlPullParserFactory.getEventType(); 322 | while (n2 != 1) { 323 | if (n2 == 2) { 324 | object = xmlPullParserFactory.getName(); 325 | for (n2 = 0; n2 < xmlPullParserFactory.getAttributeCount(); ++n2) { 326 | if (!xmlPullParserFactory.getAttributeName(n2).equalsIgnoreCase("name")) continue; 327 | string = xmlPullParserFactory.getAttributeValue(n2); 328 | } 329 | } else if (n2 == 3) { 330 | object = null; 331 | } else if (n2 == 4 && string != null) { 332 | if (object.equalsIgnoreCase("integer")) { 333 | this.x.putInt(string, Integer.parseInt(xmlPullParserFactory.getText())); 334 | } else if (object.equalsIgnoreCase("string")) { 335 | this.x.putString(string, xmlPullParserFactory.getText()); 336 | } else if (object.equalsIgnoreCase("bool")) { 337 | this.x.putBoolean(string, Boolean.parseBoolean(xmlPullParserFactory.getText())); 338 | } else if (object.equalsIgnoreCase("float")) { 339 | this.x.putFloat(string, Float.parseFloat(xmlPullParserFactory.getText())); 340 | } 341 | string = null; 342 | } 343 | n2 = xmlPullParserFactory.next(); 344 | } 345 | return; 346 | } 347 | catch (Exception var1_2) { 348 | m.Log(6, "Unable to locate player settings. " + var1_2.getLocalizedMessage()); 349 | this.b(); 350 | return; 351 | } 352 | } 353 | 354 | public Bundle getSettings() { 355 | return this.x; 356 | } 357 | 358 | public static native void UnitySendMessage(String var0, String var1, String var2); 359 | 360 | private void b() { 361 | if (this.m instanceof Activity && !((Activity)this.m).isFinishing()) { 362 | ((Activity)this.m).finish(); 363 | } 364 | } 365 | 366 | static void a(Runnable runnable) { 367 | new Thread(runnable).start(); 368 | } 369 | 370 | final void b(Runnable runnable) { 371 | if (this.m instanceof Activity) { 372 | ((Activity)this.m).runOnUiThread(runnable); 373 | return; 374 | } 375 | m.Log(5, "Not running Unity from an Activity; ignored..."); 376 | } 377 | 378 | public void init(int n2, boolean bl) { 379 | } 380 | 381 | public View getView() { 382 | return this; 383 | } 384 | 385 | private void c() { 386 | o o2 = new o((Activity)this.m); 387 | if (this.m instanceof NativeActivity) { 388 | this.l = o2.a(); 389 | this.nativeForwardEventsToDalvik(this.l); 390 | } 391 | } 392 | 393 | protected void kill() { 394 | Process.killProcess((int)Process.myPid()); 395 | } 396 | 397 | public void quit() { 398 | this.q = true; 399 | if (!this.i.e()) { 400 | this.pause(); 401 | } 402 | this.a.a(); 403 | try { 404 | this.a.join(4000); 405 | } 406 | catch (InterruptedException v0) { 407 | this.a.interrupt(); 408 | } 409 | if (this.k != null) { 410 | this.m.unregisterReceiver(this.k); 411 | } 412 | this.k = null; 413 | if (v.c()) { 414 | this.removeAllViews(); 415 | } 416 | if (q.e) { 417 | q.l.a((Context)this.m); 418 | } 419 | if (q.d) { 420 | q.k.a(); 421 | } 422 | this.kill(); 423 | UnityPlayer.h(); 424 | } 425 | 426 | private void d() { 427 | Iterator iterator = this.y.iterator(); 428 | while (iterator.hasNext()) { 429 | ((com.unity3d.player.a)iterator.next()).c(); 430 | } 431 | } 432 | 433 | private void e() { 434 | for (com.unity3d.player.a a2 : this.y) { 435 | try { 436 | a2.a(this); 437 | } 438 | catch (Exception var3_4) { 439 | String string = "Unable to initialize camera: " + var3_4.getMessage(); 440 | m.Log(6, string); 441 | a2.c(); 442 | } 443 | } 444 | } 445 | 446 | public void pause() { 447 | if (this.z != null) { 448 | this.z.onPause(); 449 | return; 450 | } 451 | this.reportSoftInputStr(null, 1, true); 452 | if (!this.i.g()) { 453 | return; 454 | } 455 | if (v.c()) { 456 | final Semaphore semaphore = new Semaphore(0); 457 | if (this.isFinishing()) { 458 | this.c(new Runnable(){ 459 | 460 | @Override 461 | public final void run() { 462 | UnityPlayer.this.f(); 463 | semaphore.release(); 464 | } 465 | }); 466 | } else { 467 | this.c(new Runnable(){ 468 | 469 | @Override 470 | public final void run() { 471 | if (UnityPlayer.this.nativePause()) { 472 | UnityPlayer.this.q = true; 473 | UnityPlayer.this.f(); 474 | semaphore.release(2); 475 | return; 476 | } 477 | semaphore.release(); 478 | } 479 | }); 480 | } 481 | try { 482 | if (!semaphore.tryAcquire(4, TimeUnit.SECONDS)) { 483 | m.Log(5, "Timeout while trying to pause the Unity Engine."); 484 | } 485 | } 486 | catch (InterruptedException v0) { 487 | m.Log(5, "UI thread got interrupted while trying to pause the Unity Engine."); 488 | } 489 | if (semaphore.drainPermits() > 0) { 490 | this.quit(); 491 | } 492 | } 493 | this.i.c(false); 494 | this.i.b(true); 495 | this.d(); 496 | this.a.c(); 497 | this.u.d(); 498 | } 499 | 500 | public void resume() { 501 | if (q.a) { 502 | q.i.b((View)this); 503 | } 504 | this.i.b(false); 505 | this.g(); 506 | } 507 | 508 | private void f() { 509 | this.nativeDone(); 510 | } 511 | 512 | private void g() { 513 | if (!this.i.f()) { 514 | return; 515 | } 516 | if (this.z != null) { 517 | this.z.onResume(); 518 | return; 519 | } 520 | this.i.c(true); 521 | this.e(); 522 | this.u.e(); 523 | this.v = null; 524 | this.w = null; 525 | if (v.c()) { 526 | this.j(); 527 | } 528 | this.c(new Runnable(){ 529 | 530 | @Override 531 | public final void run() { 532 | UnityPlayer.this.nativeResume(); 533 | } 534 | }); 535 | this.a.b(); 536 | } 537 | 538 | public void configurationChanged(Configuration configuration) { 539 | if (this.n instanceof SurfaceView) { 540 | this.n.getHolder().setSizeFromLayout(); 541 | } 542 | if (this.z != null) { 543 | this.z.updateVideoLayout(); 544 | } 545 | } 546 | 547 | public void windowFocusChanged(final boolean bl) { 548 | this.i.a(bl); 549 | if (bl && this.b != null) { 550 | this.reportSoftInputStr(null, 1, false); 551 | } 552 | if (q.a && bl) { 553 | q.i.b((View)this); 554 | } 555 | this.c(new Runnable(){ 556 | 557 | @Override 558 | public final void run() { 559 | UnityPlayer.this.nativeFocusChanged(bl); 560 | } 561 | }); 562 | this.a.a(bl); 563 | this.g(); 564 | } 565 | 566 | protected static boolean loadLibraryStatic(String string) { 567 | try { 568 | System.loadLibrary(string); 569 | } 570 | catch (UnsatisfiedLinkError v0) { 571 | m.Log(6, "Unable to find " + string); 572 | return false; 573 | } 574 | catch (Exception var0_1) { 575 | m.Log(6, "Unknown error " + var0_1); 576 | return false; 577 | } 578 | return true; 579 | } 580 | 581 | protected boolean loadLibrary(String string) { 582 | return UnityPlayer.loadLibraryStatic(string); 583 | } 584 | 585 | protected void startActivityIndicator() { 586 | this.b(this.B); 587 | } 588 | 589 | protected void stopActivityIndicator() { 590 | this.b(this.C); 591 | } 592 | 593 | private final native void nativeFile(String var1); 594 | 595 | private final native void initJni(Context var1); 596 | 597 | private final native void nativeSetExtras(Bundle var1); 598 | 599 | private final native void nativeSetTouchDeltaY(float var1); 600 | 601 | private final native boolean nativeRender(); 602 | 603 | private final native void nativeSetInputString(String var1); 604 | 605 | private final native void nativeSetInputCanceled(boolean var1); 606 | 607 | private final native boolean nativePause(); 608 | 609 | private final native void nativeResume(); 610 | 611 | private final native void nativeFocusChanged(boolean var1); 612 | 613 | private final native void nativeRecreateGfxState(int var1, Surface var2); 614 | 615 | private final native void nativeDone(); 616 | 617 | private final native void nativeSoftInputClosed(); 618 | 619 | private final native void nativeInitWWW(Class var1); 620 | 621 | private final native void nativeInitWebRequest(Class var1); 622 | 623 | private final native void nativeVideoFrameCallback(int var1, byte[] var2, int var3, int var4); 624 | 625 | private final native int nativeActivityIndicatorStyle(); 626 | 627 | private final native boolean nativeInjectEvent(InputEvent var1); 628 | 629 | protected final native void nativeAddVSyncTime(long var1); 630 | 631 | final native void nativeForwardEventsToDalvik(boolean var1); 632 | 633 | protected static void lockNativeAccess() { 634 | D.lock(); 635 | } 636 | 637 | protected static void unlockNativeAccess() { 638 | D.unlock(); 639 | } 640 | 641 | private static void a(ApplicationInfo applicationInfo) { 642 | if (p && NativeLoader.load(applicationInfo.nativeLibraryDir)) { 643 | v.a(); 644 | } 645 | } 646 | 647 | private static void h() { 648 | if (!v.c()) { 649 | return; 650 | } 651 | UnityPlayer.lockNativeAccess(); 652 | if (!NativeLoader.unload()) { 653 | UnityPlayer.unlockNativeAccess(); 654 | throw new UnsatisfiedLinkError("Unable to unload libraries from libmain.so"); 655 | } 656 | v.b(); 657 | UnityPlayer.unlockNativeAccess(); 658 | } 659 | 660 | protected void forwardMotionEventToDalvik(long l2, long l3, int n2, int n3, int[] arrn, float[] arrf, int n4, float f2, float f3, int n5, int n6, int n7, int n8, int n9, long[] arrl, float[] arrf2) { 661 | this.f.a(l2, l3, n2, n3, arrn, arrf, n4, f2, f3, n5, n6, n7, n8, n9, arrl, arrf2); 662 | } 663 | 664 | protected void setFullscreen(final boolean bl) { 665 | this.e = bl; 666 | if (q.a) { 667 | this.b(new Runnable(){ 668 | 669 | @Override 670 | public final void run() { 671 | q.i.a((View)UnityPlayer.this, bl); 672 | } 673 | }); 674 | } 675 | } 676 | 677 | protected void showSoftInput(final String string, final int n2, final boolean bl, final boolean bl2, final boolean bl3, final boolean bl4, final String string2) { 678 | final UnityPlayer unityPlayer = this; 679 | this.b(new Runnable(){ 680 | 681 | @Override 682 | public final void run() { 683 | UnityPlayer.this.b = new s((Context)UnityPlayer.this.m, unityPlayer, string, n2, bl, bl2, bl3, string2); 684 | UnityPlayer.this.b.show(); 685 | } 686 | }); 687 | } 688 | 689 | protected void hideSoftInput() { 690 | final Runnable runnable = new Runnable(){ 691 | 692 | @Override 693 | public final void run() { 694 | if (UnityPlayer.this.b != null) { 695 | UnityPlayer.this.b.dismiss(); 696 | UnityPlayer.this.b = null; 697 | } 698 | } 699 | }; 700 | if (q.g) { 701 | this.a(new c(){ 702 | 703 | @Override 704 | public final void a() { 705 | UnityPlayer.this.b(runnable); 706 | } 707 | }); 708 | return; 709 | } 710 | this.b(runnable); 711 | } 712 | 713 | protected void setSoftInputStr(final String string) { 714 | this.b(new Runnable(){ 715 | 716 | @Override 717 | public final void run() { 718 | if (UnityPlayer.this.b != null && string != null) { 719 | UnityPlayer.this.b.a(string); 720 | } 721 | } 722 | }); 723 | } 724 | 725 | protected void reportSoftInputStr(final String string, final int n2, final boolean bl) { 726 | if (n2 == 1) { 727 | this.hideSoftInput(); 728 | } 729 | this.a(new c(){ 730 | 731 | @Override 732 | public final void a() { 733 | if (bl) { 734 | UnityPlayer.this.nativeSetInputCanceled(true); 735 | } else if (string != null) { 736 | UnityPlayer.this.nativeSetInputString(string); 737 | } 738 | if (n2 == 1) { 739 | UnityPlayer.this.nativeSoftInputClosed(); 740 | } 741 | } 742 | }); 743 | } 744 | 745 | protected int[] initCamera(int n2, int n3, int n4, int n5) { 746 | com.unity3d.player.a a2 = new com.unity3d.player.a(n2, n3, n4, n5); 747 | try { 748 | a2.a(this); 749 | this.y.add(a2); 750 | Camera.Size size = a2.b(); 751 | return new int[]{size.width, size.height}; 752 | } 753 | catch (Exception var2_5) { 754 | String string = "Unable to initialize camera: " + var2_5.getMessage(); 755 | m.Log(6, string); 756 | a2.c(); 757 | return null; 758 | } 759 | } 760 | 761 | protected void closeCamera(int n2) { 762 | for (com.unity3d.player.a a2 : this.y) { 763 | if (a2.a() != n2) continue; 764 | a2.c(); 765 | this.y.remove(a2); 766 | return; 767 | } 768 | } 769 | 770 | protected int getNumCameras() { 771 | if (!this.i()) { 772 | return 0; 773 | } 774 | return Camera.getNumberOfCameras(); 775 | } 776 | 777 | @Override 778 | public void onCameraFrame(final com.unity3d.player.a a2, final byte[] arrby) { 779 | final int n2 = a2.a(); 780 | final Camera.Size size = a2.b(); 781 | this.a(new c(){ 782 | 783 | @Override 784 | public final void a() { 785 | UnityPlayer.this.nativeVideoFrameCallback(n2, arrby, size.width, size.height); 786 | a2.a(arrby); 787 | } 788 | }); 789 | } 790 | 791 | protected boolean isCameraFrontFacing(int n2) { 792 | Camera.CameraInfo cameraInfo = new Camera.CameraInfo(); 793 | Camera.getCameraInfo((int)n2, (Camera.CameraInfo)cameraInfo); 794 | if (cameraInfo.facing == 1) { 795 | return true; 796 | } 797 | return false; 798 | } 799 | 800 | protected int getCameraOrientation(int n2) { 801 | Camera.CameraInfo cameraInfo = new Camera.CameraInfo(); 802 | Camera.getCameraInfo((int)n2, (Camera.CameraInfo)cameraInfo); 803 | return cameraInfo.orientation; 804 | } 805 | 806 | protected void showVideoPlayer(final String string, final int n2, final int n3, final int n4, final boolean bl, final int n5, final int n6) { 807 | this.b(new Runnable(){ 808 | 809 | @Override 810 | public final void run() { 811 | if (UnityPlayer.this.z != null) { 812 | return; 813 | } 814 | UnityPlayer.this.pause(); 815 | UnityPlayer.this.z = new w(UnityPlayer.this, (Context)UnityPlayer.this.m, string, n2, n3, n4, bl, n5, n6); 816 | UnityPlayer.this.addView((View)UnityPlayer.this.z); 817 | UnityPlayer.this.z.requestFocus(); 818 | UnityPlayer.this.g.d((View)UnityPlayer.this.n); 819 | } 820 | }); 821 | } 822 | 823 | protected void hideVideoPlayer() { 824 | this.b(new Runnable(){ 825 | 826 | @Override 827 | public final void run() { 828 | if (UnityPlayer.this.z == null) { 829 | return; 830 | } 831 | UnityPlayer.this.g.c((View)UnityPlayer.this.n); 832 | UnityPlayer.this.removeView((View)UnityPlayer.this.z); 833 | UnityPlayer.this.z = null; 834 | UnityPlayer.this.resume(); 835 | } 836 | }); 837 | } 838 | 839 | protected void Location_SetDesiredAccuracy(float f2) { 840 | this.u.b(f2); 841 | } 842 | 843 | protected void Location_SetDistanceFilter(float f2) { 844 | this.u.a(f2); 845 | } 846 | 847 | protected native void nativeSetLocationStatus(int var1); 848 | 849 | protected native void nativeSetLocation(float var1, float var2, float var3, float var4, double var5, float var7); 850 | 851 | protected void Location_StartUpdatingLocation() { 852 | this.u.b(); 853 | } 854 | 855 | protected void Location_StopUpdatingLocation() { 856 | this.u.c(); 857 | } 858 | 859 | protected boolean Location_IsServiceEnabledByUser() { 860 | return this.u.a(); 861 | } 862 | 863 | private boolean i() { 864 | if (this.m.getPackageManager().hasSystemFeature("android.hardware.camera") || this.m.getPackageManager().hasSystemFeature("android.hardware.camera.front")) { 865 | return true; 866 | } 867 | return false; 868 | } 869 | 870 | protected int getSplashMode() { 871 | return this.x.getInt("splash_mode"); 872 | } 873 | 874 | protected void executeGLThreadJobs() { 875 | Runnable runnable; 876 | while ((runnable = (Runnable)this.j.poll()) != null) { 877 | runnable.run(); 878 | } 879 | } 880 | 881 | protected void disableLogger() { 882 | m.a = true; 883 | } 884 | 885 | private void c(Runnable runnable) { 886 | if (!v.c()) { 887 | return; 888 | } 889 | if (Thread.currentThread() == this.a) { 890 | runnable.run(); 891 | return; 892 | } 893 | this.j.add(runnable); 894 | } 895 | 896 | private void a(c c2) { 897 | if (this.isFinishing()) { 898 | return; 899 | } 900 | this.c(c2); 901 | } 902 | 903 | protected boolean isFinishing() { 904 | if (this.q || (this.q = this.m instanceof Activity && ((Activity)this.m).isFinishing())) { 905 | return true; 906 | } 907 | return false; 908 | } 909 | 910 | private void j() { 911 | if (!this.x.getBoolean("useObb")) { 912 | return; 913 | } 914 | for (String string : UnityPlayer.a((Context)this.m)) { 915 | String string2 = UnityPlayer.a(string); 916 | if (this.x.getBoolean(string2)) { 917 | this.nativeFile(string); 918 | } 919 | this.x.remove(string2); 920 | } 921 | } 922 | 923 | private static String[] a(Context context) { 924 | int n2; 925 | Object object; 926 | String string = context.getPackageName(); 927 | Vector vector = new Vector(); 928 | try { 929 | n2 = context.getPackageManager().getPackageInfo((String)string, (int)0).versionCode; 930 | } 931 | catch (PackageManager.NameNotFoundException v0) { 932 | return new String[0]; 933 | } 934 | if (Environment.getExternalStorageState().equals("mounted")) { 935 | object = Environment.getExternalStorageDirectory(); 936 | if ((object = new File(object.toString() + "/Android/obb/" + string)).exists()) { 937 | String string2; 938 | if (n2 > 0 && new File(string2 = object + File.separator + "main." + n2 + "." + string + ".obb").isFile()) { 939 | vector.add(string2); 940 | } 941 | if (n2 > 0 && new File(string2 = object + File.separator + "patch." + n2 + "." + string + ".obb").isFile()) { 942 | vector.add(string2); 943 | } 944 | } 945 | } 946 | object = new String[vector.size()]; 947 | vector.toArray((T[])object); 948 | return object; 949 | } 950 | 951 | private static String a(String arrby) { 952 | int n2; 953 | Object object; 954 | byte[] arrby2; 955 | arrby2 = null; 956 | try { 957 | MessageDigest messageDigest = MessageDigest.getInstance("MD5"); 958 | object = new FileInputStream((String)arrby); 959 | long l2 = new File((String)arrby).length(); 960 | object.skip(l2 - Math.min(l2, 65558)); 961 | arrby = new byte[1024]; 962 | n2 = 0; 963 | while (n2 != -1) { 964 | messageDigest.update(arrby, 0, n2); 965 | n2 = object.read(arrby); 966 | } 967 | arrby2 = messageDigest.digest(); 968 | } 969 | catch (FileNotFoundException v0) { 970 | } 971 | catch (IOException v1) { 972 | } 973 | catch (NoSuchAlgorithmException v2) {} 974 | if (arrby2 == null) { 975 | return null; 976 | } 977 | object = new StringBuffer(); 978 | for (n2 = 0; n2 < arrby2.length; ++n2) { 979 | object.append(Integer.toString((arrby2[n2] & 255) + 256, 16).substring(1)); 980 | } 981 | return object.toString(); 982 | } 983 | 984 | private void k() { 985 | ((Activity)this.m).getWindow().setFlags(1024, 1024); 986 | } 987 | 988 | public boolean injectEvent(InputEvent inputEvent) { 989 | return this.nativeInjectEvent(inputEvent); 990 | } 991 | 992 | public boolean onKeyUp(int n2, KeyEvent keyEvent) { 993 | return this.injectEvent((InputEvent)keyEvent); 994 | } 995 | 996 | public boolean onKeyDown(int n2, KeyEvent keyEvent) { 997 | return this.injectEvent((InputEvent)keyEvent); 998 | } 999 | 1000 | public boolean onKeyMultiple(int n2, int n3, KeyEvent keyEvent) { 1001 | return this.injectEvent((InputEvent)keyEvent); 1002 | } 1003 | 1004 | public boolean onTouchEvent(MotionEvent motionEvent) { 1005 | return this.injectEvent((InputEvent)motionEvent); 1006 | } 1007 | 1008 | public boolean onGenericMotionEvent(MotionEvent motionEvent) { 1009 | return this.injectEvent((InputEvent)motionEvent); 1010 | } 1011 | 1012 | static { 1013 | new u().a(); 1014 | p = false; 1015 | p = UnityPlayer.loadLibraryStatic("main"); 1016 | D = new ReentrantLock(); 1017 | } 1018 | 1019 | private abstract class c 1020 | implements Runnable { 1021 | private c() { 1022 | } 1023 | 1024 | @Override 1025 | public final void run() { 1026 | if (!UnityPlayer.this.isFinishing()) { 1027 | this.a(); 1028 | } 1029 | } 1030 | 1031 | public abstract void a(); 1032 | 1033 | /* synthetic */ c(byte by) { 1034 | this(); 1035 | } 1036 | } 1037 | 1038 | private final class b 1039 | extends Thread { 1040 | ArrayBlockingQueue a; 1041 | boolean b; 1042 | 1043 | b() { 1044 | this.b = false; 1045 | this.a = new ArrayBlockingQueue(32); 1046 | } 1047 | 1048 | @Override 1049 | public final void run() { 1050 | this.setName("UnityMain"); 1051 | try { 1052 | a a2; 1053 | block2 : while ((a2 = (a)((Object)this.a.take())) != a.c) { 1054 | if (a2 == a.b) { 1055 | this.b = true; 1056 | } else if (a2 == a.a) { 1057 | this.b = false; 1058 | UnityPlayer.this.executeGLThreadJobs(); 1059 | } else if (a2 == a.e && !this.b) { 1060 | UnityPlayer.this.executeGLThreadJobs(); 1061 | } 1062 | if (!this.b) continue; 1063 | do { 1064 | UnityPlayer.this.executeGLThreadJobs(); 1065 | if (this.a.peek() != null) continue block2; 1066 | if (UnityPlayer.this.isFinishing() || UnityPlayer.this.nativeRender()) continue; 1067 | UnityPlayer.this.b(); 1068 | } while (!b.interrupted()); 1069 | } 1070 | return; 1071 | } 1072 | catch (InterruptedException v0) { 1073 | return; 1074 | } 1075 | } 1076 | 1077 | public final void a() { 1078 | this.a(a.c); 1079 | } 1080 | 1081 | public final void b() { 1082 | this.a(a.b); 1083 | } 1084 | 1085 | public final void c() { 1086 | this.a(a.a); 1087 | } 1088 | 1089 | public final void a(boolean bl) { 1090 | this.a(bl ? a.d : a.e); 1091 | } 1092 | 1093 | private void a(a a2) { 1094 | try { 1095 | this.a.put(a2); 1096 | return; 1097 | } 1098 | catch (InterruptedException v0) { 1099 | this.interrupt(); 1100 | return; 1101 | } 1102 | } 1103 | } 1104 | 1105 | static final class a 1106 | extends Enum { 1107 | public static final /* enum */ a a = new a(); 1108 | public static final /* enum */ a b = new a(); 1109 | public static final /* enum */ a c = new a(); 1110 | public static final /* enum */ a d = new a(); 1111 | public static final /* enum */ a e = new a(); 1112 | private static final /* synthetic */ a[] f; 1113 | 1114 | private a() { 1115 | super(string, n2); 1116 | } 1117 | 1118 | static { 1119 | f = new a[]{a, b, c, d, e}; 1120 | } 1121 | } 1122 | 1123 | } 1124 | 1125 | -------------------------------------------------------------------------------- /com/unity3d/player/UnityPlayerActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | * 4 | * Could not load the following classes: 5 | * android.app.Activity 6 | * android.content.ContextWrapper 7 | * android.content.res.Configuration 8 | * android.os.Bundle 9 | * android.view.InputEvent 10 | * android.view.KeyEvent 11 | * android.view.MotionEvent 12 | * android.view.View 13 | * android.view.Window 14 | */ 15 | package com.unity3d.player; 16 | 17 | import android.app.Activity; 18 | import android.content.ContextWrapper; 19 | import android.content.res.Configuration; 20 | import android.os.Bundle; 21 | import android.view.InputEvent; 22 | import android.view.KeyEvent; 23 | import android.view.MotionEvent; 24 | import android.view.View; 25 | import android.view.Window; 26 | import com.unity3d.player.UnityPlayer; 27 | 28 | public class UnityPlayerActivity 29 | extends Activity { 30 | protected UnityPlayer mUnityPlayer; 31 | 32 | protected void onCreate(Bundle bundle) { 33 | this.requestWindowFeature(1); 34 | super.onCreate(bundle); 35 | this.getWindow().setFormat(2); 36 | this.mUnityPlayer = new UnityPlayer((ContextWrapper)this); 37 | this.setContentView((View)this.mUnityPlayer); 38 | this.mUnityPlayer.requestFocus(); 39 | } 40 | 41 | protected void onDestroy() { 42 | this.mUnityPlayer.quit(); 43 | super.onDestroy(); 44 | } 45 | 46 | protected void onPause() { 47 | super.onPause(); 48 | this.mUnityPlayer.pause(); 49 | } 50 | 51 | protected void onResume() { 52 | super.onResume(); 53 | this.mUnityPlayer.resume(); 54 | } 55 | 56 | public void onConfigurationChanged(Configuration configuration) { 57 | super.onConfigurationChanged(configuration); 58 | this.mUnityPlayer.configurationChanged(configuration); 59 | } 60 | 61 | public void onWindowFocusChanged(boolean bl) { 62 | super.onWindowFocusChanged(bl); 63 | this.mUnityPlayer.windowFocusChanged(bl); 64 | } 65 | 66 | public boolean dispatchKeyEvent(KeyEvent keyEvent) { 67 | if (keyEvent.getAction() == 2) { 68 | return this.mUnityPlayer.injectEvent((InputEvent)keyEvent); 69 | } 70 | return super.dispatchKeyEvent(keyEvent); 71 | } 72 | 73 | public boolean onKeyUp(int n2, KeyEvent keyEvent) { 74 | return this.mUnityPlayer.injectEvent((InputEvent)keyEvent); 75 | } 76 | 77 | public boolean onKeyDown(int n2, KeyEvent keyEvent) { 78 | return this.mUnityPlayer.injectEvent((InputEvent)keyEvent); 79 | } 80 | 81 | public boolean onTouchEvent(MotionEvent motionEvent) { 82 | return this.mUnityPlayer.injectEvent((InputEvent)motionEvent); 83 | } 84 | 85 | public boolean onGenericMotionEvent(MotionEvent motionEvent) { 86 | return this.mUnityPlayer.injectEvent((InputEvent)motionEvent); 87 | } 88 | } 89 | 90 | -------------------------------------------------------------------------------- /com/unity3d/player/UnityPlayerNativeActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | * 4 | * Could not load the following classes: 5 | * android.app.NativeActivity 6 | * android.content.ContextWrapper 7 | * android.content.res.Configuration 8 | * android.os.Bundle 9 | * android.view.InputEvent 10 | * android.view.KeyEvent 11 | * android.view.MotionEvent 12 | * android.view.SurfaceHolder 13 | * android.view.SurfaceHolder$Callback2 14 | * android.view.View 15 | * android.view.Window 16 | */ 17 | package com.unity3d.player; 18 | 19 | import android.app.NativeActivity; 20 | import android.content.ContextWrapper; 21 | import android.content.res.Configuration; 22 | import android.os.Bundle; 23 | import android.view.InputEvent; 24 | import android.view.KeyEvent; 25 | import android.view.MotionEvent; 26 | import android.view.SurfaceHolder; 27 | import android.view.View; 28 | import android.view.Window; 29 | import com.unity3d.player.UnityPlayer; 30 | 31 | public class UnityPlayerNativeActivity 32 | extends NativeActivity { 33 | protected UnityPlayer mUnityPlayer; 34 | 35 | protected void onCreate(Bundle bundle) { 36 | this.requestWindowFeature(1); 37 | super.onCreate(bundle); 38 | this.getWindow().takeSurface(null); 39 | this.getWindow().setFormat(2); 40 | this.mUnityPlayer = new UnityPlayer((ContextWrapper)this); 41 | this.setContentView((View)this.mUnityPlayer); 42 | this.mUnityPlayer.requestFocus(); 43 | } 44 | 45 | protected void onDestroy() { 46 | this.mUnityPlayer.quit(); 47 | super.onDestroy(); 48 | } 49 | 50 | protected void onPause() { 51 | super.onPause(); 52 | this.mUnityPlayer.pause(); 53 | } 54 | 55 | protected void onResume() { 56 | super.onResume(); 57 | this.mUnityPlayer.resume(); 58 | } 59 | 60 | public void onConfigurationChanged(Configuration configuration) { 61 | super.onConfigurationChanged(configuration); 62 | this.mUnityPlayer.configurationChanged(configuration); 63 | } 64 | 65 | public void onWindowFocusChanged(boolean bl) { 66 | super.onWindowFocusChanged(bl); 67 | this.mUnityPlayer.windowFocusChanged(bl); 68 | } 69 | 70 | public boolean dispatchKeyEvent(KeyEvent keyEvent) { 71 | if (keyEvent.getAction() == 2) { 72 | return this.mUnityPlayer.injectEvent((InputEvent)keyEvent); 73 | } 74 | return super.dispatchKeyEvent(keyEvent); 75 | } 76 | 77 | public boolean onKeyUp(int n2, KeyEvent keyEvent) { 78 | return this.mUnityPlayer.injectEvent((InputEvent)keyEvent); 79 | } 80 | 81 | public boolean onKeyDown(int n2, KeyEvent keyEvent) { 82 | return this.mUnityPlayer.injectEvent((InputEvent)keyEvent); 83 | } 84 | 85 | public boolean onTouchEvent(MotionEvent motionEvent) { 86 | return this.mUnityPlayer.injectEvent((InputEvent)motionEvent); 87 | } 88 | 89 | public boolean onGenericMotionEvent(MotionEvent motionEvent) { 90 | return this.mUnityPlayer.injectEvent((InputEvent)motionEvent); 91 | } 92 | } 93 | 94 | -------------------------------------------------------------------------------- /com/unity3d/player/UnityPlayerProxyActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | * 4 | * Could not load the following classes: 5 | * android.app.Activity 6 | * android.content.Context 7 | * android.content.Intent 8 | * android.os.Bundle 9 | */ 10 | package com.unity3d.player; 11 | 12 | import android.app.Activity; 13 | import android.content.Context; 14 | import android.content.Intent; 15 | import android.os.Bundle; 16 | import com.unity3d.player.UnityPlayerActivity; 17 | 18 | public class UnityPlayerProxyActivity 19 | extends Activity { 20 | protected void onCreate(Bundle bundle) { 21 | super.onCreate(bundle); 22 | bundle = new Intent((Context)this, (Class)UnityPlayerActivity.class); 23 | bundle.addFlags(65536); 24 | Bundle bundle2 = this.getIntent().getExtras(); 25 | if (bundle2 != null) { 26 | bundle.putExtras(bundle2); 27 | } 28 | this.startActivity((Intent)bundle); 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /com/unity3d/player/UnityWebRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | */ 4 | package com.unity3d.player; 5 | 6 | import com.unity3d.player.m; 7 | import com.unity3d.player.q; 8 | import java.io.IOException; 9 | import java.io.InputStream; 10 | import java.io.OutputStream; 11 | import java.net.HttpURLConnection; 12 | import java.net.JarURLConnection; 13 | import java.net.MalformedURLException; 14 | import java.net.ProtocolException; 15 | import java.net.URL; 16 | import java.net.URLConnection; 17 | import java.net.UnknownHostException; 18 | import java.nio.Buffer; 19 | import java.nio.ByteBuffer; 20 | import java.nio.channels.Channels; 21 | import java.security.SecureRandom; 22 | import java.util.Iterator; 23 | import java.util.List; 24 | import java.util.Map; 25 | import java.util.Set; 26 | import javax.net.ssl.HttpsURLConnection; 27 | import javax.net.ssl.KeyManager; 28 | import javax.net.ssl.SSLContext; 29 | import javax.net.ssl.SSLHandshakeException; 30 | import javax.net.ssl.SSLSocketFactory; 31 | import javax.net.ssl.TrustManager; 32 | 33 | class UnityWebRequest 34 | implements Runnable { 35 | private long a; 36 | private String b; 37 | private String c; 38 | private Map d; 39 | private static final String[] e = new String[]{"TLSv1.2", "TLSv1.1"}; 40 | private static volatile SSLSocketFactory f; 41 | 42 | private static SSLSocketFactory getSSLSocketFactory() { 43 | if (q.g) { 44 | return null; 45 | } 46 | if (f != null) { 47 | return f; 48 | } 49 | String[] arrstring = e; 50 | synchronized (arrstring) { 51 | for (String string : e) { 52 | try { 53 | SSLContext sSLContext = SSLContext.getInstance(string); 54 | sSLContext.init(null, null, null); 55 | f = sSLContext.getSocketFactory(); 56 | return f; 57 | } 58 | catch (Exception var5_6) { 59 | m.Log(5, "UnityWebRequest: No support for " + string + " (" + var5_6.getMessage() + ")"); 60 | continue; 61 | } 62 | } 63 | } 64 | return null; 65 | } 66 | 67 | UnityWebRequest(long l2, String string, Map map, String string2) { 68 | this.a = l2; 69 | this.b = string2; 70 | this.c = string; 71 | this.d = map; 72 | } 73 | 74 | @Override 75 | public void run() { 76 | URLConnection uRLConnection; 77 | Object object; 78 | Object object2; 79 | int n2; 80 | Iterator iterator; 81 | try { 82 | object2 = new URL(this.b); 83 | uRLConnection = object2.openConnection(); 84 | if (uRLConnection instanceof HttpsURLConnection && (iterator = UnityWebRequest.getSSLSocketFactory()) != null) { 85 | ((HttpsURLConnection)uRLConnection).setSSLSocketFactory((SSLSocketFactory)((Object)iterator)); 86 | } 87 | } 88 | catch (MalformedURLException var3_5) { 89 | this.malformattedUrlCallback(var3_5.toString()); 90 | return; 91 | } 92 | catch (IOException var3_6) { 93 | this.errorCallback(var3_6.toString()); 94 | return; 95 | } 96 | if (object2.getProtocol().equalsIgnoreCase("file") && !object2.getHost().isEmpty()) { 97 | this.malformattedUrlCallback("file:// must use an absolute path"); 98 | return; 99 | } 100 | if (uRLConnection instanceof JarURLConnection) { 101 | this.badProtocolCallback("A URL Connection to a Java ARchive (JAR) file or an entry in a JAR file is not supported"); 102 | return; 103 | } 104 | if (uRLConnection instanceof HttpURLConnection) { 105 | try { 106 | iterator = (HttpURLConnection)uRLConnection; 107 | iterator.setRequestMethod(this.c); 108 | iterator.setInstanceFollowRedirects(false); 109 | } 110 | catch (ProtocolException var3_7) { 111 | this.badProtocolCallback(var3_7.toString()); 112 | return; 113 | } 114 | } 115 | if (this.d != null) { 116 | for (Map.Entry entry : this.d.entrySet()) { 117 | uRLConnection.addRequestProperty((String)entry.getKey(), (String)entry.getValue()); 118 | } 119 | } 120 | int n3 = 1428; 121 | int n4 = this.uploadCallback(null); 122 | if (n4 > 0) { 123 | uRLConnection.setDoOutput(true); 124 | try { 125 | ByteBuffer byteBuffer = ByteBuffer.allocateDirect(Math.min(n4, 1428)); 126 | OutputStream outputStream = uRLConnection.getOutputStream(); 127 | object = this.uploadCallback(byteBuffer); 128 | while (object > 0) { 129 | outputStream.write(byteBuffer.array(), byteBuffer.arrayOffset(), (int)object); 130 | object = this.uploadCallback(byteBuffer); 131 | } 132 | } 133 | catch (Exception var4_12) { 134 | this.errorCallback(var4_12.toString()); 135 | return; 136 | } 137 | } 138 | if (uRLConnection instanceof HttpURLConnection) { 139 | HttpURLConnection httpURLConnection = (HttpURLConnection)uRLConnection; 140 | try { 141 | int n5 = httpURLConnection.getResponseCode(); 142 | this.responseCodeCallback(n5); 143 | } 144 | catch (UnknownHostException var6_27) { 145 | this.unknownHostCallback(var6_27.toString()); 146 | } 147 | catch (IOException var6_28) { 148 | this.errorCallback(var6_28.toString()); 149 | return; 150 | } 151 | } 152 | Map> map = uRLConnection.getHeaderFields(); 153 | this.headerCallback(map); 154 | if (!(map != null && map.containsKey("content-length") || uRLConnection.getContentLength() == -1)) { 155 | this.headerCallback("content-length", String.valueOf(uRLConnection.getContentLength())); 156 | } 157 | if (!(map != null && map.containsKey("content-type") || uRLConnection.getContentType() == null)) { 158 | this.headerCallback("content-type", uRLConnection.getContentType()); 159 | } 160 | if ((n2 = uRLConnection.getContentLength()) > 0) { 161 | this.contentLengthCallback(n2); 162 | } 163 | if (object2.getProtocol().equalsIgnoreCase("file")) { 164 | n3 = n2 == 0 ? 32768 : Math.min(n2, 32768); 165 | } 166 | try { 167 | void var5_20; 168 | void var5_22; 169 | Object var5_18 = null; 170 | if (uRLConnection instanceof HttpURLConnection) { 171 | HttpURLConnection httpURLConnection = (HttpURLConnection)uRLConnection; 172 | this.responseCodeCallback(httpURLConnection.getResponseCode()); 173 | InputStream inputStream = httpURLConnection.getErrorStream(); 174 | } 175 | if (var5_20 == null) { 176 | InputStream inputStream = uRLConnection.getInputStream(); 177 | } 178 | object = Channels.newChannel((InputStream)var5_22); 179 | object2 = ByteBuffer.allocateDirect(n3); 180 | int n6 = object.read((ByteBuffer)object2); 181 | while (n6 != -1 && this.downloadCallback((ByteBuffer)object2, n6)) { 182 | object2.clear(); 183 | n6 = object.read((ByteBuffer)object2); 184 | } 185 | object.close(); 186 | return; 187 | } 188 | catch (UnknownHostException var5_23) { 189 | this.unknownHostCallback(var5_23.toString()); 190 | return; 191 | } 192 | catch (SSLHandshakeException var5_24) { 193 | this.sslCannotConnectCallback(var5_24.toString()); 194 | return; 195 | } 196 | catch (Exception var5_25) { 197 | this.errorCallback(var5_25.toString()); 198 | return; 199 | } 200 | } 201 | 202 | private static native void headerCallback(long var0, String var2, String var3); 203 | 204 | protected void headerCallback(String string, String string2) { 205 | UnityWebRequest.headerCallback(this.a, string, string2); 206 | } 207 | 208 | protected void headerCallback(Map object) { 209 | if (object == null || object.size() == 0) { 210 | return; 211 | } 212 | object = object.entrySet().iterator(); 213 | while (object.hasNext()) { 214 | Map.Entry entry = (Map.Entry)object.next(); 215 | String string = (String)entry.getKey(); 216 | if (string == null) { 217 | string = "Status"; 218 | } 219 | for (String string2 : (List)entry.getValue()) { 220 | this.headerCallback(string, string2); 221 | } 222 | } 223 | } 224 | 225 | private static native int uploadCallback(long var0, ByteBuffer var2); 226 | 227 | protected int uploadCallback(ByteBuffer byteBuffer) { 228 | return UnityWebRequest.uploadCallback(this.a, byteBuffer); 229 | } 230 | 231 | private static native void contentLengthCallback(long var0, int var2); 232 | 233 | protected void contentLengthCallback(int n2) { 234 | UnityWebRequest.contentLengthCallback(this.a, n2); 235 | } 236 | 237 | private static native boolean downloadCallback(long var0, ByteBuffer var2, int var3); 238 | 239 | protected boolean downloadCallback(ByteBuffer byteBuffer, int n2) { 240 | return UnityWebRequest.downloadCallback(this.a, byteBuffer, n2); 241 | } 242 | 243 | protected void responseCodeCallback(int n2) { 244 | UnityWebRequest.responseCodeCallback(this.a, n2); 245 | } 246 | 247 | private static native void responseCodeCallback(long var0, int var2); 248 | 249 | protected void unknownHostCallback(String string) { 250 | UnityWebRequest.errorCallback(this.a, 7, string); 251 | } 252 | 253 | protected void badProtocolCallback(String string) { 254 | UnityWebRequest.errorCallback(this.a, 4, string); 255 | } 256 | 257 | protected void malformattedUrlCallback(String string) { 258 | UnityWebRequest.errorCallback(this.a, 5, string); 259 | } 260 | 261 | protected void sslCannotConnectCallback(String string) { 262 | UnityWebRequest.errorCallback(this.a, 16, string); 263 | } 264 | 265 | protected void errorCallback(String string) { 266 | UnityWebRequest.errorCallback(this.a, 2, string); 267 | } 268 | 269 | private static native void errorCallback(long var0, int var2, String var3); 270 | } 271 | 272 | -------------------------------------------------------------------------------- /com/unity3d/player/WWW.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | */ 4 | package com.unity3d.player; 5 | 6 | import java.io.IOException; 7 | import java.io.InputStream; 8 | import java.io.OutputStream; 9 | import java.net.HttpURLConnection; 10 | import java.net.MalformedURLException; 11 | import java.net.URL; 12 | import java.net.URLConnection; 13 | import java.util.Iterator; 14 | import java.util.List; 15 | import java.util.Map; 16 | import java.util.Set; 17 | 18 | class WWW 19 | extends Thread { 20 | private int a; 21 | private int b; 22 | private String c; 23 | private byte[] d; 24 | private Map e; 25 | 26 | WWW(int n2, String string, byte[] arrby, Map map) { 27 | this.b = n2; 28 | this.c = string; 29 | this.d = arrby; 30 | this.e = map; 31 | this.a = 0; 32 | this.start(); 33 | } 34 | 35 | @Override 36 | public void run() { 37 | int n2; 38 | URLConnection uRLConnection; 39 | Object object2; 40 | int n3; 41 | byte[] arrby; 42 | if (++this.a > 5) { 43 | WWW.errorCallback(this.b, "Too many redirects"); 44 | return; 45 | } 46 | try { 47 | object2 = new URL(this.c); 48 | uRLConnection = object2.openConnection(); 49 | } 50 | catch (MalformedURLException var3_3) { 51 | WWW.errorCallback(this.b, var3_3.toString()); 52 | return; 53 | } 54 | catch (IOException var3_4) { 55 | WWW.errorCallback(this.b, var3_4.toString()); 56 | return; 57 | } 58 | if (object2.getProtocol().equalsIgnoreCase("file") && object2.getHost() != null && object2.getHost().length() != 0) { 59 | WWW.errorCallback(this.b, object2.getHost() + object2.getFile() + " is not an absolute path!"); 60 | return; 61 | } 62 | if (this.e != null) { 63 | for (Map.Entry object3 : this.e.entrySet()) { 64 | uRLConnection.addRequestProperty((String)object3.getKey(), (String)object3.getValue()); 65 | } 66 | } 67 | int n4 = 1428; 68 | if (this.d != null) { 69 | uRLConnection.setDoOutput(true); 70 | try { 71 | OutputStream n22 = uRLConnection.getOutputStream(); 72 | n2 = 0; 73 | while (n2 < this.d.length) { 74 | int n5 = Math.min(1428, this.d.length - n2); 75 | n22.write(this.d, n2, n5); 76 | this.progressCallback(n2 += n5, this.d.length, 0, 0, 0, 0); 77 | } 78 | } 79 | catch (Exception var5_15) { 80 | WWW.errorCallback(this.b, var5_15.toString()); 81 | return; 82 | } 83 | } 84 | if (uRLConnection instanceof HttpURLConnection) { 85 | HttpURLConnection httpURLConnection = (HttpURLConnection)uRLConnection; 86 | try { 87 | n2 = httpURLConnection.getResponseCode(); 88 | } 89 | catch (IOException var6_17) { 90 | WWW.errorCallback(this.b, var6_17.toString()); 91 | return; 92 | } 93 | Map> map = httpURLConnection.getHeaderFields(); 94 | if (!(map == null || n2 != 301 && n2 != 302 || (arrby = map.get("Location")) == null || arrby.isEmpty())) { 95 | httpURLConnection.disconnect(); 96 | this.c = arrby.get(0); 97 | this.run(); 98 | return; 99 | } 100 | } 101 | Map> map = uRLConnection.getHeaderFields(); 102 | n2 = (int)this.headerCallback(map) ? 1 : 0; 103 | if (!(map != null && map.containsKey("content-length") || uRLConnection.getContentLength() == -1)) { 104 | int n6 = n2 = n2 != 0 || this.headerCallback("content-length", String.valueOf(uRLConnection.getContentLength())) ? 1 : 0; 105 | } 106 | if (!(map != null && map.containsKey("content-type") || uRLConnection.getContentType() == null)) { 107 | int n7 = n2 = n2 != 0 || this.headerCallback("content-type", uRLConnection.getContentType()) ? 1 : 0; 108 | } 109 | if (n2 != 0) { 110 | WWW.errorCallback(this.b, this.c + " aborted"); 111 | return; 112 | } 113 | int n8 = n3 = uRLConnection.getContentLength() > 0 ? uRLConnection.getContentLength() : 0; 114 | if (object2.getProtocol().equalsIgnoreCase("file") || object2.getProtocol().equalsIgnoreCase("jar")) { 115 | n4 = n3 == 0 ? 32768 : Math.min(n3, 32768); 116 | } 117 | n2 = 0; 118 | try { 119 | long l2 = System.currentTimeMillis(); 120 | arrby = new byte[n4]; 121 | object2 = null; 122 | n4 = 1; 123 | String string = ""; 124 | if (uRLConnection instanceof HttpURLConnection) { 125 | HttpURLConnection httpURLConnection = (HttpURLConnection)uRLConnection; 126 | object2 = httpURLConnection.getErrorStream(); 127 | string = "" + httpURLConnection.getResponseCode() + ": " + httpURLConnection.getResponseMessage(); 128 | } 129 | if (object2 == null) { 130 | object2 = uRLConnection.getInputStream(); 131 | n4 = 0; 132 | } 133 | int n9 = 0; 134 | while (n9 != -1) { 135 | if (this.readCallback(arrby, n9)) { 136 | WWW.errorCallback(this.b, this.c + " aborted"); 137 | return; 138 | } 139 | if (n4 == 0) { 140 | this.progressCallback(0, 0, n2 += n9, n3, System.currentTimeMillis(), l2); 141 | } 142 | n9 = object2.read(arrby); 143 | } 144 | if (n4 != 0) { 145 | WWW.errorCallback(this.b, string); 146 | } 147 | } 148 | catch (Exception var6_20) { 149 | WWW.errorCallback(this.b, var6_20.toString()); 150 | return; 151 | } 152 | this.progressCallback(0, 0, n2, n2, 0, 0); 153 | WWW.doneCallback(this.b); 154 | } 155 | 156 | private static native boolean headerCallback(int var0, String var1); 157 | 158 | protected boolean headerCallback(Map object) { 159 | if (object == null || object.size() == 0) { 160 | return false; 161 | } 162 | StringBuilder stringBuilder = new StringBuilder(); 163 | for (Map.Entry entry : object.entrySet()) { 164 | for (String string22 : (List)entry.getValue()) { 165 | stringBuilder.append((String)entry.getKey()); 166 | stringBuilder.append(": "); 167 | stringBuilder.append(string22); 168 | stringBuilder.append("\r\n"); 169 | } 170 | if (entry.getKey() != null) continue; 171 | for (String string22 : (List)entry.getValue()) { 172 | stringBuilder.append("Status: "); 173 | stringBuilder.append(string22); 174 | stringBuilder.append("\r\n"); 175 | } 176 | } 177 | return WWW.headerCallback(this.b, stringBuilder.toString()); 178 | } 179 | 180 | protected boolean headerCallback(String string, String string2) { 181 | StringBuilder stringBuilder = new StringBuilder(); 182 | stringBuilder.append(string); 183 | stringBuilder.append(": "); 184 | stringBuilder.append(string2); 185 | stringBuilder.append("\n\r"); 186 | return WWW.headerCallback(this.b, stringBuilder.toString()); 187 | } 188 | 189 | private static native boolean readCallback(int var0, byte[] var1, int var2); 190 | 191 | protected boolean readCallback(byte[] arrby, int n2) { 192 | return WWW.readCallback(this.b, arrby, n2); 193 | } 194 | 195 | private static native void progressCallback(int var0, float var1, float var2, double var3, int var5); 196 | 197 | protected void progressCallback(int n2, int n3, int n4, int n5, long l2, long l3) { 198 | float f2; 199 | double d2; 200 | float f3; 201 | if (n5 > 0) { 202 | double d3; 203 | f2 = (float)n4 / (float)n5; 204 | f3 = 1.0f; 205 | n3 = Math.max(n5 - n4, 0); 206 | d2 = (double)n3 / (d3 = 1000.0 * (double)n4 / Math.max((double)(l2 - l3), 0.1)); 207 | if (Double.isInfinite(d2) || Double.isNaN(d2)) { 208 | d2 = 0.0; 209 | } 210 | } else if (n3 > 0) { 211 | f2 = 0.0f; 212 | f3 = n2 / n3; 213 | d2 = 0.0; 214 | } else { 215 | return; 216 | } 217 | WWW.progressCallback(this.b, f3, f2, d2, n5); 218 | } 219 | 220 | private static native void errorCallback(int var0, String var1); 221 | 222 | private static native void doneCallback(int var0); 223 | } 224 | 225 | -------------------------------------------------------------------------------- /com/unity3d/player/a.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | * 4 | * Could not load the following classes: 5 | * android.graphics.ImageFormat 6 | * android.hardware.Camera 7 | * android.hardware.Camera$Parameters 8 | * android.hardware.Camera$PreviewCallback 9 | * android.hardware.Camera$Size 10 | * android.view.SurfaceHolder 11 | */ 12 | package com.unity3d.player; 13 | 14 | import android.graphics.ImageFormat; 15 | import android.hardware.Camera; 16 | import android.view.SurfaceHolder; 17 | import com.unity3d.player.b; 18 | import com.unity3d.player.f; 19 | import com.unity3d.player.m; 20 | import com.unity3d.player.q; 21 | import java.util.ArrayList; 22 | import java.util.Iterator; 23 | import java.util.List; 24 | 25 | final class a { 26 | private final Object[] g = new Object[0]; 27 | private final int h; 28 | private final int i; 29 | private final int j; 30 | private final int k; 31 | Camera a; 32 | Camera.Parameters b; 33 | Camera.Size c; 34 | int d; 35 | int[] e; 36 | b f; 37 | 38 | public a(int n2, int n3, int n4, int n5) { 39 | this.h = n2; 40 | this.i = a.a(n3, 640); 41 | this.j = a.a(n4, 480); 42 | this.k = a.a(n5, 24); 43 | } 44 | 45 | private void b(a object) { 46 | Object[] arrobject = this.g; 47 | synchronized (arrobject) { 48 | this.a = Camera.open((int)this.h); 49 | this.b = this.a.getParameters(); 50 | this.c = this.f(); 51 | this.e = this.e(); 52 | this.d = this.d(); 53 | a.a(this.b); 54 | this.b.setPreviewSize(this.c.width, this.c.height); 55 | this.b.setPreviewFpsRange(this.e[0], this.e[1]); 56 | this.a.setParameters(this.b); 57 | object = new Camera.PreviewCallback((a)object){ 58 | long a; 59 | final /* synthetic */ a b; 60 | 61 | public final void onPreviewFrame(byte[] arrby, Camera camera) { 62 | if (a.this.a != camera) { 63 | return; 64 | } 65 | this.b.onCameraFrame(a.this, arrby); 66 | } 67 | }; 68 | int n2 = this.c.width * this.c.height * this.d / 8 + 4096; 69 | this.a.addCallbackBuffer(new byte[n2]); 70 | this.a.addCallbackBuffer(new byte[n2]); 71 | this.a.setPreviewCallbackWithBuffer((Camera.PreviewCallback)object); 72 | return; 73 | } 74 | } 75 | 76 | private static void a(Camera.Parameters parameters) { 77 | if (parameters.getSupportedColorEffects() != null) { 78 | parameters.setColorEffect("none"); 79 | } 80 | if (parameters.getSupportedFocusModes().contains("continuous-video")) { 81 | parameters.setFocusMode("continuous-video"); 82 | } 83 | } 84 | 85 | public final int a() { 86 | return this.h; 87 | } 88 | 89 | public final Camera.Size b() { 90 | return this.c; 91 | } 92 | 93 | public final void a(a a2) { 94 | Object[] arrobject = this.g; 95 | synchronized (arrobject) { 96 | if (this.a == null) { 97 | this.b(a2); 98 | } 99 | if (q.a && q.i.a(this.a)) { 100 | this.a.startPreview(); 101 | return; 102 | } 103 | if (this.f == null) { 104 | this.f = new b(){ 105 | Camera a; 106 | 107 | public final void surfaceCreated(SurfaceHolder surfaceHolder) { 108 | Object[] arrobject = a.this.g; 109 | synchronized (arrobject) { 110 | if (a.this.a != this.a) { 111 | return; 112 | } 113 | try { 114 | a.this.a.setPreviewDisplay(surfaceHolder); 115 | a.this.a.startPreview(); 116 | } 117 | catch (Exception var1_2) { 118 | m.Log(6, "Unable to initialize webcam data stream: " + var1_2.getMessage()); 119 | } 120 | return; 121 | } 122 | } 123 | 124 | @Override 125 | public final void surfaceDestroyed(SurfaceHolder arrobject) { 126 | arrobject = a.this.g; 127 | synchronized (arrobject) { 128 | if (a.this.a != this.a) { 129 | return; 130 | } 131 | a.this.a.stopPreview(); 132 | return; 133 | } 134 | } 135 | }; 136 | this.f.a(); 137 | } 138 | return; 139 | } 140 | } 141 | 142 | public final void a(byte[] arrby) { 143 | Object[] arrobject = this.g; 144 | synchronized (arrobject) { 145 | if (this.a != null) { 146 | this.a.addCallbackBuffer(arrby); 147 | } 148 | return; 149 | } 150 | } 151 | 152 | public final void c() { 153 | Object[] arrobject = this.g; 154 | synchronized (arrobject) { 155 | if (this.a != null) { 156 | this.a.setPreviewCallbackWithBuffer(null); 157 | this.a.stopPreview(); 158 | this.a.release(); 159 | this.a = null; 160 | } 161 | if (this.f != null) { 162 | this.f.b(); 163 | this.f = null; 164 | } 165 | return; 166 | } 167 | } 168 | 169 | private final int d() { 170 | this.b.setPreviewFormat(17); 171 | return ImageFormat.getBitsPerPixel((int)17); 172 | } 173 | 174 | private final int[] e() { 175 | double d2 = this.k * 1000; 176 | ArrayList arrayList = this.b.getSupportedPreviewFpsRange(); 177 | if (arrayList == null) { 178 | arrayList = new ArrayList(); 179 | } 180 | int[] arrn = new int[]{this.k * 1000, this.k * 1000}; 181 | double d3 = Double.MAX_VALUE; 182 | for (int[] arrn2 : arrayList) { 183 | double d4 = Math.abs(Math.log(d2 / (double)arrn2[0])) + Math.abs(Math.log(d2 / (double)arrn2[1])); 184 | if (d4 >= d3) continue; 185 | d3 = d4; 186 | arrn = arrn2; 187 | } 188 | return arrn; 189 | } 190 | 191 | private final Camera.Size f() { 192 | double d2 = this.i; 193 | double d3 = this.j; 194 | Object object = this.b.getSupportedPreviewSizes(); 195 | Camera.Size size = null; 196 | double d4 = Double.MAX_VALUE; 197 | object = object.iterator(); 198 | while (object.hasNext()) { 199 | Camera.Size size2 = (Camera.Size)object.next(); 200 | double d5 = Math.abs(Math.log(d2 / (double)size2.width)) + Math.abs(Math.log(d3 / (double)size2.height)); 201 | if (d5 >= d4) continue; 202 | d4 = d5; 203 | size = size2; 204 | } 205 | return size; 206 | } 207 | 208 | private static final int a(int n2, int n3) { 209 | if (n2 != 0) { 210 | return n2; 211 | } 212 | return n3; 213 | } 214 | 215 | static interface a { 216 | public void onCameraFrame(a var1, byte[] var2); 217 | } 218 | 219 | } 220 | 221 | -------------------------------------------------------------------------------- /com/unity3d/player/b.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | * 4 | * Could not load the following classes: 5 | * android.app.Activity 6 | * android.content.Context 7 | * android.view.SurfaceHolder 8 | * android.view.SurfaceHolder$Callback 9 | * android.view.SurfaceView 10 | * android.view.View 11 | */ 12 | package com.unity3d.player; 13 | 14 | import android.app.Activity; 15 | import android.content.Context; 16 | import android.view.SurfaceHolder; 17 | import android.view.SurfaceView; 18 | import android.view.View; 19 | import com.unity3d.player.t; 20 | 21 | abstract class b 22 | implements SurfaceHolder.Callback { 23 | private final Activity a = (Activity)t.a.a(); 24 | private final int b = 3; 25 | private SurfaceView c; 26 | 27 | b(int n2) { 28 | } 29 | 30 | final void a() { 31 | this.a.runOnUiThread(new Runnable(){ 32 | 33 | @Override 34 | public final void run() { 35 | if (b.this.c == null) { 36 | b.this.c = new SurfaceView(t.a.a()); 37 | b.this.c.getHolder().setType(b.this.b); 38 | b.this.c.getHolder().addCallback((SurfaceHolder.Callback)b.this); 39 | t.a.a((View)b.this.c); 40 | b.this.c.setVisibility(0); 41 | } 42 | } 43 | }); 44 | } 45 | 46 | final void b() { 47 | this.a.runOnUiThread(new Runnable(){ 48 | 49 | @Override 50 | public final void run() { 51 | if (b.this.c != null) { 52 | t.a.b((View)b.this.c); 53 | } 54 | b.this.c = null; 55 | } 56 | }); 57 | } 58 | 59 | public void surfaceDestroyed(SurfaceHolder surfaceHolder) { 60 | } 61 | 62 | public void surfaceChanged(SurfaceHolder surfaceHolder, int n2, int n3, int n4) { 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /com/unity3d/player/c.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | * 4 | * Could not load the following classes: 5 | * android.view.MotionEvent 6 | * android.view.View 7 | */ 8 | package com.unity3d.player; 9 | 10 | import android.view.MotionEvent; 11 | import android.view.View; 12 | import com.unity3d.player.e; 13 | 14 | public final class c 15 | implements e { 16 | @Override 17 | public final boolean a(View view, MotionEvent motionEvent) { 18 | return view.dispatchGenericMotionEvent(motionEvent); 19 | } 20 | } 21 | 22 | -------------------------------------------------------------------------------- /com/unity3d/player/d.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | * 4 | * Could not load the following classes: 5 | * android.graphics.SurfaceTexture 6 | * android.hardware.Camera 7 | * android.os.Handler 8 | * android.view.View 9 | * android.view.View$OnSystemUiVisibilityChangeListener 10 | */ 11 | package com.unity3d.player; 12 | 13 | import android.graphics.SurfaceTexture; 14 | import android.hardware.Camera; 15 | import android.os.Handler; 16 | import android.view.View; 17 | import com.unity3d.player.f; 18 | import com.unity3d.player.q; 19 | 20 | public final class d 21 | implements f { 22 | private static final SurfaceTexture a = new SurfaceTexture(-1); 23 | private static final int b = q.f ? 5894 : 1; 24 | private volatile boolean c; 25 | 26 | @Override 27 | public final boolean a(Camera camera) { 28 | try { 29 | camera.setPreviewTexture(a); 30 | return true; 31 | } 32 | catch (Exception v0) { 33 | return false; 34 | } 35 | } 36 | 37 | @Override 38 | public final void a(View view, boolean bl) { 39 | this.c = bl; 40 | view.setSystemUiVisibility(this.c ? view.getSystemUiVisibility() | b : view.getSystemUiVisibility() & ~ b); 41 | } 42 | 43 | @Override 44 | public final void a(final View view) { 45 | if (q.f) { 46 | return; 47 | } 48 | view.setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener(){ 49 | 50 | public final void onSystemUiVisibilityChange(int n2) { 51 | d.this.a(view, 1000); 52 | } 53 | }); 54 | } 55 | 56 | @Override 57 | public final void b(View view) { 58 | if (!q.f && this.c) { 59 | this.a(view, false); 60 | this.c = true; 61 | } 62 | this.a(view, 1000); 63 | } 64 | 65 | private void a(final View view, int n2) { 66 | Handler handler = view.getHandler(); 67 | if (handler == null) { 68 | this.a(view, this.c); 69 | return; 70 | } 71 | handler.postDelayed(new Runnable(){ 72 | 73 | @Override 74 | public final void run() { 75 | d.this.a(view, d.this.c); 76 | } 77 | }, 1000); 78 | } 79 | 80 | } 81 | 82 | -------------------------------------------------------------------------------- /com/unity3d/player/e.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | * 4 | * Could not load the following classes: 5 | * android.view.MotionEvent 6 | * android.view.View 7 | */ 8 | package com.unity3d.player; 9 | 10 | import android.view.MotionEvent; 11 | import android.view.View; 12 | 13 | public interface e { 14 | public boolean a(View var1, MotionEvent var2); 15 | } 16 | 17 | -------------------------------------------------------------------------------- /com/unity3d/player/f.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | * 4 | * Could not load the following classes: 5 | * android.hardware.Camera 6 | * android.view.View 7 | */ 8 | package com.unity3d.player; 9 | 10 | import android.hardware.Camera; 11 | import android.view.View; 12 | 13 | public interface f { 14 | public boolean a(Camera var1); 15 | 16 | public void a(View var1, boolean var2); 17 | 18 | public void a(View var1); 19 | 20 | public void b(View var1); 21 | } 22 | 23 | -------------------------------------------------------------------------------- /com/unity3d/player/g.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | * 4 | * Could not load the following classes: 5 | * android.content.Context 6 | */ 7 | package com.unity3d.player; 8 | 9 | import android.content.Context; 10 | import com.unity3d.player.UnityPlayer; 11 | 12 | public interface g { 13 | public void a(UnityPlayer var1, Context var2); 14 | 15 | public void a(Context var1); 16 | 17 | public boolean a(UnityPlayer var1, Context var2, int var3); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /com/unity3d/player/h.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | */ 4 | package com.unity3d.player; 5 | 6 | import com.unity3d.player.UnityPlayer; 7 | 8 | public interface h { 9 | public void a(UnityPlayer var1); 10 | 11 | public void a(); 12 | } 13 | 14 | -------------------------------------------------------------------------------- /com/unity3d/player/i.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | * 4 | * Could not load the following classes: 5 | * android.app.Activity 6 | */ 7 | package com.unity3d.player; 8 | 9 | import android.app.Activity; 10 | 11 | public interface i { 12 | public void a(Activity var1, Runnable var2); 13 | } 14 | 15 | -------------------------------------------------------------------------------- /com/unity3d/player/j.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | */ 4 | package com.unity3d.player; 5 | 6 | public interface j { 7 | public void a(long var1, long var3, int var5, int var6, int[] var7, float[] var8, int var9, float var10, float var11, int var12, int var13, int var14, int var15, int var16, long[] var17, float[] var18); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /com/unity3d/player/k.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | * 4 | * Could not load the following classes: 5 | * android.app.Presentation 6 | * android.content.Context 7 | * android.hardware.display.DisplayManager 8 | * android.hardware.display.DisplayManager$DisplayListener 9 | * android.os.Bundle 10 | * android.os.Handler 11 | * android.view.Display 12 | * android.view.Surface 13 | * android.view.SurfaceHolder 14 | * android.view.SurfaceHolder$Callback 15 | * android.view.SurfaceView 16 | * android.view.View 17 | */ 18 | package com.unity3d.player; 19 | 20 | import android.app.Presentation; 21 | import android.content.Context; 22 | import android.hardware.display.DisplayManager; 23 | import android.os.Bundle; 24 | import android.os.Handler; 25 | import android.view.Display; 26 | import android.view.Surface; 27 | import android.view.SurfaceHolder; 28 | import android.view.SurfaceView; 29 | import android.view.View; 30 | import com.unity3d.player.UnityPlayer; 31 | import com.unity3d.player.g; 32 | 33 | public final class k 34 | implements g { 35 | private Object a = new Object[0]; 36 | private Presentation b; 37 | private DisplayManager.DisplayListener c; 38 | 39 | @Override 40 | public final void a(final UnityPlayer unityPlayer, Context context) { 41 | if ((context = (DisplayManager)context.getSystemService("display")) == null) { 42 | return; 43 | } 44 | context.registerDisplayListener(new DisplayManager.DisplayListener(){ 45 | 46 | public final void onDisplayAdded(int n2) { 47 | unityPlayer.displayChanged(-1, null); 48 | } 49 | 50 | public final void onDisplayRemoved(int n2) { 51 | unityPlayer.displayChanged(-1, null); 52 | } 53 | 54 | public final void onDisplayChanged(int n2) { 55 | unityPlayer.displayChanged(-1, null); 56 | } 57 | }, null); 58 | } 59 | 60 | @Override 61 | public final void a(Context context) { 62 | if (this.c == null) { 63 | return; 64 | } 65 | if ((context = (DisplayManager)context.getSystemService("display")) == null) { 66 | return; 67 | } 68 | context.unregisterDisplayListener(this.c); 69 | } 70 | 71 | @Override 72 | public final boolean a(final UnityPlayer unityPlayer, final Context context, int n2) { 73 | Object object = this.a; 74 | synchronized (object) { 75 | DisplayManager displayManager; 76 | if (this.b != null && this.b.isShowing() && (displayManager = this.b.getDisplay()) != null && displayManager.getDisplayId() == n2) { 77 | return true; 78 | } 79 | displayManager = (DisplayManager)context.getSystemService("display"); 80 | if (displayManager == null) { 81 | return false; 82 | } 83 | final Display display = displayManager.getDisplay(n2); 84 | if (display == null) { 85 | return false; 86 | } 87 | unityPlayer.b(new Runnable(){ 88 | 89 | @Override 90 | public final void run() { 91 | Object object = k.this.a; 92 | synchronized (object) { 93 | if (k.this.b != null) { 94 | k.this.b.dismiss(); 95 | } 96 | k.this.b = new Presentation(context, display){ 97 | 98 | protected final void onCreate(Bundle bundle) { 99 | bundle = new SurfaceView(context); 100 | bundle.getHolder().addCallback(new SurfaceHolder.Callback(){ 101 | 102 | public final void surfaceCreated(SurfaceHolder surfaceHolder) { 103 | unityPlayer.displayChanged(1, surfaceHolder.getSurface()); 104 | } 105 | 106 | public final void surfaceChanged(SurfaceHolder surfaceHolder, int n2, int n3, int n4) { 107 | unityPlayer.displayChanged(1, surfaceHolder.getSurface()); 108 | } 109 | 110 | public final void surfaceDestroyed(SurfaceHolder surfaceHolder) { 111 | unityPlayer.displayChanged(1, null); 112 | } 113 | }); 114 | this.setContentView((View)bundle); 115 | } 116 | 117 | public final void onDisplayRemoved() { 118 | this.dismiss(); 119 | Object object = k.this.a; 120 | synchronized (object) { 121 | k.this.b = null; 122 | return; 123 | } 124 | } 125 | 126 | }; 127 | k.this.b.show(); 128 | return; 129 | } 130 | } 131 | 132 | }); 133 | return true; 134 | } 135 | } 136 | 137 | } 138 | 139 | -------------------------------------------------------------------------------- /com/unity3d/player/l.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | * 4 | * Could not load the following classes: 5 | * android.view.Choreographer 6 | * android.view.Choreographer$FrameCallback 7 | */ 8 | package com.unity3d.player; 9 | 10 | import android.view.Choreographer; 11 | import com.unity3d.player.UnityPlayer; 12 | import com.unity3d.player.h; 13 | import com.unity3d.player.m; 14 | import com.unity3d.player.v; 15 | import java.util.concurrent.locks.Lock; 16 | import java.util.concurrent.locks.ReentrantLock; 17 | 18 | public final class l 19 | implements h { 20 | private Choreographer a = null; 21 | private long b = 0; 22 | private Choreographer.FrameCallback c; 23 | private Lock d = new ReentrantLock(); 24 | 25 | @Override 26 | public final void a(final UnityPlayer unityPlayer) { 27 | this.d.lock(); 28 | if (this.a == null) { 29 | this.a = Choreographer.getInstance(); 30 | if (this.a != null) { 31 | m.Log(4, "Choreographer available: Enabling VSYNC timing"); 32 | this.c = new Choreographer.FrameCallback(){ 33 | 34 | public final void doFrame(long l2) { 35 | UnityPlayer.lockNativeAccess(); 36 | if (v.c()) { 37 | unityPlayer.nativeAddVSyncTime(l2); 38 | } 39 | UnityPlayer.unlockNativeAccess(); 40 | l.this.d.lock(); 41 | if (l.this.a != null) { 42 | l.this.a.postFrameCallback(l.this.c); 43 | } 44 | l.this.d.unlock(); 45 | } 46 | }; 47 | this.a.postFrameCallback(this.c); 48 | } 49 | } 50 | this.d.unlock(); 51 | } 52 | 53 | @Override 54 | public final void a() { 55 | this.d.lock(); 56 | if (this.a != null) { 57 | this.a.removeFrameCallback(this.c); 58 | } 59 | this.a = null; 60 | this.d.unlock(); 61 | } 62 | 63 | } 64 | 65 | -------------------------------------------------------------------------------- /com/unity3d/player/m.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | * 4 | * Could not load the following classes: 5 | * android.util.Log 6 | */ 7 | package com.unity3d.player; 8 | 9 | import android.util.Log; 10 | 11 | final class m { 12 | protected static boolean a = false; 13 | 14 | protected static void Log(int n2, String string) { 15 | if (a) { 16 | return; 17 | } 18 | if (n2 == 6) { 19 | Log.e((String)"Unity", (String)string); 20 | } 21 | if (n2 == 5) { 22 | Log.w((String)"Unity", (String)string); 23 | } 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /com/unity3d/player/n.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | * 4 | * Could not load the following classes: 5 | * android.app.Activity 6 | * android.app.Fragment 7 | * android.app.FragmentManager 8 | * android.app.FragmentTransaction 9 | * android.content.pm.PackageInfo 10 | * android.content.pm.PackageManager 11 | * android.content.pm.PackageManager$NameNotFoundException 12 | * android.content.pm.PermissionInfo 13 | */ 14 | package com.unity3d.player; 15 | 16 | import android.app.Activity; 17 | import android.app.Fragment; 18 | import android.app.FragmentManager; 19 | import android.app.FragmentTransaction; 20 | import android.content.pm.PackageInfo; 21 | import android.content.pm.PackageManager; 22 | import android.content.pm.PermissionInfo; 23 | import com.unity3d.player.i; 24 | import com.unity3d.player.m; 25 | import java.util.LinkedList; 26 | import java.util.List; 27 | 28 | public final class n 29 | implements i { 30 | @Override 31 | public final void a(Activity activity, final Runnable runnable) { 32 | if (activity == null) { 33 | return; 34 | } 35 | try { 36 | PackageManager packageManager = activity.getPackageManager(); 37 | final FragmentManager fragmentManager = packageManager.getPackageInfo(activity.getPackageName(), 4096); 38 | if (fragmentManager.requestedPermissions == null) { 39 | fragmentManager.requestedPermissions = new String[0]; 40 | } 41 | final LinkedList linkedList = new LinkedList(); 42 | for (String string : fragmentManager.requestedPermissions) { 43 | try { 44 | if (packageManager.getPermissionInfo((String)string, (int)128).protectionLevel != 1 || activity.checkCallingOrSelfPermission(string) == 0) continue; 45 | linkedList.add(string); 46 | continue; 47 | } 48 | catch (PackageManager.NameNotFoundException v0) { 49 | m.Log(5, "Failed to get permission info for " + string + ", manifest likely missing custom permission declaration"); 50 | m.Log(5, "Permission " + string + " ignored"); 51 | } 52 | } 53 | if (linkedList.isEmpty()) { 54 | runnable.run(); 55 | return; 56 | } 57 | fragmentManager = activity.getFragmentManager(); 58 | Fragment fragment = new Fragment(){ 59 | 60 | public final void onStart() { 61 | super.onStart(); 62 | this.requestPermissions(linkedList.toArray(new String[0]), 15881); 63 | } 64 | 65 | public final void onRequestPermissionsResult(int n2, String[] arrstring, int[] arrn) { 66 | if (n2 != 15881) { 67 | return; 68 | } 69 | for (n2 = 0; n2 < arrstring.length && n2 < arrn.length; ++n2) { 70 | m.Log(4, arrstring[n2] + (arrn[n2] == 0 ? " granted" : " denied")); 71 | } 72 | FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); 73 | fragmentTransaction.remove((Fragment)this); 74 | fragmentTransaction.commit(); 75 | runnable.run(); 76 | } 77 | }; 78 | FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); 79 | fragmentTransaction.add(0, fragment); 80 | fragmentTransaction.commit(); 81 | return; 82 | } 83 | catch (Exception var3_4) { 84 | m.Log(6, "Unable to query for permission: " + var3_4.getMessage()); 85 | return; 86 | } 87 | } 88 | 89 | } 90 | 91 | -------------------------------------------------------------------------------- /com/unity3d/player/o.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | * 4 | * Could not load the following classes: 5 | * android.app.Activity 6 | * android.content.ComponentName 7 | * android.content.pm.ActivityInfo 8 | * android.content.pm.PackageManager 9 | * android.content.pm.PackageManager$NameNotFoundException 10 | * android.os.Bundle 11 | */ 12 | package com.unity3d.player; 13 | 14 | import android.app.Activity; 15 | import android.content.ComponentName; 16 | import android.content.pm.ActivityInfo; 17 | import android.content.pm.PackageManager; 18 | import android.os.Bundle; 19 | import com.unity3d.player.m; 20 | 21 | public final class o { 22 | private final Bundle a; 23 | 24 | public o(Activity activity) { 25 | Bundle bundle = Bundle.EMPTY; 26 | PackageManager packageManager = activity.getPackageManager(); 27 | activity = activity.getComponentName(); 28 | try { 29 | packageManager = packageManager.getActivityInfo((ComponentName)activity, 128); 30 | if (packageManager != null && packageManager.metaData != null) { 31 | bundle = packageManager.metaData; 32 | } 33 | } 34 | catch (PackageManager.NameNotFoundException v0) { 35 | m.Log(6, "Unable to retreive meta data for activity '" + (Object)activity + "'"); 36 | } 37 | this.a = new Bundle(bundle); 38 | } 39 | 40 | public final boolean a() { 41 | return this.a.getBoolean(o.a("ForwardNativeEventsToDalvik")); 42 | } 43 | 44 | private static String a(String string) { 45 | return String.format("%s.%s", "unityplayer", string); 46 | } 47 | } 48 | 49 | -------------------------------------------------------------------------------- /com/unity3d/player/p.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | * 4 | * Could not load the following classes: 5 | * android.app.Activity 6 | * android.content.ContextWrapper 7 | * android.view.MotionEvent 8 | * android.view.MotionEvent$PointerCoords 9 | * android.view.View 10 | * android.view.Window 11 | */ 12 | package com.unity3d.player; 13 | 14 | import android.app.Activity; 15 | import android.content.ContextWrapper; 16 | import android.view.MotionEvent; 17 | import android.view.View; 18 | import android.view.Window; 19 | import com.unity3d.player.e; 20 | import com.unity3d.player.j; 21 | import com.unity3d.player.q; 22 | import java.util.Queue; 23 | import java.util.concurrent.ConcurrentLinkedQueue; 24 | 25 | public final class p 26 | implements j { 27 | private final Queue a = new ConcurrentLinkedQueue(); 28 | private final Activity b; 29 | private Runnable c; 30 | 31 | public p(ContextWrapper contextWrapper) { 32 | this.c = new Runnable(){ 33 | 34 | private static void a(View view, MotionEvent motionEvent) { 35 | if (q.b) { 36 | q.j.a(view, motionEvent); 37 | } 38 | } 39 | 40 | @Override 41 | public final void run() { 42 | MotionEvent motionEvent; 43 | block3 : while ((motionEvent = (MotionEvent)p.this.a.poll()) != null) { 44 | View view = p.this.b.getWindow().getDecorView(); 45 | int n2 = motionEvent.getSource(); 46 | if ((n2 & 2) != 0) { 47 | switch (motionEvent.getAction() & 255) { 48 | case 0: 49 | case 1: 50 | case 2: 51 | case 3: 52 | case 4: 53 | case 5: 54 | case 6: { 55 | view.dispatchTouchEvent(motionEvent); 56 | continue block3; 57 | } 58 | } 59 | .a(view, motionEvent); 60 | continue; 61 | } 62 | if ((n2 & 4) != 0) { 63 | view.dispatchTrackballEvent(motionEvent); 64 | continue; 65 | } 66 | .a(view, motionEvent); 67 | } 68 | } 69 | }; 70 | this.b = (Activity)contextWrapper; 71 | } 72 | 73 | private static MotionEvent.PointerCoords[] a(int n2, float[] arrf) { 74 | MotionEvent.PointerCoords[] arrpointerCoords = new MotionEvent.PointerCoords[n2]; 75 | p.a(arrpointerCoords, arrf, 0); 76 | return arrpointerCoords; 77 | } 78 | 79 | private static int a(MotionEvent.PointerCoords[] arrpointerCoords, float[] arrf, int n2) { 80 | for (int i2 = 0; i2 < arrpointerCoords.length; ++i2) { 81 | MotionEvent.PointerCoords pointerCoords = arrpointerCoords[i2] = new MotionEvent.PointerCoords(); 82 | arrpointerCoords[i2].orientation = arrf[n2++]; 83 | pointerCoords.pressure = arrf[n2++]; 84 | pointerCoords.size = arrf[n2++]; 85 | pointerCoords.toolMajor = arrf[n2++]; 86 | pointerCoords.toolMinor = arrf[n2++]; 87 | pointerCoords.touchMajor = arrf[n2++]; 88 | pointerCoords.touchMinor = arrf[n2++]; 89 | pointerCoords.x = arrf[n2++]; 90 | pointerCoords.y = arrf[n2++]; 91 | } 92 | return n2; 93 | } 94 | 95 | @Override 96 | public final void a(long l2, long l3, int n2, int n3, int[] arrn, float[] arrf, int n4, float f2, float f3, int n5, int n6, int n7, int n8, int n9, long[] arrl, float[] arrf2) { 97 | if (this.b != null) { 98 | MotionEvent motionEvent = MotionEvent.obtain((long)l2, (long)l3, (int)n2, (int)n3, (int[])arrn, (MotionEvent.PointerCoords[])p.a(n3, arrf), (int)n4, (float)f2, (float)f3, (int)n5, (int)n6, (int)n7, (int)n8); 99 | int n10 = 0; 100 | for (int i2 = 0; i2 < n9; ++i2) { 101 | MotionEvent.PointerCoords[] arrpointerCoords = new MotionEvent.PointerCoords[n3]; 102 | n10 = p.a(arrpointerCoords, arrf2, n10); 103 | motionEvent.addBatch(arrl[i2], arrpointerCoords, n4); 104 | } 105 | this.a.add(motionEvent); 106 | this.b.runOnUiThread(this.c); 107 | } 108 | } 109 | 110 | } 111 | 112 | -------------------------------------------------------------------------------- /com/unity3d/player/q.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | * 4 | * Could not load the following classes: 5 | * android.os.Build 6 | * android.os.Build$VERSION 7 | */ 8 | package com.unity3d.player; 9 | 10 | import android.os.Build; 11 | import com.unity3d.player.c; 12 | import com.unity3d.player.d; 13 | import com.unity3d.player.e; 14 | import com.unity3d.player.f; 15 | import com.unity3d.player.g; 16 | import com.unity3d.player.h; 17 | import com.unity3d.player.i; 18 | import com.unity3d.player.k; 19 | import com.unity3d.player.l; 20 | import com.unity3d.player.n; 21 | 22 | public final class q { 23 | static final boolean a = Build.VERSION.SDK_INT >= 11; 24 | static final boolean b = Build.VERSION.SDK_INT >= 12; 25 | static final boolean c = Build.VERSION.SDK_INT >= 14; 26 | static final boolean d = Build.VERSION.SDK_INT >= 16; 27 | static final boolean e = Build.VERSION.SDK_INT >= 17; 28 | static final boolean f = Build.VERSION.SDK_INT >= 19; 29 | static final boolean g = Build.VERSION.SDK_INT >= 21; 30 | static final boolean h = Build.VERSION.SDK_INT >= 23; 31 | static final f i = a ? new d() : null; 32 | static final e j = b ? new c() : null; 33 | static final h k = d ? new l() : null; 34 | static final g l = e ? new k() : null; 35 | static final i m = h ? new n() : null; 36 | } 37 | 38 | -------------------------------------------------------------------------------- /com/unity3d/player/r.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | * 4 | * Could not load the following classes: 5 | * android.content.Context 6 | * android.hardware.GeomagneticField 7 | * android.location.Criteria 8 | * android.location.Location 9 | * android.location.LocationListener 10 | * android.location.LocationManager 11 | * android.location.LocationProvider 12 | * android.os.Bundle 13 | * android.os.Looper 14 | */ 15 | package com.unity3d.player; 16 | 17 | import android.content.Context; 18 | import android.hardware.GeomagneticField; 19 | import android.location.Criteria; 20 | import android.location.Location; 21 | import android.location.LocationListener; 22 | import android.location.LocationManager; 23 | import android.location.LocationProvider; 24 | import android.os.Bundle; 25 | import android.os.Looper; 26 | import com.unity3d.player.UnityPlayer; 27 | import com.unity3d.player.m; 28 | import java.util.List; 29 | 30 | final class r 31 | implements LocationListener { 32 | private final Context a; 33 | private final UnityPlayer b; 34 | private Location c; 35 | private float d = 0.0f; 36 | private boolean e = false; 37 | private int f = 0; 38 | private boolean g = false; 39 | private int h = 0; 40 | 41 | protected r(Context context, UnityPlayer unityPlayer) { 42 | this.a = context; 43 | this.b = unityPlayer; 44 | } 45 | 46 | public final boolean a() { 47 | if (!((LocationManager)this.a.getSystemService("location")).getProviders(new Criteria(), true).isEmpty()) { 48 | return true; 49 | } 50 | return false; 51 | } 52 | 53 | public final void a(float f2) { 54 | this.d = f2; 55 | } 56 | 57 | public final void b(float f2) { 58 | if (f2 < 100.0f) { 59 | this.f = 1; 60 | return; 61 | } 62 | if (f2 < 500.0f) { 63 | this.f = 1; 64 | return; 65 | } 66 | this.f = 2; 67 | } 68 | 69 | public final void b() { 70 | this.g = false; 71 | if (this.e) { 72 | m.Log(5, "Location_StartUpdatingLocation already started!"); 73 | return; 74 | } 75 | if (!this.a()) { 76 | this.a(3); 77 | return; 78 | } 79 | LocationManager locationManager = (LocationManager)this.a.getSystemService("location"); 80 | this.a(1); 81 | List list = locationManager.getProviders(true); 82 | if (list.isEmpty()) { 83 | this.a(3); 84 | return; 85 | } 86 | String string = null; 87 | if (this.f == 2) { 88 | for (String string2 : list) { 89 | if ((string2 = locationManager.getProvider(string2)).getAccuracy() != 2) continue; 90 | string = string2; 91 | break; 92 | } 93 | } 94 | for (String string2 : list) { 95 | if (string != null && locationManager.getProvider(string2).getAccuracy() == 1) continue; 96 | this.a(locationManager.getLastKnownLocation(string2)); 97 | locationManager.requestLocationUpdates(string2, 0, this.d, (LocationListener)this, this.a.getMainLooper()); 98 | this.e = true; 99 | } 100 | } 101 | 102 | public final void c() { 103 | ((LocationManager)this.a.getSystemService("location")).removeUpdates((LocationListener)this); 104 | this.e = false; 105 | this.c = null; 106 | this.a(0); 107 | } 108 | 109 | public final void d() { 110 | if (this.h == 1 || this.h == 2) { 111 | this.g = true; 112 | this.c(); 113 | } 114 | } 115 | 116 | public final void e() { 117 | if (this.g) { 118 | this.b(); 119 | } 120 | } 121 | 122 | public final void onLocationChanged(Location location) { 123 | this.a(2); 124 | this.a(location); 125 | } 126 | 127 | public final void onStatusChanged(String string, int n2, Bundle bundle) { 128 | } 129 | 130 | public final void onProviderEnabled(String string) { 131 | } 132 | 133 | public final void onProviderDisabled(String string) { 134 | this.c = null; 135 | } 136 | 137 | private void a(Location location) { 138 | if (location == null) { 139 | return; 140 | } 141 | if (r.a(location, this.c)) { 142 | this.c = location; 143 | GeomagneticField geomagneticField = new GeomagneticField((float)this.c.getLatitude(), (float)this.c.getLongitude(), (float)this.c.getAltitude(), this.c.getTime()); 144 | this.b.nativeSetLocation((float)location.getLatitude(), (float)location.getLongitude(), (float)location.getAltitude(), location.getAccuracy(), (double)location.getTime() / 1000.0, geomagneticField.getDeclination()); 145 | } 146 | } 147 | 148 | private static boolean a(Location location, Location location2) { 149 | boolean bl; 150 | if (location2 == null) { 151 | return true; 152 | } 153 | long l2 = location.getTime() - location2.getTime(); 154 | boolean bl2 = l2 > 120000; 155 | boolean bl3 = l2 < -120000; 156 | boolean bl4 = bl = l2 > 0; 157 | if (bl2) { 158 | return true; 159 | } 160 | if (bl3) { 161 | return false; 162 | } 163 | int n2 = (int)(location.getAccuracy() - location2.getAccuracy()); 164 | bl2 = n2 > 0; 165 | bl3 = n2 < 0; 166 | n2 = n2 > 200 | location.getAccuracy() == 0.0f; 167 | boolean bl5 = r.a(location.getProvider(), location2.getProvider()); 168 | if (bl3) { 169 | return true; 170 | } 171 | if (bl && !bl2) { 172 | return true; 173 | } 174 | if (bl && n2 == 0 && bl5) { 175 | return true; 176 | } 177 | return false; 178 | } 179 | 180 | private static boolean a(String string, String string2) { 181 | if (string == null) { 182 | if (string2 == null) { 183 | return true; 184 | } 185 | return false; 186 | } 187 | return string.equals(string2); 188 | } 189 | 190 | private void a(int n2) { 191 | this.h = n2; 192 | this.b.nativeSetLocationStatus(n2); 193 | } 194 | } 195 | 196 | -------------------------------------------------------------------------------- /com/unity3d/player/s.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | * 4 | * Could not load the following classes: 5 | * android.app.Dialog 6 | * android.content.Context 7 | * android.content.res.Resources 8 | * android.graphics.drawable.ColorDrawable 9 | * android.graphics.drawable.Drawable 10 | * android.text.Editable 11 | * android.text.Selection 12 | * android.text.Spannable 13 | * android.text.TextWatcher 14 | * android.view.KeyEvent 15 | * android.view.View 16 | * android.view.View$OnClickListener 17 | * android.view.View$OnFocusChangeListener 18 | * android.view.ViewGroup 19 | * android.view.ViewGroup$LayoutParams 20 | * android.view.Window 21 | * android.view.inputmethod.InputMethodManager 22 | * android.widget.Button 23 | * android.widget.EditText 24 | * android.widget.RelativeLayout 25 | * android.widget.RelativeLayout$LayoutParams 26 | * android.widget.TextView 27 | * android.widget.TextView$OnEditorActionListener 28 | */ 29 | package com.unity3d.player; 30 | 31 | import android.app.Dialog; 32 | import android.content.Context; 33 | import android.content.res.Resources; 34 | import android.graphics.drawable.ColorDrawable; 35 | import android.graphics.drawable.Drawable; 36 | import android.text.Editable; 37 | import android.text.Selection; 38 | import android.text.Spannable; 39 | import android.text.TextWatcher; 40 | import android.view.KeyEvent; 41 | import android.view.View; 42 | import android.view.ViewGroup; 43 | import android.view.Window; 44 | import android.view.inputmethod.InputMethodManager; 45 | import android.widget.Button; 46 | import android.widget.EditText; 47 | import android.widget.RelativeLayout; 48 | import android.widget.TextView; 49 | import com.unity3d.player.UnityPlayer; 50 | 51 | public final class s 52 | extends Dialog 53 | implements TextWatcher, 54 | View.OnClickListener { 55 | private Context a = null; 56 | private UnityPlayer b = null; 57 | private static int c = -570425344; 58 | private static int d = 1627389952; 59 | private static int e = -1; 60 | 61 | public s(Context context, UnityPlayer unityPlayer, String string, int n2, boolean bl, boolean bl2, boolean bl3, String string2) { 62 | super(context); 63 | this.a = context; 64 | this.b = unityPlayer; 65 | this.getWindow().setGravity(80); 66 | this.getWindow().requestFeature(1); 67 | this.getWindow().setBackgroundDrawable((Drawable)new ColorDrawable(0)); 68 | this.setContentView(this.createSoftInputView()); 69 | this.getWindow().setLayout(-1, -2); 70 | this.getWindow().clearFlags(2); 71 | context = (EditText)this.findViewById(1057292289); 72 | unityPlayer = (Button)this.findViewById(1057292290); 73 | this.a((EditText)context, string, n2, bl, bl2, bl3, string2); 74 | unityPlayer.setOnClickListener((View.OnClickListener)this); 75 | context.setOnFocusChangeListener(new View.OnFocusChangeListener(){ 76 | 77 | public final void onFocusChange(View view, boolean bl) { 78 | if (bl) { 79 | s.this.getWindow().setSoftInputMode(5); 80 | } 81 | } 82 | }); 83 | } 84 | 85 | private void a(EditText editText, String string, int n2, boolean bl, boolean bl2, boolean bl3, String string2) { 86 | editText.setImeOptions(6); 87 | editText.setText((CharSequence)string); 88 | editText.setHint((CharSequence)string2); 89 | editText.setHintTextColor(d); 90 | editText.setInputType(s.a(n2, bl, bl2, bl3)); 91 | editText.addTextChangedListener((TextWatcher)this); 92 | editText.setClickable(true); 93 | if (!bl2) { 94 | editText.selectAll(); 95 | } 96 | } 97 | 98 | public final void afterTextChanged(Editable editable) { 99 | this.b.reportSoftInputStr(editable.toString(), 0, false); 100 | } 101 | 102 | public final void beforeTextChanged(CharSequence charSequence, int n2, int n3, int n4) { 103 | } 104 | 105 | public final void onTextChanged(CharSequence charSequence, int n2, int n3, int n4) { 106 | } 107 | 108 | private static int a(int n2, boolean bl, boolean bl2, boolean bl3) { 109 | bl = (bl ? 32768 : 0) | (bl2 ? 131072 : 0) | (bl3 ? 128 : 0); 110 | if (n2 < 0 || n2 > 7) { 111 | return (int)bl ? 1 : 0; 112 | } 113 | int[] arrn = new int[]{1, 16385, 12290, 17, 2, 3, 97, 33}; 114 | return bl | arrn[n2]; 115 | } 116 | 117 | private void a(String string, boolean bl) { 118 | Selection.removeSelection((Spannable)((EditText)this.findViewById(1057292289)).getEditableText()); 119 | this.b.reportSoftInputStr(string, 1, bl); 120 | } 121 | 122 | public final void onClick(View view) { 123 | this.a(this.a(), false); 124 | } 125 | 126 | public final void onBackPressed() { 127 | this.a(this.a(), true); 128 | } 129 | 130 | protected final View createSoftInputView() { 131 | RelativeLayout relativeLayout = new RelativeLayout(this.a); 132 | relativeLayout.setLayoutParams(new ViewGroup.LayoutParams(-1, -1)); 133 | relativeLayout.setBackgroundColor(e); 134 | EditText editText = new EditText(this.a){ 135 | 136 | public final boolean onKeyPreIme(int n2, KeyEvent keyEvent) { 137 | if (n2 == 4) { 138 | s.this.a(s.this.a(), true); 139 | return true; 140 | } 141 | if (n2 == 84) { 142 | return true; 143 | } 144 | return super.onKeyPreIme(n2, keyEvent); 145 | } 146 | 147 | public final void onWindowFocusChanged(boolean bl) { 148 | super.onWindowFocusChanged(bl); 149 | if (bl) { 150 | ((InputMethodManager)s.this.a.getSystemService("input_method")).showSoftInput((View)this, 0); 151 | } 152 | } 153 | }; 154 | RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, -2); 155 | layoutParams.addRule(15); 156 | layoutParams.addRule(0, 1057292290); 157 | editText.setLayoutParams((ViewGroup.LayoutParams)layoutParams); 158 | editText.setTextColor(c); 159 | editText.setId(1057292289); 160 | relativeLayout.addView((View)editText); 161 | editText = new Button(this.a); 162 | editText.setText(this.a.getResources().getIdentifier("ok", "string", "android")); 163 | layoutParams = new RelativeLayout.LayoutParams(-2, -2); 164 | layoutParams.addRule(15); 165 | layoutParams.addRule(11); 166 | editText.setLayoutParams((ViewGroup.LayoutParams)layoutParams); 167 | editText.setId(1057292290); 168 | editText.setBackgroundColor(0); 169 | editText.setTextColor(c); 170 | relativeLayout.addView((View)editText); 171 | editText = relativeLayout; 172 | ((EditText)editText.findViewById(1057292289)).setOnEditorActionListener(new TextView.OnEditorActionListener(){ 173 | 174 | public final boolean onEditorAction(TextView textView, int n2, KeyEvent keyEvent) { 175 | if (n2 == 6) { 176 | s.this.a(s.this.a(), false); 177 | } 178 | return false; 179 | } 180 | }); 181 | editText.setPadding(16, 16, 16, 16); 182 | return editText; 183 | } 184 | 185 | private String a() { 186 | EditText editText = (EditText)this.findViewById(1057292289); 187 | if (editText == null) { 188 | return null; 189 | } 190 | return editText.getText().toString().trim(); 191 | } 192 | 193 | public final void a(String string) { 194 | EditText editText = (EditText)this.findViewById(1057292289); 195 | if (editText != null) { 196 | editText.setText((CharSequence)string); 197 | editText.setSelection(string.length()); 198 | } 199 | } 200 | 201 | } 202 | 203 | -------------------------------------------------------------------------------- /com/unity3d/player/t.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | * 4 | * Could not load the following classes: 5 | * android.content.Context 6 | * android.view.View 7 | * android.view.ViewGroup 8 | */ 9 | package com.unity3d.player; 10 | 11 | import android.content.Context; 12 | import android.view.View; 13 | import android.view.ViewGroup; 14 | import java.util.HashSet; 15 | import java.util.Set; 16 | 17 | final class t { 18 | public static t a; 19 | private final ViewGroup b; 20 | private Set c = new HashSet(); 21 | private View d; 22 | private View e; 23 | 24 | t(ViewGroup viewGroup) { 25 | this.b = viewGroup; 26 | a = this; 27 | } 28 | 29 | public final Context a() { 30 | return this.b.getContext(); 31 | } 32 | 33 | public final void a(View view) { 34 | this.c.add(view); 35 | if (this.d != null) { 36 | this.e(view); 37 | } 38 | } 39 | 40 | public final void b(View view) { 41 | this.c.remove((Object)view); 42 | if (this.d != null) { 43 | this.f(view); 44 | } 45 | } 46 | 47 | public final void c(View object) { 48 | if (this.d != object) { 49 | this.d = object; 50 | this.b.addView((View)object); 51 | for (View view : this.c) { 52 | this.e(view); 53 | } 54 | if (this.e != null) { 55 | this.e.setVisibility(4); 56 | } 57 | } 58 | } 59 | 60 | public final void d(View view) { 61 | if (this.d == view) { 62 | for (View view2 : this.c) { 63 | this.f(view2); 64 | } 65 | this.b.removeView(view); 66 | this.d = null; 67 | if (this.e != null) { 68 | this.e.setVisibility(0); 69 | } 70 | } 71 | } 72 | 73 | private void e(View view) { 74 | this.b.addView(view, this.b.getChildCount()); 75 | } 76 | 77 | private void f(View view) { 78 | this.b.removeView(view); 79 | this.b.requestLayout(); 80 | } 81 | } 82 | 83 | -------------------------------------------------------------------------------- /com/unity3d/player/u.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | * 4 | * Could not load the following classes: 5 | * android.os.Build 6 | */ 7 | package com.unity3d.player; 8 | 9 | import android.os.Build; 10 | 11 | final class u 12 | implements Thread.UncaughtExceptionHandler { 13 | private volatile Thread.UncaughtExceptionHandler a; 14 | 15 | u() { 16 | } 17 | 18 | final synchronized boolean a() { 19 | Thread.UncaughtExceptionHandler uncaughtExceptionHandler = Thread.getDefaultUncaughtExceptionHandler(); 20 | if (uncaughtExceptionHandler == this) { 21 | return false; 22 | } 23 | this.a = uncaughtExceptionHandler; 24 | Thread.setDefaultUncaughtExceptionHandler(this); 25 | return true; 26 | } 27 | 28 | @Override 29 | public final synchronized void uncaughtException(Thread thread, Throwable throwable) { 30 | try { 31 | Error error = new Error(String.format("FATAL EXCEPTION [%s]\n", thread.getName()) + String.format("Unity version : %s\n", "5.3.1f1") + String.format("Device model : %s %s\n", Build.MANUFACTURER, Build.MODEL) + String.format("Device fingerprint: %s\n", Build.FINGERPRINT)); 32 | error.setStackTrace(new StackTraceElement[0]); 33 | error.initCause(throwable); 34 | this.a.uncaughtException(thread, error); 35 | return; 36 | } 37 | catch (Throwable v0) { 38 | this.a.uncaughtException(thread, throwable); 39 | return; 40 | } 41 | } 42 | } 43 | 44 | -------------------------------------------------------------------------------- /com/unity3d/player/v.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | */ 4 | package com.unity3d.player; 5 | 6 | import com.unity3d.player.q; 7 | 8 | final class v { 9 | private static boolean a = false; 10 | private boolean b = !q.h; 11 | private boolean c = false; 12 | private boolean d = false; 13 | private boolean e = true; 14 | 15 | v() { 16 | } 17 | 18 | static void a() { 19 | a = true; 20 | } 21 | 22 | static void b() { 23 | a = false; 24 | } 25 | 26 | static boolean c() { 27 | return a; 28 | } 29 | 30 | final void d() { 31 | this.b = true; 32 | } 33 | 34 | final void a(boolean bl) { 35 | this.c = bl; 36 | } 37 | 38 | final void b(boolean bl) { 39 | this.e = bl; 40 | } 41 | 42 | final boolean e() { 43 | return this.e; 44 | } 45 | 46 | final void c(boolean bl) { 47 | this.d = bl; 48 | } 49 | 50 | final boolean f() { 51 | if (a && this.c && this.b && !this.e && !this.d) { 52 | return true; 53 | } 54 | return false; 55 | } 56 | 57 | final boolean g() { 58 | return this.d; 59 | } 60 | 61 | public final String toString() { 62 | return super.toString(); 63 | } 64 | } 65 | 66 | -------------------------------------------------------------------------------- /com/unity3d/player/w.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | * 4 | * Could not load the following classes: 5 | * android.content.Context 6 | * android.content.res.AssetFileDescriptor 7 | * android.content.res.AssetManager 8 | * android.content.res.Resources 9 | * android.media.MediaPlayer 10 | * android.media.MediaPlayer$OnBufferingUpdateListener 11 | * android.media.MediaPlayer$OnCompletionListener 12 | * android.media.MediaPlayer$OnPreparedListener 13 | * android.media.MediaPlayer$OnVideoSizeChangedListener 14 | * android.net.Uri 15 | * android.util.Log 16 | * android.view.Display 17 | * android.view.KeyEvent 18 | * android.view.MotionEvent 19 | * android.view.SurfaceHolder 20 | * android.view.SurfaceHolder$Callback 21 | * android.view.SurfaceView 22 | * android.view.View 23 | * android.view.ViewGroup 24 | * android.view.ViewGroup$LayoutParams 25 | * android.view.WindowManager 26 | * android.widget.FrameLayout 27 | * android.widget.FrameLayout$LayoutParams 28 | * android.widget.MediaController 29 | * android.widget.MediaController$MediaPlayerControl 30 | */ 31 | package com.unity3d.player; 32 | 33 | import android.content.Context; 34 | import android.content.res.AssetFileDescriptor; 35 | import android.content.res.AssetManager; 36 | import android.content.res.Resources; 37 | import android.media.MediaPlayer; 38 | import android.net.Uri; 39 | import android.util.Log; 40 | import android.view.Display; 41 | import android.view.KeyEvent; 42 | import android.view.MotionEvent; 43 | import android.view.SurfaceHolder; 44 | import android.view.SurfaceView; 45 | import android.view.View; 46 | import android.view.ViewGroup; 47 | import android.view.WindowManager; 48 | import android.widget.FrameLayout; 49 | import android.widget.MediaController; 50 | import com.unity3d.player.UnityPlayer; 51 | import java.io.FileDescriptor; 52 | import java.io.FileInputStream; 53 | import java.io.IOException; 54 | 55 | public final class w 56 | extends FrameLayout 57 | implements MediaPlayer.OnBufferingUpdateListener, 58 | MediaPlayer.OnCompletionListener, 59 | MediaPlayer.OnPreparedListener, 60 | MediaPlayer.OnVideoSizeChangedListener, 61 | SurfaceHolder.Callback, 62 | MediaController.MediaPlayerControl { 63 | private static boolean a = false; 64 | private final UnityPlayer b; 65 | private final Context c; 66 | private final SurfaceView d; 67 | private final SurfaceHolder e; 68 | private final String f; 69 | private final int g; 70 | private final int h; 71 | private final boolean i; 72 | private final long j; 73 | private final long k; 74 | private final FrameLayout l; 75 | private final Display m; 76 | private int n; 77 | private int o; 78 | private int p; 79 | private int q; 80 | private MediaPlayer r; 81 | private MediaController s; 82 | private boolean t = false; 83 | private boolean u = false; 84 | private int v = 0; 85 | private boolean w = false; 86 | private int x = 0; 87 | private boolean y; 88 | 89 | private static void a(String string) { 90 | Log.v((String)"Video", (String)("VideoPlayer: " + string)); 91 | } 92 | 93 | protected w(UnityPlayer unityPlayer, Context context, String string, int n2, int n3, int n4, boolean bl, long l2, long l3) { 94 | super(context); 95 | this.b = unityPlayer; 96 | this.c = context; 97 | this.l = this; 98 | this.d = new SurfaceView(context); 99 | this.e = this.d.getHolder(); 100 | this.e.addCallback((SurfaceHolder.Callback)this); 101 | this.e.setType(3); 102 | this.l.setBackgroundColor(n2); 103 | this.l.addView((View)this.d); 104 | unityPlayer = (WindowManager)this.c.getSystemService("window"); 105 | this.m = unityPlayer.getDefaultDisplay(); 106 | this.f = string; 107 | this.g = n3; 108 | this.h = n4; 109 | this.i = bl; 110 | this.j = l2; 111 | this.k = l3; 112 | if (a) { 113 | w.a("fileName: " + this.f); 114 | } 115 | if (a) { 116 | w.a("backgroundColor: " + n2); 117 | } 118 | if (a) { 119 | w.a("controlMode: " + this.g); 120 | } 121 | if (a) { 122 | w.a("scalingMode: " + this.h); 123 | } 124 | if (a) { 125 | w.a("isURL: " + this.i); 126 | } 127 | if (a) { 128 | w.a("videoOffset: " + this.j); 129 | } 130 | if (a) { 131 | w.a("videoLength: " + this.k); 132 | } 133 | this.setFocusable(true); 134 | this.setFocusableInTouchMode(true); 135 | this.y = true; 136 | } 137 | 138 | public final void onControllerHide() { 139 | } 140 | 141 | protected final void onPause() { 142 | if (a) { 143 | w.a("onPause called"); 144 | } 145 | if (!this.w) { 146 | this.pause(); 147 | this.w = false; 148 | } 149 | if (this.r != null) { 150 | this.x = this.r.getCurrentPosition(); 151 | } 152 | this.y = false; 153 | } 154 | 155 | protected final void onResume() { 156 | if (a) { 157 | w.a("onResume called"); 158 | } 159 | if (!this.y && !this.w) { 160 | this.start(); 161 | } 162 | this.y = true; 163 | } 164 | 165 | protected final void onDestroy() { 166 | this.onPause(); 167 | this.doCleanUp(); 168 | UnityPlayer.a(new Runnable(){ 169 | 170 | @Override 171 | public final void run() { 172 | w.this.b.hideVideoPlayer(); 173 | } 174 | }); 175 | } 176 | 177 | private void a() { 178 | this.doCleanUp(); 179 | try { 180 | this.r = new MediaPlayer(); 181 | if (this.i) { 182 | this.r.setDataSource(this.c, Uri.parse((String)this.f)); 183 | } else if (this.k != 0) { 184 | FileInputStream fileInputStream = new FileInputStream(this.f); 185 | this.r.setDataSource(fileInputStream.getFD(), this.j, this.k); 186 | fileInputStream.close(); 187 | } else { 188 | Object object = this.getResources().getAssets(); 189 | try { 190 | object = object.openFd(this.f); 191 | this.r.setDataSource(object.getFileDescriptor(), object.getStartOffset(), object.getLength()); 192 | object.close(); 193 | } 194 | catch (IOException v0) { 195 | object = new FileInputStream(this.f); 196 | this.r.setDataSource(object.getFD()); 197 | object.close(); 198 | } 199 | } 200 | this.r.setDisplay(this.e); 201 | this.r.setScreenOnWhilePlaying(true); 202 | this.r.setOnBufferingUpdateListener((MediaPlayer.OnBufferingUpdateListener)this); 203 | this.r.setOnCompletionListener((MediaPlayer.OnCompletionListener)this); 204 | this.r.setOnPreparedListener((MediaPlayer.OnPreparedListener)this); 205 | this.r.setOnVideoSizeChangedListener((MediaPlayer.OnVideoSizeChangedListener)this); 206 | this.r.setAudioStreamType(3); 207 | this.r.prepare(); 208 | if (this.g == 0 || this.g == 1) { 209 | this.s = new MediaController(this.c); 210 | this.s.setMediaPlayer((MediaController.MediaPlayerControl)this); 211 | this.s.setAnchorView((View)this); 212 | this.s.setEnabled(true); 213 | this.s.show(); 214 | } 215 | return; 216 | } 217 | catch (Exception var1_3) { 218 | if (a) { 219 | w.a("error: " + var1_3.getMessage() + var1_3); 220 | } 221 | this.onDestroy(); 222 | return; 223 | } 224 | } 225 | 226 | public final boolean onKeyDown(int n2, KeyEvent keyEvent) { 227 | if (n2 == 4 || this.g == 2 && n2 != 0 && !keyEvent.isSystem()) { 228 | this.onDestroy(); 229 | return true; 230 | } 231 | if (this.s != null) { 232 | return this.s.onKeyDown(n2, keyEvent); 233 | } 234 | return super.onKeyDown(n2, keyEvent); 235 | } 236 | 237 | public final boolean onTouchEvent(MotionEvent motionEvent) { 238 | int n2 = motionEvent.getAction() & 255; 239 | if (this.g == 2 && n2 == 0) { 240 | this.onDestroy(); 241 | return true; 242 | } 243 | if (this.s != null) { 244 | return this.s.onTouchEvent(motionEvent); 245 | } 246 | return super.onTouchEvent(motionEvent); 247 | } 248 | 249 | public final void onBufferingUpdate(MediaPlayer mediaPlayer, int n2) { 250 | if (a) { 251 | w.a("onBufferingUpdate percent:" + n2); 252 | } 253 | this.v = n2; 254 | } 255 | 256 | public final void onCompletion(MediaPlayer mediaPlayer) { 257 | if (a) { 258 | w.a("onCompletion called"); 259 | } 260 | this.onDestroy(); 261 | } 262 | 263 | public final void onVideoSizeChanged(MediaPlayer mediaPlayer, int n2, int n3) { 264 | if (a) { 265 | w.a("onVideoSizeChanged called " + n2 + "x" + n3); 266 | } 267 | if (n2 == 0 || n3 == 0) { 268 | if (a) { 269 | w.a("invalid video width(" + n2 + ") or height(" + n3 + ")"); 270 | } 271 | return; 272 | } 273 | this.t = true; 274 | this.p = n2; 275 | this.q = n3; 276 | if (this.u && this.t) { 277 | this.b(); 278 | } 279 | } 280 | 281 | public final void onPrepared(MediaPlayer mediaPlayer) { 282 | if (a) { 283 | w.a("onPrepared called"); 284 | } 285 | this.u = true; 286 | if (this.u && this.t) { 287 | this.b(); 288 | } 289 | } 290 | 291 | public final void surfaceChanged(SurfaceHolder surfaceHolder, int n2, int n3, int n4) { 292 | if (a) { 293 | w.a("surfaceChanged called " + n2 + " " + n3 + "x" + n4); 294 | } 295 | if (this.n != n3 || this.o != n4) { 296 | this.n = n3; 297 | this.o = n4; 298 | this.updateVideoLayout(); 299 | } 300 | } 301 | 302 | public final void surfaceDestroyed(SurfaceHolder surfaceHolder) { 303 | if (a) { 304 | w.a("surfaceDestroyed called"); 305 | } 306 | this.doCleanUp(); 307 | } 308 | 309 | public final void surfaceCreated(SurfaceHolder surfaceHolder) { 310 | if (a) { 311 | w.a("surfaceCreated called"); 312 | } 313 | this.a(); 314 | this.seekTo(this.x); 315 | } 316 | 317 | protected final void doCleanUp() { 318 | if (this.r != null) { 319 | this.r.release(); 320 | this.r = null; 321 | } 322 | this.p = 0; 323 | this.q = 0; 324 | this.u = false; 325 | this.t = false; 326 | } 327 | 328 | private void b() { 329 | if (this.isPlaying()) { 330 | return; 331 | } 332 | if (a) { 333 | w.a("startVideoPlayback"); 334 | } 335 | this.updateVideoLayout(); 336 | if (!this.w) { 337 | this.start(); 338 | } 339 | } 340 | 341 | protected final void updateVideoLayout() { 342 | if (a) { 343 | w.a("updateVideoLayout"); 344 | } 345 | if (this.n == 0 || this.o == 0) { 346 | WindowManager windowManager = (WindowManager)this.c.getSystemService("window"); 347 | this.n = windowManager.getDefaultDisplay().getWidth(); 348 | this.o = windowManager.getDefaultDisplay().getHeight(); 349 | } 350 | int n2 = this.n; 351 | int n3 = this.o; 352 | float f2 = (float)this.p / (float)this.q; 353 | float f3 = (float)this.n / (float)this.o; 354 | if (this.h == 1) { 355 | if (f3 <= f2) { 356 | n3 = (int)((float)this.n / f2); 357 | } else { 358 | n2 = (int)((float)this.o * f2); 359 | } 360 | } else if (this.h == 2) { 361 | if (f3 >= f2) { 362 | n3 = (int)((float)this.n / f2); 363 | } else { 364 | n2 = (int)((float)this.o * f2); 365 | } 366 | } else if (this.h == 0) { 367 | n2 = this.p; 368 | n3 = this.q; 369 | } 370 | if (a) { 371 | w.a("frameWidth = " + n2 + "; frameHeight = " + n3); 372 | } 373 | FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(n2, n3, 17); 374 | this.l.updateViewLayout((View)this.d, (ViewGroup.LayoutParams)layoutParams); 375 | } 376 | 377 | public final boolean canPause() { 378 | return true; 379 | } 380 | 381 | public final boolean canSeekBackward() { 382 | return true; 383 | } 384 | 385 | public final boolean canSeekForward() { 386 | return true; 387 | } 388 | 389 | public final int getBufferPercentage() { 390 | if (this.i) { 391 | return this.v; 392 | } 393 | return 100; 394 | } 395 | 396 | public final int getCurrentPosition() { 397 | if (this.r == null) { 398 | return 0; 399 | } 400 | return this.r.getCurrentPosition(); 401 | } 402 | 403 | public final int getDuration() { 404 | if (this.r == null) { 405 | return 0; 406 | } 407 | return this.r.getDuration(); 408 | } 409 | 410 | public final boolean isPlaying() { 411 | boolean bl; 412 | boolean bl2 = bl = this.u && this.t; 413 | if (this.r == null) { 414 | if (!bl) { 415 | return true; 416 | } 417 | return false; 418 | } 419 | if (this.r.isPlaying() || !bl) { 420 | return true; 421 | } 422 | return false; 423 | } 424 | 425 | public final void pause() { 426 | if (this.r == null) { 427 | return; 428 | } 429 | this.r.pause(); 430 | this.w = true; 431 | } 432 | 433 | public final void seekTo(int n2) { 434 | if (this.r == null) { 435 | return; 436 | } 437 | this.r.seekTo(n2); 438 | } 439 | 440 | public final void start() { 441 | if (this.r == null) { 442 | return; 443 | } 444 | this.r.start(); 445 | this.w = false; 446 | } 447 | 448 | } 449 | 450 | -------------------------------------------------------------------------------- /org/fmod/FMODAudioDevice.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | * 4 | * Could not load the following classes: 5 | * android.media.AudioTrack 6 | * android.util.Log 7 | */ 8 | package org.fmod; 9 | 10 | import android.media.AudioTrack; 11 | import android.util.Log; 12 | import java.nio.Buffer; 13 | import java.nio.ByteBuffer; 14 | import org.fmod.a; 15 | 16 | public class FMODAudioDevice 17 | implements Runnable { 18 | private volatile Thread a = null; 19 | private volatile boolean b = false; 20 | private AudioTrack c = null; 21 | private boolean d = false; 22 | private ByteBuffer e = null; 23 | private byte[] f = null; 24 | private volatile a g; 25 | private static int h = 0; 26 | private static int i = 1; 27 | private static int j = 2; 28 | private static int k = 3; 29 | 30 | public synchronized void start() { 31 | if (this.a != null) { 32 | this.stop(); 33 | } 34 | this.a = new Thread((Runnable)this, "FMODAudioDevice"); 35 | this.a.setPriority(10); 36 | this.b = true; 37 | this.a.start(); 38 | if (this.g != null) { 39 | this.g.b(); 40 | } 41 | } 42 | 43 | public synchronized void stop() { 44 | while (this.a != null) { 45 | this.b = false; 46 | try { 47 | this.a.join(); 48 | this.a = null; 49 | } 50 | catch (InterruptedException v0) {} 51 | } 52 | if (this.g != null) { 53 | this.g.c(); 54 | } 55 | } 56 | 57 | public synchronized void close() { 58 | this.stop(); 59 | } 60 | 61 | public boolean isRunning() { 62 | if (this.a != null && this.a.isAlive()) { 63 | return true; 64 | } 65 | return false; 66 | } 67 | 68 | @Override 69 | public void run() { 70 | int n2 = 3; 71 | while (this.b) { 72 | if (!this.d && n2 > 0) { 73 | this.releaseAudioTrack(); 74 | int n3 = this.fmodGetInfo(h); 75 | int n4 = Math.round((float)AudioTrack.getMinBufferSize((int)n3, (int)3, (int)2) * 1.1f) & -4; 76 | int n5 = this.fmodGetInfo(i); 77 | int n6 = this.fmodGetInfo(j); 78 | if (n5 * n6 * 4 > n4) { 79 | n4 = n5 * n6 * 4; 80 | } 81 | this.c = new AudioTrack(3, n3, 3, 2, n4, 1); 82 | boolean bl = this.d = this.c.getState() == 1; 83 | if (this.d) { 84 | n2 = 3; 85 | this.e = ByteBuffer.allocateDirect(n5 * 2 * 2); 86 | this.f = new byte[this.e.capacity()]; 87 | this.c.play(); 88 | } else { 89 | Log.e((String)"FMOD", (String)("AudioTrack failed to initialize (status " + this.c.getState() + ")")); 90 | this.releaseAudioTrack(); 91 | --n2; 92 | } 93 | } 94 | if (!this.d) continue; 95 | if (this.fmodGetInfo(k) == 1) { 96 | this.fmodProcess(this.e); 97 | this.e.get(this.f, 0, this.e.capacity()); 98 | this.c.write(this.f, 0, this.e.capacity()); 99 | this.e.position(0); 100 | continue; 101 | } 102 | this.releaseAudioTrack(); 103 | } 104 | this.releaseAudioTrack(); 105 | } 106 | 107 | private void releaseAudioTrack() { 108 | if (this.c != null) { 109 | if (this.c.getState() == 1) { 110 | this.c.stop(); 111 | } 112 | this.c.release(); 113 | this.c = null; 114 | } 115 | this.e = null; 116 | this.f = null; 117 | this.d = false; 118 | } 119 | 120 | private native int fmodGetInfo(int var1); 121 | 122 | private native int fmodProcess(ByteBuffer var1); 123 | 124 | native int fmodProcessMicData(ByteBuffer var1, int var2); 125 | 126 | public synchronized int startAudioRecord(int n2, int n3, int n4) { 127 | if (this.g == null) { 128 | this.g = new a(this, n2, n3); 129 | this.g.b(); 130 | } 131 | return this.g.a(); 132 | } 133 | 134 | public synchronized void stopAudioRecord() { 135 | if (this.g != null) { 136 | this.g.c(); 137 | this.g = null; 138 | } 139 | } 140 | } 141 | 142 | -------------------------------------------------------------------------------- /org/fmod/a.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0_114. 3 | * 4 | * Could not load the following classes: 5 | * android.media.AudioRecord 6 | * android.util.Log 7 | */ 8 | package org.fmod; 9 | 10 | import android.media.AudioRecord; 11 | import android.util.Log; 12 | import java.nio.Buffer; 13 | import java.nio.ByteBuffer; 14 | import org.fmod.FMODAudioDevice; 15 | 16 | final class a 17 | implements Runnable { 18 | private final FMODAudioDevice a; 19 | private final ByteBuffer b; 20 | private final int c; 21 | private final int d; 22 | private final int e; 23 | private volatile Thread f; 24 | private volatile boolean g; 25 | private AudioRecord h; 26 | private boolean i; 27 | 28 | a(FMODAudioDevice fMODAudioDevice, int n2, int n3) { 29 | this.a = fMODAudioDevice; 30 | this.c = n2; 31 | this.d = n3; 32 | this.e = 2; 33 | this.b = ByteBuffer.allocateDirect(AudioRecord.getMinBufferSize((int)n2, (int)n3, (int)2)); 34 | } 35 | 36 | public final int a() { 37 | return this.b.capacity(); 38 | } 39 | 40 | public final void b() { 41 | if (this.f != null) { 42 | this.c(); 43 | } 44 | this.g = true; 45 | this.f = new Thread(this); 46 | this.f.start(); 47 | } 48 | 49 | public final void c() { 50 | while (this.f != null) { 51 | this.g = false; 52 | try { 53 | this.f.join(); 54 | this.f = null; 55 | } 56 | catch (InterruptedException v0) {} 57 | } 58 | } 59 | 60 | @Override 61 | public final void run() { 62 | int n2 = 3; 63 | while (this.g) { 64 | if (!this.i && n2 > 0) { 65 | this.d(); 66 | this.h = new AudioRecord(1, this.c, this.d, this.e, this.b.capacity()); 67 | boolean bl = this.i = this.h.getState() == 1; 68 | if (this.i) { 69 | n2 = 3; 70 | this.b.position(0); 71 | this.h.startRecording(); 72 | } else { 73 | Log.e((String)"FMOD", (String)("AudioRecord failed to initialize (status " + this.h.getState() + ")")); 74 | --n2; 75 | this.d(); 76 | } 77 | } 78 | if (!this.i || this.h.getRecordingState() != 3) continue; 79 | int n3 = this.h.read(this.b, this.b.capacity()); 80 | this.a.fmodProcessMicData(this.b, n3); 81 | this.b.position(0); 82 | } 83 | this.d(); 84 | } 85 | 86 | private void d() { 87 | if (this.h != null) { 88 | if (this.h.getState() == 1) { 89 | this.h.stop(); 90 | } 91 | this.h.release(); 92 | this.h = null; 93 | } 94 | this.b.position(0); 95 | this.i = false; 96 | } 97 | } 98 | 99 | --------------------------------------------------------------------------------