CrackMe.apk
Download file
package com.facebook.react.views.view;
import android.graphics.Rect;
import android.view.View;
import androidx.core.view.ViewCompat;
import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.JSApplicationIllegalArgumentException;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.common.MapBuilder;
import com.facebook.react.module.annotations.ReactModule;
import com.facebook.react.uimanager.PixelUtil;
import com.facebook.react.uimanager.PointerEvents;
import com.facebook.react.uimanager.ThemedReactContext;
import com.facebook.react.uimanager.UIManagerHelper;
import com.facebook.react.uimanager.ViewProps;
import com.facebook.react.uimanager.annotations.ReactProp;
import com.facebook.react.uimanager.annotations.ReactPropGroup;
import com.facebook.react.uimanager.events.EventDispatcher;
import com.facebook.yoga.YogaConstants;
import java.util.Map;
@ReactModule(name = "RCTView")
public class ReactViewManager extends ReactClippingViewManager<ReactViewGroup> {
private static final int CMD_HOTSPOT_UPDATE = 1;
private static final int CMD_SET_PRESSED = 2;
private static final String HOTSPOT_UPDATE_KEY = "hotspotUpdate";
public static final String REACT_CLASS = "RCTView";
private static final int[] SPACING_TYPES = {8, 0, 2, 1, 3, 4, 5};
public String getName() {
return "RCTView";
}
@ReactProp(name = "collapsable")
public void setCollapsable(ReactViewGroup reactViewGroup, boolean z) {
}
public ReactViewManager() {
setupViewRecycling();
}
/* access modifiers changed from: protected */
public ReactViewGroup prepareToRecycleView(ThemedReactContext themedReactContext, ReactViewGroup reactViewGroup) {
super.prepareToRecycleView(themedReactContext, reactViewGroup);
reactViewGroup.recycleView();
return reactViewGroup;
}
@ReactProp(name = "accessible")
public void setAccessible(ReactViewGroup reactViewGroup, boolean z) {
reactViewGroup.setFocusable(z);
}
@ReactProp(name = "hasTVPreferredFocus")
public void setTVPreferredFocus(ReactViewGroup reactViewGroup, boolean z) {
if (z) {
reactViewGroup.setFocusable(true);
reactViewGroup.setFocusableInTouchMode(true);
reactViewGroup.requestFocus();
}
}
@ReactProp(defaultInt = -1, name = "nextFocusDown")
public void nextFocusDown(ReactViewGroup reactViewGroup, int i) {
reactViewGroup.setNextFocusDownId(i);
}
@ReactProp(defaultInt = -1, name = "nextFocusForward")
public void nextFocusForward(ReactViewGroup reactViewGroup, int i) {
reactViewGroup.setNextFocusForwardId(i);
}
@ReactProp(defaultInt = -1, name = "nextFocusLeft")
public void nextFocusLeft(ReactViewGroup reactViewGroup, int i) {
reactViewGroup.setNextFocusLeftId(i);
}
@ReactProp(defaultInt = -1, name = "nextFocusRight")
public void nextFocusRight(ReactViewGroup reactViewGroup, int i) {
reactViewGroup.setNextFocusRightId(i);
}
@ReactProp(defaultInt = -1, name = "nextFocusUp")
public void nextFocusUp(ReactViewGroup reactViewGroup, int i) {
reactViewGroup.setNextFocusUpId(i);
}
@ReactPropGroup(defaultFloat = Float.NaN, names = {"borderRadius", "borderTopLeftRadius", "borderTopRightRadius", "borderBottomRightRadius", "borderBottomLeftRadius", "borderTopStartRadius", "borderTopEndRadius", "borderBottomStartRadius", "borderBottomEndRadius"})
public void setBorderRadius(ReactViewGroup reactViewGroup, int i, float f) {
if (!YogaConstants.isUndefined(f) && f < 0.0f) {
f = Float.NaN;
}
if (!YogaConstants.isUndefined(f)) {
f = PixelUtil.toPixelFromDIP(f);
}
if (i == 0) {
reactViewGroup.setBorderRadius(f);
} else {
reactViewGroup.setBorderRadius(f, i - 1);
}
}
@ReactProp(name = "borderStyle")
public void setBorderStyle(ReactViewGroup reactViewGroup, String str) {
reactViewGroup.setBorderStyle(str);
}
/* renamed from: com.facebook.react.views.view.ReactViewManager$2 reason: invalid class name */
static /* synthetic */ class AnonymousClass2 {
static final /* synthetic */ int[] $SwitchMap$com$facebook$react$bridge$ReadableType;
/* JADX WARNING: Can't wrap try/catch for region: R(6:0|1|2|3|4|(3:5|6|8)) */
/* JADX WARNING: Failed to process nested try/catch */
/* JADX WARNING: Missing exception handler attribute for start block: B:3:0x0012 */
/* JADX WARNING: Missing exception handler attribute for start block: B:5:0x001d */
static {
/*
com.facebook.react.bridge.ReadableType[] r0 = com.facebook.react.bridge.ReadableType.values()
int r0 = r0.length
int[] r0 = new int[r0]
$SwitchMap$com$facebook$react$bridge$ReadableType = r0
com.facebook.react.bridge.ReadableType r1 = com.facebook.react.bridge.ReadableType.Null // Catch:{ NoSuchFieldError -> 0x0012 }
int r1 = r1.ordinal() // Catch:{ NoSuchFieldError -> 0x0012 }
r2 = 1
r0[r1] = r2 // Catch:{ NoSuchFieldError -> 0x0012 }
L_0x0012:
int[] r0 = $SwitchMap$com$facebook$react$bridge$ReadableType // Catch:{ NoSuchFieldError -> 0x001d }
com.facebook.react.bridge.ReadableType r1 = com.facebook.react.bridge.ReadableType.Map // Catch:{ NoSuchFieldError -> 0x001d }
int r1 = r1.ordinal() // Catch:{ NoSuchFieldError -> 0x001d }
r2 = 2
r0[r1] = r2 // Catch:{ NoSuchFieldError -> 0x001d }
L_0x001d:
int[] r0 = $SwitchMap$com$facebook$react$bridge$ReadableType // Catch:{ NoSuchFieldError -> 0x0028 }
com.facebook.react.bridge.ReadableType r1 = com.facebook.react.bridge.ReadableType.Number // Catch:{ NoSuchFieldError -> 0x0028 }
int r1 = r1.ordinal() // Catch:{ NoSuchFieldError -> 0x0028 }
r2 = 3
r0[r1] = r2 // Catch:{ NoSuchFieldError -> 0x0028 }
L_0x0028:
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.facebook.react.views.view.ReactViewManager.AnonymousClass2.<clinit>():void");
}
}
@ReactProp(name = "hitSlop")
public void setHitSlop(ReactViewGroup reactViewGroup, Dynamic dynamic) {
int i = AnonymousClass2.$SwitchMap$com$facebook$react$bridge$ReadableType[dynamic.getType().ordinal()];
if (i == 1) {
reactViewGroup.setHitSlopRect((Rect) null);
} else if (i == 2) {
ReadableMap asMap = dynamic.asMap();
int i2 = 0;
int pixelFromDIP = asMap.hasKey("left") ? (int) PixelUtil.toPixelFromDIP(asMap.getDouble("left")) : 0;
int pixelFromDIP2 = asMap.hasKey(ViewProps.TOP) ? (int) PixelUtil.toPixelFromDIP(asMap.getDouble(ViewProps.TOP)) : 0;
int pixelFromDIP3 = asMap.hasKey("right") ? (int) PixelUtil.toPixelFromDIP(asMap.getDouble("right")) : 0;
if (asMap.hasKey(ViewProps.BOTTOM)) {
i2 = (int) PixelUtil.toPixelFromDIP(asMap.getDouble(ViewProps.BOTTOM));
}
reactViewGroup.setHitSlopRect(new Rect(pixelFromDIP, pixelFromDIP2, pixelFromDIP3, i2));
} else if (i == 3) {
int pixelFromDIP4 = (int) PixelUtil.toPixelFromDIP(dynamic.asDouble());
reactViewGroup.setHitSlopRect(new Rect(pixelFromDIP4, pixelFromDIP4, pixelFromDIP4, pixelFromDIP4));
} else {
throw new JSApplicationIllegalArgumentException("Invalid type for 'hitSlop' value " + dynamic.getType());
}
}
@ReactProp(name = "pointerEvents")
public void setPointerEvents(ReactViewGroup reactViewGroup, String str) {
reactViewGroup.setPointerEvents(PointerEvents.parsePointerEvents(str));
}
@ReactProp(name = "nativeBackgroundAndroid")
public void setNativeBackground(ReactViewGroup reactViewGroup, ReadableMap readableMap) {
reactViewGroup.setTranslucentBackgroundDrawable(readableMap == null ? null : ReactDrawableHelper.createDrawableFromJSDescription(reactViewGroup.getContext(), readableMap));
}
@ReactProp(name = "nativeForegroundAndroid")
public void setNativeForeground(ReactViewGroup reactViewGroup, ReadableMap readableMap) {
reactViewGroup.setForeground(readableMap == null ? null : ReactDrawableHelper.createDrawableFromJSDescription(reactViewGroup.getContext(), readableMap));
}
@ReactProp(name = "needsOffscreenAlphaCompositing")
public void setNeedsOffscreenAlphaCompositing(ReactViewGroup reactViewGroup, boolean z) {
reactViewGroup.setNeedsOffscreenAlphaCompositing(z);
}
@ReactPropGroup(defaultFloat = Float.NaN, names = {"borderWidth", "borderLeftWidth", "borderRightWidth", "borderTopWidth", "borderBottomWidth", "borderStartWidth", "borderEndWidth"})
public void setBorderWidth(ReactViewGroup reactViewGroup, int i, float f) {
if (!YogaConstants.isUndefined(f) && f < 0.0f) {
f = Float.NaN;
}
if (!YogaConstants.isUndefined(f)) {
f = PixelUtil.toPixelFromDIP(f);
}
reactViewGroup.setBorderWidth(SPACING_TYPES[i], f);
}
@ReactPropGroup(customType = "Color", names = {"borderColor", "borderLeftColor", "borderRightColor", "borderTopColor", "borderBottomColor", "borderStartColor", "borderEndColor"})
public void setBorderColor(ReactViewGroup reactViewGroup, int i, Integer num) {
float f = Float.NaN;
float intValue = num == null ? Float.NaN : (float) (num.intValue() & ViewCompat.MEASURED_SIZE_MASK);
if (num != null) {
f = (float) (num.intValue() >>> 24);
}
reactViewGroup.setBorderColor(SPACING_TYPES[i], intValue, f);
}
@ReactProp(name = "focusable")
public void setFocusable(final ReactViewGroup reactViewGroup, boolean z) {
if (z) {
reactViewGroup.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
EventDispatcher eventDispatcherForReactTag = UIManagerHelper.getEventDispatcherForReactTag((ReactContext) reactViewGroup.getContext(), reactViewGroup.getId());
if (eventDispatcherForReactTag != null) {
eventDispatcherForReactTag.dispatchEvent(new ViewGroupClickEvent(UIManagerHelper.getSurfaceId(reactViewGroup.getContext()), reactViewGroup.getId()));
}
}
});
reactViewGroup.setFocusable(true);
return;
}
reactViewGroup.setOnClickListener((View.OnClickListener) null);
reactViewGroup.setClickable(false);
}
@ReactProp(name = "overflow")
public void setOverflow(ReactViewGroup reactViewGroup, String str) {
reactViewGroup.setOverflow(str);
}
@ReactProp(name = "backfaceVisibility")
public void setBackfaceVisibility(ReactViewGroup reactViewGroup, String str) {
reactViewGroup.setBackfaceVisibility(str);
}
public void setOpacity(ReactViewGroup reactViewGroup, float f) {
reactViewGroup.setOpacityIfPossible(f);
}
public void setTransform(ReactViewGroup reactViewGroup, ReadableArray readableArray) {
super.setTransform(reactViewGroup, readableArray);
reactViewGroup.setBackfaceVisibilityDependantOpacity();
}
public ReactViewGroup createViewInstance(ThemedReactContext themedReactContext) {
return new ReactViewGroup(themedReactContext);
}
public Map<String, Integer> getCommandsMap() {
return MapBuilder.of(HOTSPOT_UPDATE_KEY, 1, "setPressed", 2);
}
public void receiveCommand(ReactViewGroup reactViewGroup, int i, ReadableArray readableArray) {
if (i == 1) {
handleHotspotUpdate(reactViewGroup, readableArray);
} else if (i == 2) {
handleSetPressed(reactViewGroup, readableArray);
}
}
public void receiveCommand(ReactViewGroup reactViewGroup, String str, ReadableArray readableArray) {
str.hashCode();
if (str.equals("setPressed")) {
handleSetPressed(reactViewGroup, readableArray);
} else if (str.equals(HOTSPOT_UPDATE_KEY)) {
handleHotspotUpdate(reactViewGroup, readableArray);
}
}
private void handleSetPressed(ReactViewGroup reactViewGroup, ReadableArray readableArray) {
if (readableArray == null || readableArray.size() != 1) {
throw new JSApplicationIllegalArgumentException("Illegal number of arguments for 'setPressed' command");
}
reactViewGroup.setPressed(readableArray.getBoolean(0));
}
private void handleHotspotUpdate(ReactViewGroup reactViewGroup, ReadableArray readableArray) {
if (readableArray == null || readableArray.size() != 2) {
throw new JSApplicationIllegalArgumentException("Illegal number of arguments for 'updateHotspot' command");
}
reactViewGroup.drawableHotspotChanged(PixelUtil.toPixelFromDIP(readableArray.getDouble(0)), PixelUtil.toPixelFromDIP(readableArray.getDouble(1)));
}
}
Download file