// Path: app/src/main/java/com/icecream/snorlax/module/Log.java
// @SuppressWarnings({"unused", "FieldCanBeLocal", "WeakerAccess"})
// public final class Log {
// 
// 	public static void d(String format, Object... args) {
// 		XposedBridge.log(String.format(Locale.US, format, args));
// 	}
// 
// 	public static void e(Throwable throwable) {
// 		XposedBridge.log(throwable);
// 	}
// 
// 	public static void e(Throwable throwable, String format, Object... args) {
// 		XposedBridge.log(new Exception(String.format(Locale.US, format, args), throwable));
// 	}
// 
// 	public static void e(String format, Object... args) {
// 		XposedBridge.log(new Exception(String.format(Locale.US, format, args)));
// 	}
// 
// 	private Log() {
// 		throw new AssertionError("No instances");
// 	}
// }
// 
// Path: app/src/main/java/com/icecream/snorlax/module/feature/Feature.java
// public interface Feature {
// 
// 	void subscribe() throws Exception;
// 
// 	void unsubscribe() throws Exception;
// }


import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedHelpers;
import javax.inject.Inject;
import javax.inject.Singleton;
import android.content.ContextWrapper;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.Toast;
import com.icecream.snorlax.R;
import com.icecream.snorlax.module.Log;
import com.icecream.snorlax.module.context.snorlax.Snorlax;
import com.icecream.snorlax.module.feature.Feature;
/*
 * Copyright (c) 2016. Pedro Diaz <igoticecream@gmail.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.icecream.snorlax.module.feature.ui;





@Singleton
final class Ui implements Feature {

	private final ClassLoader mClassLoader;
	private final LayoutInflater mLayoutInflater;

	private XC_MethodHook.Unhook mUnhookUnity;

	@Inject
	Ui(ClassLoader classLoader, @Snorlax LayoutInflater layoutInflater) {
		mClassLoader = classLoader;
		mLayoutInflater = layoutInflater;
	}

	@Override
	public void subscribe() throws Exception {
		final Class<?> unity = XposedHelpers.findClass("com.unity3d.player.UnityPlayer", mClassLoader);
		if (unity == null) {
// Path: app/src/main/java/com/icecream/snorlax/module/Log.java
// @SuppressWarnings({"unused", "FieldCanBeLocal", "WeakerAccess"})
// public final class Log {
// 
// 	public static void d(String format, Object... args) {
// 		XposedBridge.log(String.format(Locale.US, format, args));
// 	}
// 
// 	public static void e(Throwable throwable) {
// 		XposedBridge.log(throwable);
// 	}
// 
// 	public static void e(Throwable throwable, String format, Object... args) {
// 		XposedBridge.log(new Exception(String.format(Locale.US, format, args), throwable));
// 	}
// 
// 	public static void e(String format, Object... args) {
// 		XposedBridge.log(new Exception(String.format(Locale.US, format, args)));
// 	}
// 
// 	private Log() {
// 		throw new AssertionError("No instances");
// 	}
// }
// 
// Path: app/src/main/java/com/icecream/snorlax/module/feature/Feature.java
// public interface Feature {
// 
// 	void subscribe() throws Exception;
// 
// 	void unsubscribe() throws Exception;
// }


// Path: app/src/main/java/com/icecream/snorlax/module/feature/ui/Ui.java
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedHelpers;
import javax.inject.Inject;
import javax.inject.Singleton;
import android.content.ContextWrapper;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.Toast;
import com.icecream.snorlax.R;
import com.icecream.snorlax.module.Log;
import com.icecream.snorlax.module.context.snorlax.Snorlax;
import com.icecream.snorlax.module.feature.Feature;

/*
 * Copyright (c) 2016. Pedro Diaz <igoticecream@gmail.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.icecream.snorlax.module.feature.ui;





@Singleton
final class Ui implements Feature {

	private final ClassLoader mClassLoader;
	private final LayoutInflater mLayoutInflater;

	private XC_MethodHook.Unhook mUnhookUnity;

	@Inject
	Ui(ClassLoader classLoader, @Snorlax LayoutInflater layoutInflater) {
		mClassLoader = classLoader;
		mLayoutInflater = layoutInflater;
	}

	@Override
	public void subscribe() throws Exception {
		final Class<?> unity = XposedHelpers.findClass("com.unity3d.player.UnityPlayer", mClassLoader);
		if (unity == null) {
			Log.e("Cannot find UnityPlayer class");