110 lines
5.1 KiB
Java
110 lines
5.1 KiB
Java
package c.i.a.f.d;
|
|
|
|
import android.content.Intent;
|
|
import android.os.Bundle;
|
|
import android.os.Looper;
|
|
import android.os.Message;
|
|
import android.os.Messenger;
|
|
import android.os.Parcelable;
|
|
import android.util.Log;
|
|
import c.i.a.f.h.f.a;
|
|
import com.google.android.gms.cloudmessaging.zza;
|
|
import java.util.Objects;
|
|
import java.util.regex.Matcher;
|
|
import java.util.regex.Pattern;
|
|
/* compiled from: com.google.android.gms:play-services-cloud-messaging@@16.0.0 */
|
|
public final class y extends a {
|
|
public final /* synthetic */ b a;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public y(b bVar, Looper looper) {
|
|
super(looper);
|
|
this.a = bVar;
|
|
}
|
|
|
|
@Override // android.os.Handler
|
|
public final void handleMessage(Message message) {
|
|
b bVar = this.a;
|
|
Objects.requireNonNull(bVar);
|
|
if (message != null) {
|
|
Object obj = message.obj;
|
|
if (obj instanceof Intent) {
|
|
Intent intent = (Intent) obj;
|
|
intent.setExtrasClassLoader(new zza.a());
|
|
if (intent.hasExtra("google.messenger")) {
|
|
Parcelable parcelableExtra = intent.getParcelableExtra("google.messenger");
|
|
if (parcelableExtra instanceof zza) {
|
|
bVar.i = (zza) parcelableExtra;
|
|
}
|
|
if (parcelableExtra instanceof Messenger) {
|
|
bVar.h = (Messenger) parcelableExtra;
|
|
}
|
|
}
|
|
Intent intent2 = (Intent) message.obj;
|
|
String action = intent2.getAction();
|
|
if ("com.google.android.c2dm.intent.REGISTRATION".equals(action)) {
|
|
String stringExtra = intent2.getStringExtra("registration_id");
|
|
if (stringExtra == null) {
|
|
stringExtra = intent2.getStringExtra("unregistered");
|
|
}
|
|
if (stringExtra == null) {
|
|
String stringExtra2 = intent2.getStringExtra("error");
|
|
if (stringExtra2 == null) {
|
|
String valueOf = String.valueOf(intent2.getExtras());
|
|
c.d.b.a.a.Y(valueOf.length() + 49, "Unexpected response, no error or registration id ", valueOf, "Rpc");
|
|
return;
|
|
}
|
|
if (Log.isLoggable("Rpc", 3)) {
|
|
Log.d("Rpc", stringExtra2.length() != 0 ? "Received InstanceID error ".concat(stringExtra2) : new String("Received InstanceID error "));
|
|
}
|
|
if (stringExtra2.startsWith("|")) {
|
|
String[] split = stringExtra2.split("\\|");
|
|
if (split.length <= 2 || !"ID".equals(split[1])) {
|
|
Log.w("Rpc", stringExtra2.length() != 0 ? "Unexpected structured response ".concat(stringExtra2) : new String("Unexpected structured response "));
|
|
return;
|
|
}
|
|
String str = split[2];
|
|
String str2 = split[3];
|
|
if (str2.startsWith(":")) {
|
|
str2 = str2.substring(1);
|
|
}
|
|
bVar.a(str, intent2.putExtra("error", str2).getExtras());
|
|
return;
|
|
}
|
|
synchronized (bVar.f1024c) {
|
|
for (int i = 0; i < bVar.f1024c.size(); i++) {
|
|
bVar.a(bVar.f1024c.keyAt(i), intent2.getExtras());
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
Matcher matcher = Pattern.compile("\\|ID\\|([^|]+)\\|:?+(.*)").matcher(stringExtra);
|
|
if (matcher.matches()) {
|
|
String group = matcher.group(1);
|
|
String group2 = matcher.group(2);
|
|
if (group != null) {
|
|
Bundle extras = intent2.getExtras();
|
|
extras.putString("registration_id", group2);
|
|
bVar.a(group, extras);
|
|
return;
|
|
}
|
|
return;
|
|
} else if (Log.isLoggable("Rpc", 3)) {
|
|
Log.d("Rpc", stringExtra.length() != 0 ? "Unexpected response string: ".concat(stringExtra) : new String("Unexpected response string: "));
|
|
return;
|
|
} else {
|
|
return;
|
|
}
|
|
} else if (Log.isLoggable("Rpc", 3)) {
|
|
String valueOf2 = String.valueOf(action);
|
|
Log.d("Rpc", valueOf2.length() != 0 ? "Unexpected response action: ".concat(valueOf2) : new String("Unexpected response action: "));
|
|
return;
|
|
} else {
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
Log.w("Rpc", "Dropping invalid message");
|
|
}
|
|
}
|