Picsart v24.6版本的 MD5 值为:21a61631d94e54da68d2ad9268b8b9d9
以下内容为反编译后的 CollageHandler.java 源代码,内容仅作参考
package com.picsart.editor.deeplink;
import android.content.Intent;
import android.os.Bundle;
import androidx.activity.ComponentActivity;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.e;
import com.picsart.analytics.AnalyticsInfo;
import com.picsart.chooser.ChooserAnalyticsData;
import com.picsart.chooser.ChooserResultModel;
import com.picsart.chooser.MediaItemLoaded;
import com.picsart.chooser.c;
import com.picsart.chooser.media.MediaChooserMode;
import com.picsart.chooser.media.topitems.TopRibbonParams;
import com.picsart.studio.R;
import com.picsart.studio.common.constants.SourceParam;
import com.picsart.studio.editor.main.EditorActivity;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import kotlin.LazyThreadSafetyMode;
import kotlin.Metadata;
import kotlin.Pair;
import kotlin.Unit;
import kotlin.collections.EmptyList;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1;
import myobfuscated.el2.d;
import myobfuscated.go0.b;
import myobfuscated.h4.z;
import myobfuscated.i3.g;
import myobfuscated.ik2.h;
import myobfuscated.mn2.k;
import myobfuscated.o20.f;
import myobfuscated.q50.o;
import myobfuscated.q50.r;
import myobfuscated.sn2.s;
import myobfuscated.xk2.q;
import myobfuscated.z60.a;
import org.jetbrains.annotations.NotNull;
import org.koin.core.scope.Scope;
@Metadata(d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B\u0007¢\u0006\u0004\b\u0003\u0010\u0004¨\u0006\u0005"}, d2 = {"Lcom/picsart/editor/deeplink/CollageHandler;", "Lmyobfuscated/go0/b;", "Lmyobfuscated/z60/a;", "<init>", "()V", "_picsart_compileGlobalReleaseKotlin"}, k = 1, mv = {1, 9, 0})
public final class CollageHandler extends b<a> {
public static final int k = 0;
@NotNull
public final h i = kotlin.a.a(LazyThreadSafetyMode.NONE, new Function0<a>() {
{
super(0);
}
@Override
@NotNull
public final a invoke() {
myobfuscated.i4.a defaultViewModelCreationExtras;
ComponentActivity componentActivity = ComponentActivity.this;
myobfuscated.yp2.a aVar = r2;
Function0 function0 = r3;
Function0 function02 = r4;
z viewModelStore = componentActivity.getViewModelStore();
if (function0 == null || (defaultViewModelCreationExtras = (myobfuscated.i4.a) function0.invoke()) == null) {
defaultViewModelCreationExtras = componentActivity.getDefaultViewModelCreationExtras();
Intrinsics.checkNotNullExpressionValue(defaultViewModelCreationExtras, "this.defaultViewModelCreationExtras");
}
myobfuscated.i4.a aVar2 = defaultViewModelCreationExtras;
Scope a = myobfuscated.jp2.a.a(componentActivity);
d b = q.a.b(a.class);
Intrinsics.checkNotNullExpressionValue(viewModelStore, "viewModelStore");
return myobfuscated.op2.a.a(b, viewModelStore, null, aVar2, aVar, a, function02);
}
});
@NotNull
public final String j = "collage";
@Override
@NotNull
public final String O() {
return this.j;
}
@Override
@NotNull
public final a P() {
return (a) this.i.getValue();
}
public final void W(List<? extends MediaItemLoaded> list) {
LinkedHashMap linkedHashMap = this.b;
int i = 0;
Unit unit = null;
if (linkedHashMap.containsKey("collage-layout")) {
String str = (String) linkedHashMap.get("collage-layout");
if (str != null) {
R(SourceParam.COLLAGE);
Bundle b = g.b(new Pair("editor_mode", "grid"), new Pair("opening_tool", "grid"));
myobfuscated.pl1.a aVar = this.d;
String str2 = aVar != null ? aVar.a : null;
String str3 = str2 == null ? "" : str2;
String str4 = this.e;
String value = this.f.getValue();
Intrinsics.checkNotNullExpressionValue(value, "getValue(...)");
AnalyticsInfo analyticsInfo = new AnalyticsInfo(str3, null, null, null, null, null, str4, value, null, null, null, null, 0, null, null, 32574);
ArrayList arrayList = new ArrayList();
int size = list.size();
while (i < size) {
arrayList.add(analyticsInfo);
i++;
}
ChooserResultModel chooserResultModel = new ChooserResultModel(o.d(), -1, list, analyticsInfo, arrayList, false, null, str, M(), null, b, null, 126560);
Intent intent = new Intent(this, EditorActivity.class);
r.d(intent, chooserResultModel);
this.f.attachTo(intent);
startActivity(intent);
finish();
unit = Unit.a;
}
if (unit == null) {
finish();
}
} else if (k.v(M(), "picsart://collage-frame", false)) {
U(list);
} else if (!k.v(M(), "picsart://collage-free-style", false)) {
if (!k.v(M(), "picsart://collage", false) && !k.v(M(), "https://picsart.com/collage", false)) {
finish();
return;
}
R(SourceParam.COLLAGE);
X(MediaChooserMode.GRID_COLLAGE, list);
} else {
R(SourceParam.COLLAGE_FREE_STYLE);
String str5 = (String) linkedHashMap.get("type");
if (Intrinsics.c(str5, "chooser")) {
X(MediaChooserMode.FREESTYLE_COLLAGE, list);
} else if (!Intrinsics.c(str5, "blank")) {
X(MediaChooserMode.FREESTYLE_COLLAGE, list);
} else {
myobfuscated.pl1.a aVar2 = this.d;
String str6 = aVar2 != null ? aVar2.a : null;
String str7 = str6 == null ? "" : str6;
String str8 = this.e;
String value2 = this.f.getValue();
Intrinsics.checkNotNullExpressionValue(value2, "getValue(...)");
AnalyticsInfo analyticsInfo2 = new AnalyticsInfo(str7, null, null, null, null, null, str8, value2, null, null, null, null, 0, null, null, 32574);
Bundle b2 = g.b(new Pair("editor_mode", "freestyle"), new Pair("opening_tool", "freestyle"), new Pair("have_initial_data", Boolean.TRUE), new Pair("selectable_items_count", 10));
ArrayList arrayList2 = new ArrayList();
int size2 = list.size();
while (i < size2) {
arrayList2.add(analyticsInfo2);
i++;
}
ChooserResultModel chooserResultModel2 = new ChooserResultModel(o.d(), 0, list, analyticsInfo2, arrayList2, false, null, null, M(), null, b2, null, 126690);
Intent intent2 = new Intent(this, EditorActivity.class);
r.d(intent2, chooserResultModel2);
this.f.attachTo(intent2);
startActivity(intent2);
finish();
}
}
}
public final void X(MediaChooserMode mediaChooserMode, List<? extends MediaItemLoaded> list) {
MediaChooserMode mediaChooserMode2 = MediaChooserMode.GRID_COLLAGE;
String str = mediaChooserMode == mediaChooserMode2 ? "grid" : "freestyle";
Bundle b = g.b(new Pair("editor_mode", str), new Pair("opening_tool", str));
myobfuscated.pl1.a aVar = this.d;
TopRibbonParams topRibbonParams = null;
String str2 = aVar != null ? aVar.a : null;
if (str2 == null) {
str2 = "";
}
String str3 = this.e;
String value = this.f.getValue();
Intrinsics.checkNotNullExpressionValue(value, "getValue(...)");
ChooserAnalyticsData chooserAnalyticsData = new ChooserAnalyticsData(str2, str3, value);
if (mediaChooserMode == mediaChooserMode2) {
String string = getString(R.string.tooltip_create_collage);
Intrinsics.checkNotNullExpressionValue(string, "getString(...)");
topRibbonParams = new TopRibbonParams(string, R.color.white, 14.0f, 17, R.color.accent_blue, false, 8.0f);
}
c.a.a(P().e, this, f.c(mediaChooserMode, list, topRibbonParams, M(), b), chooserAnalyticsData, 335544320, 8);
finish();
}
@Override
public final boolean handle(String str) {
List<String> list;
if (super.handle(str)) {
LinkedHashMap linkedHashMap = this.b;
try {
if (linkedHashMap.containsKey("photo-ids") || linkedHashMap.containsKey("photo-paths") || !((list = P().u) == null || list.isEmpty())) {
T(o.d());
return true;
}
W(EmptyList.INSTANCE);
return true;
} catch (Exception unused) {
finish();
return true;
}
}
return false;
}
@Override
public final void handleStoragePermissionGranted() {
P().g4();
}
@Override
public final void onCreate(Bundle bundle) {
setPreRequestWriteStoragePermission(true);
P().u = getIntent().getStringArrayListExtra("EXTRA_PHOTO_URLS");
s sVar = P().t;
Lifecycle lifecycle = getLifecycle();
Intrinsics.checkNotNullExpressionValue(lifecycle, "<get-lifecycle>(...)");
kotlinx.coroutines.flow.a.v(new FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1(new CollageHandler$onCreate$1(this, null), e.a(sVar, lifecycle, Lifecycle.State.CREATED)), androidx.lifecycle.d.a(this));
if (getHasStoragePermission()) {
P().g4();
}
super.onCreate(bundle);
}
}