导航菜单

页面标题

页面副标题

Cantique de Louanges v12 - RegistrationIntentService.java 源代码

正在查看: Cantique de Louanges v12 应用的 RegistrationIntentService.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.eugene.hymnesetlouanges;

import android.app.IntentService;
import android.content.Intent;
import android.content.SharedPreferences;
import com.google.firebase.iid.FirebaseInstanceId;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class RegistrationIntentService extends IntentService {
    String a;
    long b;

    public RegistrationIntentService() {
        super("RegistrationIntentService");
        this.a = "A";
    }

    private void a(String str) {
        Throwable th;
        HttpURLConnection httpURLConnection;
        if (this.b <= 0 || str == null || str.equals("")) {
            return;
        }
        HttpURLConnection httpURLConnection2 = null;
        try {
            httpURLConnection = (HttpURLConnection) new URL(config.f23m6 + "/srv/guardargcmid.php?idusu=" + this.b + "&gcmid=" + str + "&accion=" + this.a).openConnection();
            try {
                httpURLConnection.setDoInput(true);
                httpURLConnection.setConnectTimeout(10000);
                httpURLConnection.setReadTimeout(10000);
                httpURLConnection.setRequestProperty("User-Agent", "Android Vinebre Software");
                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(httpURLConnection.getInputStream()));
                StringBuilder sb = new StringBuilder();
                while (true) {
                    String readLine = bufferedReader.readLine();
                    if (readLine == null) {
                        break;
                    } else {
                        sb.append(readLine);
                    }
                }
                if (sb.toString().indexOf("ANDROID:OK") != -1 && this.a.equals("A")) {
                    getSharedPreferences("sh", 0).edit().putBoolean("SENT_TOKEN_TO_SERVER", true).apply();
                }
                httpURLConnection.disconnect();
            } catch (Exception unused) {
                httpURLConnection2 = httpURLConnection;
                if (httpURLConnection2 != null) {
                    httpURLConnection2.disconnect();
                }
            } catch (Throwable th2) {
                th = th2;
                if (httpURLConnection != null) {
                    httpURLConnection.disconnect();
                }
                throw th;
            }
        } catch (Exception unused2) {
        } catch (Throwable th3) {
            th = th3;
            httpURLConnection = null;
        }
    }

    @Override
    protected void onHandleIntent(Intent intent) {
        SharedPreferences sharedPreferences = getSharedPreferences("sh", 0);
        long j = sharedPreferences.getLong("idusu", 0L);
        this.b = j;
        if (j > 0) {
            try {
                a(FirebaseInstanceId.a().b());
            } catch (Exception unused) {
                sharedPreferences.edit().putBoolean("SENT_TOKEN_TO_SERVER", false).apply();
            }
        }
    }
}