Autre Réception de data

BlueDream

Administrateur
Membre du personnel
Inscrit
8 Decembre 2012
Messages
2 010
Reactions
150
#1
Bonsoir,

j'essaye de décrypter les data que je reçois sur un serveur. En fait c'est un serveur qui m'envoi une adresse IP.
L'ip que l'on m'envoi varie a chaque connexion.

Cela fait 3 jours que j'essaye de décrypter sa, de passer d'hexa en décimal en binaire enfin bref.

Donc en fait je suis sencé trouver cet ip "23.21.184.209" parmi un des 5/6 packets que je recois.
Si quelqu'un peut me donner un coup de main parce que je sèche la.

Voici mes logs wireshark:

Les logs sont long mais il faut faire un filtre de cette IP "173.194.66.95" celle qui m'envoi le fameuse IP que je souhaite récupérer. PS : Voici la commande sur wireshark pour faire un filtre de cette adresse Ip
Code:
ip.addr == 173.194.66.95
Ce serait honorable a la personne qui le souhaite de me donner un peu de son temps car je suis au bout du rouleau :ugeek:

Bonne soirée
 

Lakh92

Membre Actif
Inscrit
24 Decembre 2009
Messages
118
Reactions
0
#2
Il me semble que tu ne peux pas, puisque tout est crypté.
 

BlueDream

Administrateur
Membre du personnel
Inscrit
8 Decembre 2012
Messages
2 010
Reactions
150
#3
En fait c'est une application sous android qui se connecte a un serveur. Mais l'ip du serveur en question change a chaque fois. A chaque fois que l'application se lance un autre processus lance une connexion vers un autre serveur, je pense que c'est se serveur qui indique a l'application sur quel ip se connecter. Ou si ca se trouve je fais fausse route et c'est tout simplement la connexion au play store. Ou peut etre même que c'est le play store qui envoi l'ip.

Enfin bon, l'application se connecte a chaque sur une ip differente donc cette ip ne tombe pas du ciel.

J'utilise un emulateur android sur mon pc et je sniffe avec wireshark.
 

Lakh92

Membre Actif
Inscrit
24 Decembre 2009
Messages
118
Reactions
0
#4
Je comprends bien la situation, et ça ne change rien à mon message. Dans l'extrait que tu as fourni, tout ce qui est reçu venant de 173.194.66.95 est crypté. Wireshark ne t'aidera pas, je pense.
 

Gohu

Membre Actif
Inscrit
16 Novembre 2013
Messages
222
Reactions
2
#5
Pas moyen de recup les sources du jeu en question?
 

BlueDream

Administrateur
Membre du personnel
Inscrit
8 Decembre 2012
Messages
2 010
Reactions
150
#6
Bonsoir,

@Lakh92, oui c'est vrai que cela ne change pas grand chose.

@Gohu, oui cependant je n'arrive pas a trouver grand chose de concret.

http://speedy.sh/3BGjz/com.supercell.clashofclans.apk

Voici le fichier APK original de l'application. Le jeu est Clash of clans ( Version 6.108.5 ).
Personnellement je l'ai ouvert en changeant simplement l'extension en .rar.
Peut être que c'est pour cela que je ne trouve pas grand chose ?

Merci pour vos réponses.
 

Kyu

Staff
Membre du personnel
Inscrit
4 Octobre 2009
Messages
327
Reactions
8
#7
Un fichier apk est une archive compressé comme pour un jar, mais au lieu de contenir les classes sous format bytecode, c'est sous format dex, interprété par la vm dalvik d'android. Donc pour les sources en claire comme dofus, tu peux oublier.
 

Sorrow

Membre Actif
Inscrit
5 Mai 2012
Messages
376
Reactions
26
#8
Utilise dans un 1er temps apktool pour décompiler le fichier apk
http://forum.xda-developers.com/showthr ... ?t=2251719

(tu peut également utillise le desassembler IDA Pro (6.1) mais tu n'auras pas les sources)

Il semblerez que la seul fonction de decrypt soit "com.mobileapptracker.Encryption.decrypt"
Il faut donc voir qui s'en sert, à partir de là il sera plus simple de déterminé quel type d'encryption il s'agit et également récupérer la clé.
 

BlueDream

Administrateur
Membre du personnel
Inscrit
8 Decembre 2012
Messages
2 010
Reactions
150
#9
Merci je vais voir cela.
 

Kyu

Staff
Membre du personnel
Inscrit
4 Octobre 2009
Messages
327
Reactions
8
#10
Les parties éventuellement intéressantes :

Code:
package com.supercell.titan;

import android.os.Handler;
import android.os.Message;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.UnknownHostException;
import java.security.KeyStore;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.HttpVersion;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.conn.ConnectTimeoutException;
import org.apache.http.conn.scheme.PlainSocketFactory;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.conn.ssl.SSLSocketFactory;
import org.apache.http.entity.ByteArrayEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;
import org.apache.http.params.HttpProtocolParams;

// Referenced classes of package com.supercell.titan:
//            cc, t, GameApp, cb

public final class ca
    implements Runnable
{

    public int a;
    private String b;
    private String c;
    private final String d;
    private cb e;
    private Handler f;
    private byte g[];
    private cc h;
    private byte i[];
    private HttpClient j;
    private final String k;

    public ca()
    {
        this(new Handler(), "", "");
    }

    public ca(Handler handler, String s, String s1)
    {
        b = "";
        c = "";
        h = cc.b;
        f = handler;
        d = s;
        k = s1;
    }

    private static byte[] a(File file)
    {
        MessageDigest messagedigest;
        FileInputStream fileinputstream;
        byte abyte0[];
        int l;
        try
        {
            messagedigest = MessageDigest.getInstance("SHA-1");
        }
        catch (NoSuchAlgorithmException nosuchalgorithmexception)
        {
            return null;
        }
        fileinputstream = new FileInputStream(file);
        abyte0 = new byte[8192];
        l = 0;
        do
        {
            if (l == -1)
            {
                break;
            }
            l = fileinputstream.read(abyte0);
            if (l > 0)
            {
                messagedigest.update(abyte0, 0, l);
            }
        } while (true);
        fileinputstream.close();
        return messagedigest.digest();
    }

    private static byte[] a(InputStream inputstream)
    {
        if (inputstream instanceof ByteArrayInputStream)
        {
            int i1 = inputstream.available();
            byte abyte1[] = new byte[i1];
            inputstream.read(abyte1, 0, i1);
            return abyte1;
        }
        ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
        byte abyte0[] = new byte[1024];
        do
        {
            int l = inputstream.read(abyte0, 0, 1024);
            if (l != -1)
            {
                bytearrayoutputstream.write(abyte0, 0, l);
            } else
            {
                return bytearrayoutputstream.toByteArray();
            }
        } while (true);
    }

    private static DefaultHttpClient d()
    {
        BasicHttpParams basichttpparams = new BasicHttpParams();
        HttpProtocolParams.setVersion(basichttpparams, HttpVersion.HTTP_1_1);
        HttpProtocolParams.setContentCharset(basichttpparams, "utf-8");
        basichttpparams.setBooleanParameter("http.protocol.expect-continue", false);
        SchemeRegistry schemeregistry = new SchemeRegistry();
        schemeregistry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
        try
        {
            KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType());
            keystore.load(null, null);
            t t1 = new t(keystore);
            t1.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
            schemeregistry.register(new Scheme("https", t1, 443));
        }
        catch (Exception exception)
        {
            GameApp.debuggerException(exception);
            return null;
        }
        return new DefaultHttpClient(new ThreadSafeClientConnManager(basichttpparams, schemeregistry), basichttpparams);
    }

    public final cc a()
    {
        return h;
    }

    public final void a(String s, String s1)
    {
        e = cb.a;
        b = s;
        g = null;
        c = s1;
    }

    public final void a(String s, byte abyte0[], String s1)
    {
        e = cb.b;
        b = s;
        g = abyte0;
        c = s1;
    }

    public final cb b()
    {
        return e;
    }

    public final byte[] c()
    {
        return i;
    }

    public final void run()
    {
        boolean flag;
        flag = true;
        h = cc.c;
        j = d();
        HttpConnectionParams.setConnectionTimeout(j.getParams(), 15000);
        if (e != cb.a) goto _L2; else goto _L1
_L1:
        HttpGet httpget = new HttpGet(b);
        InputStream inputstream = j.execute(httpget).getEntity().getContent();
        if (!k.isEmpty()) goto _L4; else goto _L3
_L3:
        i = a(inputstream);
        boolean flag1 = flag;
_L8:
        Message message;
        Exception exception;
        ClientProtocolException clientprotocolexception;
        File file;
        FileOutputStream fileoutputstream;
        Exception exception1;
        byte abyte0[];
        int l;
        boolean flag2;
        boolean flag3;
        Exception exception2;
        byte abyte1[];
        StringBuilder stringbuilder;
        int i1;
        int j1;
        if (flag1)
        {
            h = cc.d;
        } else
        {
            h = cc.e;
        }
_L16:
        message = new Message();
        message.obj = this;
        f.sendMessage(message);
        return;
_L4:
        file = File.createTempFile("download", ".tmp", GameApp.getInstance().getCacheDir());
        fileoutputstream = new FileOutputStream(file);
        abyte0 = new byte[1024];
_L7:
        l = inputstream.read(abyte0, 0, 1024);
        if (l == -1) goto _L6; else goto _L5
_L5:
        fileoutputstream.write(abyte0, 0, l);
          goto _L7
        exception1;
_L18:
        if (fileoutputstream == null)
        {
            break MISSING_BLOCK_LABEL_214;
        }
        fileoutputstream.close();
        throw exception1;
        clientprotocolexception;
        GameApp.debuggerException(clientprotocolexception);
        flag1 = false;
          goto _L8
_L6:
        fileoutputstream.close();
        flag2 = d.isEmpty();
        if (flag2)
        {
            break MISSING_BLOCK_LABEL_414;
        }
        abyte1 = a(file);
        if (abyte1 != null) goto _L10; else goto _L9
_L9:
        flag3 = flag;
_L13:
        if (!flag3)
        {
            break MISSING_BLOCK_LABEL_288;
        }
        UnknownHostException unknownhostexception;
        IOException ioexception;
        UnknownHostException unknownhostexception1;
        UnknownHostException unknownhostexception2;
        HttpPost httppost;
        ConnectTimeoutException connecttimeoutexception;
        boolean flag4;
        UnknownHostException unknownhostexception3;
        IOException ioexception1;
        Exception exception3;
        ClientProtocolException clientprotocolexception1;
        if (file.renameTo(new File(k)))
        {
            flag = false;
        }
        if (!flag)
        {
            break MISSING_BLOCK_LABEL_298;
        }
        file.delete();
        flag1 = flag3;
          goto _L8
_L10:
        stringbuilder = new StringBuilder();
        i1 = abyte1.length;
        j1 = 0;
_L12:
        if (j1 >= i1)
        {
            break; /* Loop/switch isn't completed */
        }
        byte byte0 = abyte1[j1];
        Object aobj[] = new Object[1];
        aobj[0] = Integer.valueOf(byte0 & 0xff);
        stringbuilder.append(String.format("%02x", aobj));
        j1++;
        if (true) goto _L12; else goto _L11
_L11:
        if (!stringbuilder.toString().equalsIgnoreCase(d))
        {
            break MISSING_BLOCK_LABEL_396;
        }
        flag3 = flag;
          goto _L13
        k;
        flag3 = false;
          goto _L13
        exception2;
        GameApp.debuggerException(exception2);
        flag3 = flag;
          goto _L13
        exception;
        GameApp.debuggerException(exception);
        flag1 = false;
          goto _L8
_L2:
        if (e != cb.b) goto _L15; else goto _L14
_L14:
        httppost = new HttpPost(b);
        httppost.setEntity(new ByteArrayEntity(g));
        httppost.setHeader("Content-Type", "application/x-www-form-urlencoded");
        httppost.setHeader("X-timestamp", c);
        i = a(j.execute(httppost).getEntity().getContent());
        flag4 = flag;
_L17:
        if (flag4)
        {
            h = cc.d;
        } else
        {
            h = cc.e;
        }
          goto _L16
        clientprotocolexception1;
        GameApp.debuggerException(clientprotocolexception1);
        flag4 = false;
          goto _L17
        exception3;
        GameApp.debuggerException(exception3);
        flag4 = false;
          goto _L17
_L15:
        h = cc.e;
          goto _L16
        ioexception1;
        flag4 = false;
          goto _L17
        unknownhostexception3;
        flag4 = false;
          goto _L17
        connecttimeoutexception;
        flag4 = false;
          goto _L17
        ioexception;
        flag1 = false;
          goto _L8
        unknownhostexception;
        flag1 = false;
          goto _L8
        unknownhostexception1;
        flag1 = flag;
          goto _L8
        unknownhostexception2;
        flag1 = flag3;
          goto _L8
        exception1;
        fileoutputstream = null;
          goto _L18
    }
}
Code:
package com.supercell.titan;

import android.content.Context;
import android.content.SharedPreferences;
import android.util.Base64;
import java.io.UnsupportedEncodingException;
import java.security.GeneralSecurityException;
import java.security.MessageDigest;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;

// Referenced classes of package com.supercell.titan:
//            GameApp, co

public final class cn
{

    private final boolean a;
    private final Cipher b;
    private final Cipher c;
    private final Cipher d;
    private final Cipher e;
    private final SharedPreferences f;

    public cn(Context context, String s, String s1)
    {
        try
        {
            b = Cipher.getInstance("AES/CBC/PKCS5Padding");
            c = Cipher.getInstance("AES/CBC/PKCS5Padding");
            d = Cipher.getInstance("AES/ECB/PKCS5Padding");
            e = Cipher.getInstance("AES/ECB/PKCS5Padding");
            byte abyte0[] = new byte[b.getBlockSize()];
            System.arraycopy("fldsjfodasjifudslfjdsaofshaufihadsf".getBytes(), 0, abyte0, 0, b.getBlockSize());
            IvParameterSpec ivparameterspec = new IvParameterSpec(abyte0);
            MessageDigest messagedigest = MessageDigest.getInstance("SHA-256");
            messagedigest.reset();
            SecretKeySpec secretkeyspec = new SecretKeySpec(messagedigest.digest(s1.getBytes("UTF-8")), "AES/CBC/PKCS5Padding");
            b.init(1, secretkeyspec, ivparameterspec);
            c.init(2, secretkeyspec, ivparameterspec);
            d.init(1, secretkeyspec);
            e.init(2, secretkeyspec);
            f = context.getSharedPreferences(s, 0);
            a = true;
            return;
        }
        catch (GeneralSecurityException generalsecurityexception)
        {
            GameApp.debuggerException(generalsecurityexception);
            throw new co(generalsecurityexception);
        }
        catch (UnsupportedEncodingException unsupportedencodingexception)
        {
            GameApp.debuggerException(unsupportedencodingexception);
            throw new co(unsupportedencodingexception);
        }
    }

    private static String a(String s, Cipher cipher)
    {
        byte abyte0[];
        try
        {
            abyte0 = a(cipher, s.getBytes("UTF-8"));
        }
        catch (UnsupportedEncodingException unsupportedencodingexception)
        {
            GameApp.debuggerException(unsupportedencodingexception);
            throw new co(unsupportedencodingexception);
        }
        return Base64.encodeToString(abyte0, 2);
    }

    private static byte[] a(Cipher cipher, byte abyte0[])
    {
        byte abyte1[];
        try
        {
            abyte1 = cipher.doFinal(abyte0);
        }
        catch (Exception exception)
        {
            GameApp.debuggerException(exception);
            throw new co(exception);
        }
        return abyte1;
    }

    private static String b(String s, Cipher cipher)
    {
        byte abyte0[] = Base64.decode(s, 2);
        byte abyte1[];
        String s1;
        try
        {
            abyte1 = a(cipher, abyte0);
        }
        catch (co co1)
        {
            GameApp.debuggerException(co1);
            return "";
        }
        try
        {
            s1 = new String(abyte1, "UTF-8");
        }
        catch (UnsupportedEncodingException unsupportedencodingexception)
        {
            GameApp.debuggerException(unsupportedencodingexception);
            return "";
        }
        return s1;
    }

    private String c(String s)
    {
        if (a)
        {
            s = a(s, d);
        }
        return s;
    }

    public final void a(String s)
    {
        String s1 = c(s);
        if (f.contains(s1))
        {
            f.edit().remove(s1).apply();
        }
    }

    public final void a(String s, String s1)
    {
        String s2 = c(s);
        if (s1 == null || s1.isEmpty())
        {
            if (f.contains(s2))
            {
                f.edit().remove(s2).apply();
            }
            return;
        } else
        {
            String s3 = a(s1, b);
            f.edit().putString(s2, s3).apply();
            return;
        }
    }

    public final String b(String s)
    {
        String s1 = c(s);
        if (f.contains(s1))
        {
            String s2 = b(f.getString(s1, ""), c);
            if (s2.isEmpty())
            {
                f.edit().remove(s1).apply();
            }
            return s2;
        } else
        {
            return "";
        }
    }
}
 

BlueDream

Administrateur
Membre du personnel
Inscrit
8 Decembre 2012
Messages
2 010
Reactions
150
#11
Pourrais-tu m'envoyer les sources ?
Le temps que Android SDK se télécharge.
 

BlueDream

Administrateur
Membre du personnel
Inscrit
8 Decembre 2012
Messages
2 010
Reactions
150
#12
Bon Jones m'a envoyé les sources. Je cherche partout mais je ne vois aucun fichier qui se connecte sur l'ip que je vous ai envoyé. j'ai peur de partir sur une mauvaise piste.
 

Sorrow

Membre Actif
Inscrit
5 Mai 2012
Messages
376
Reactions
26
#13
peut-être parceque c'est un nom de domaine ?
 

BlueDream

Administrateur
Membre du personnel
Inscrit
8 Decembre 2012
Messages
2 010
Reactions
150
#14
Code:
RESULTS FOUND: 3

-------------
Lookup results for 173.194.66.95 from whois.lacnic.net server:

NetRange:       173.194.0.0 - 173.194.255.255
CIDR:           173.194.0.0/16
OriginAS:       AS15169
NetName:        GOOGLE
NetHandle:      NET-173-194-0-0-1
Parent:         NET-173-0-0-0-0
NetType:        Direct Allocation
RegDate:        2009-08-17
Updated:        2012-02-24
Ref:            http://whois.arin.net/rest/net/NET-173-194-0-0-1
OrgName:        Google Inc.
OrgId:          GOGL
Address:        1600 Amphitheatre Parkway
City:           Mountain View
StateProv:      CA
PostalCode:     94043
Country:        US
RegDate:        2000-03-30
Updated:        2013-08-07
Ref:            http://whois.arin.net/rest/org/GOGL
OrgAbuseHandle: ZG39-ARIN
OrgAbuseName:   Google Inc
OrgAbusePhone:  +1-650-253-0000
OrgAbuseEmail:  [email protected]
OrgAbuseRef:    http://whois.arin.net/rest/poc/ZG39-ARIN
OrgTechHandle: ZG39-ARIN
OrgTechName:   Google Inc
OrgTechPhone:  +1-650-253-0000
OrgTechEmail:  [email protected]
OrgTechRef:    http://whois.arin.net/rest/poc/ZG39-ARIN


-------------
Lookup results for 173.194.66.95 from whois.arin.net server:

NetRange:       173.194.0.0 - 173.194.255.255
CIDR:           173.194.0.0/16
OriginAS:       AS15169
NetName:        GOOGLE
NetHandle:      NET-173-194-0-0-1
Parent:         NET-173-0-0-0-0
NetType:        Direct Allocation
RegDate:        2009-08-17
Updated:        2012-02-24
Ref:            http://whois.arin.net/rest/net/NET-173-194-0-0-1
OrgName:        Google Inc.
OrgId:          GOGL
Address:        1600 Amphitheatre Parkway
City:           Mountain View
StateProv:      CA
PostalCode:     94043
Country:        US
RegDate:        2000-03-30
Updated:        2013-08-07
Ref:            http://whois.arin.net/rest/org/GOGL
OrgTechHandle: ZG39-ARIN
OrgTechName:   Google Inc
OrgTechPhone:  +1-650-253-0000
OrgTechEmail:  [email protected]
OrgTechRef:    http://whois.arin.net/rest/poc/ZG39-ARIN
OrgAbuseHandle: ZG39-ARIN
OrgAbuseName:   Google Inc
OrgAbusePhone:  +1-650-253-0000
OrgAbuseEmail:  [email protected]
OrgAbuseRef:    http://whois.arin.net/rest/poc/ZG39-ARIN


-------------
Lookup results for 173.194.66.95 from whois.ripe.net server:

inetnum:        0.0.0.0 - 255.255.255.255
netname:        IANA-BLK
descr:          The whole IPv4 address space
country:        EU # Country field is actually all countries in the world and not just EU countries
org:            ORG-IANA1-RIPE
admin-c:        IANA1-RIPE
tech-c:         IANA1-RIPE
status:         ALLOCATED UNSPECIFIED
remarks:        This object represents all IPv4 addresses.
remarks:        If you see this object as a result of a single IP query, it
remarks:        means that the IP address you are querying is not managed by
remarks:        the RIPE NCC but by one of the other five RIRs. It might
remarks:        also be an address that has been reserved by the IETF as part
remarks:        of a protocol or test range.
remarks:        You can find the whois server to query, or the
remarks:        IANA registry to query on this web page:
remarks:        http://www.iana.org/assignments/ipv4-address-space/ipv4-address-space.xml
mnt-by:         RIPE-NCC-HM-MNT
mnt-lower:      RIPE-NCC-HM-MNT
mnt-routes:     RIPE-NCC-RPSL-MNT
source:         RIPE # Filtered
organisation:   ORG-IANA1-RIPE
org-name:       Internet Assigned Numbers Authority
org-type:       IANA
address:        see http://www.iana.org
remarks:        The IANA allocates IP addresses and AS number blocks to RIRs
remarks:        see http://www.iana.org/numbers
admin-c:        IANA1-RIPE
tech-c:         IANA1-RIPE
mnt-ref:        RIPE-NCC-HM-MNT
mnt-by:         RIPE-NCC-HM-MNT
source:         RIPE # Filtered
role:           Internet Assigned Numbers Authority
address:        see http://www.iana.org.
admin-c:        IANA1-RIPE
tech-c:         IANA1-RIPE
nic-hdl:        IANA1-RIPE
remarks:        For more information on IANA services
remarks:        go to IANA web site at http://www.iana.org.
mnt-by:         RIPE-NCC-MNT
source:         RIPE # Filtered
 

BlueDream

Administrateur
Membre du personnel
Inscrit
8 Decembre 2012
Messages
2 010
Reactions
150
#15
Bon d'après le poste ci-dessus, ce fameuse IP serait donc celui de Google Play. J'espère ne pas devoir moi aussi m'y connecter... Par contre je ne sais toujours pas si cette IP est envoyé par google. Je vais fouiller dans les sources.

EDIT:

j'ai trouvé un fichier très très très intéressant :ugeek:
GoogleServiceClient.java
Code:
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc 

package com.supercell.titan;

import android.app.Dialog;
import android.content.Intent;
import android.os.Bundle;
import com.google.android.gms.common.a;
import com.google.android.gms.common.api.d;
import com.google.android.gms.common.api.f;
import com.google.android.gms.common.api.g;
import com.google.android.gms.common.api.h;
import com.google.android.gms.common.api.i;
import com.google.android.gms.common.api.m;
import com.google.android.gms.common.api.s;
import com.google.android.gms.games.Player;
import com.google.android.gms.games.c;
import com.google.android.gms.games.n;
import com.google.android.gms.internal.ee;
import java.util.Set;

// Referenced classes of package com.supercell.titan:
//            GameApp, ap, ag, ah, 
//            ai, aj, ak, al, 
//            am, an, cf, ao, 
//            af

public class GoogleServiceClient
    implements g, h
{

    private final GameApp a;
    private final d b;
    private volatile boolean c;
    private volatile boolean d;
    private volatile String e;
    private volatile String f;
    private boolean g;

    public GoogleServiceClient(GameApp gameapp)
    {
        e = "";
        f = "";
        a = gameapp;
        f f1 = new f(gameapp);
        f1.a(c.c);
        m m1 = c.b;
        f1.b.add(m1.a);
        f1.i.add(this);
        f1.j.add(this);
        f1.d = gameapp.f();
        s s1 = new s(f1.f, f1.h, new ee(f1.a, f1.b, f1.c, f1.d, f1.e), f1.g, f1.i, f1.j);
        b = s1;
        updateNativeInstance(this);
    }

    static void a(GoogleServiceClient googleserviceclient)
    {
        googleserviceclient.c = false;
        googleserviceclient.e = "";
        googleserviceclient.f = "";
        try
        {
            googleserviceclient.b.b();
        }
        catch (Exception exception)
        {
            GameApp.debuggerException(exception);
        }
        googleserviceclient.a.a(new ap(googleserviceclient));
    }

    public static native void onSignIn();

    public static native void onSignInCanceled();

    public static native void onSignInFailed();

    public static native void onSignOut();

    public static native void updateNativeInstance(GoogleServiceClient googleserviceclient);

    public void connect()
    {
        if (b.d())
        {
            return;
        }
        try
        {
            b.a();
            return;
        }
        catch (Exception exception)
        {
            GameApp.debuggerException(exception);
        }
    }

    public void forNative_signIn(boolean flag)
    {
        a.runOnUiThread(new ag(this, this, flag));
    }

    public void forNative_signOut()
    {
        a.runOnUiThread(new ah(this, this));
    }

    public String getPlayerDisplayName()
    {
        return f;
    }

    public String getPlayerId()
    {
        return e;
    }

    public boolean isAvailable()
    {
        return d;
    }

    public boolean isSignedIn()
    {
        return c;
    }

    public void onActivityResult(int j, int k, Intent intent)
    {
        if (j != 0x10c90a)
        {
            return;
        }
        switch (k)
        {
        default:
            return;

        case -1: 
            onStart();
            return;

        case 0: // '\0'
            a.a(new ai(this));
            return;

        case 10002: 
            a.a(new aj(this));
            return;

        case 10001: 
            a.a(new ak(this));
            return;

        case 10004: 
            a.a(new al(this));
            return;

        case 10003: 
            a.a(new am(this));
            return;
        }
    }

    public void onConnected(Bundle bundle)
    {
        c = true;
        g = false;
        PurchaseManager purchasemanager;
        try
        {
            e = c.m.a(b);
            f = c.m.b(b).c();
        }
        catch (Exception exception)
        {
            GameApp.debuggerException(exception);
        }
        a.a(new an(this));
        purchasemanager = a.b();
        if (purchasemanager instanceof cf)
        {
            ((cf)purchasemanager).g();
        }
    }

    public void onConnectionFailed(a a1)
    {
        if (c)
        {
            a.a(new ao(this));
        }
        c = false;
        if (a1.a() && g)
        {
            g = false;
            try
            {
                a1.a(a);
            }
            catch (android.content.IntentSender.SendIntentException sendintentexception)
            {
                GameApp.debuggerException(sendintentexception);
            }
        }
        a1.b();
    }

    public void onConnectionSuspended(int j)
    {
        c = false;
    }

    public void onStart()
    {
        switch (com.google.android.gms.common.f.a(a.getApplicationContext()))
        {
        default:
            return;

        case 0: // '\0'
            d = true;
            connect();
            return;

        case 1: // '\001'
        case 2: // '\002'
        case 3: // '\003'
            d = false;
            break;
        }
    }

    public void onStop()
    {
        try
        {
            b.b();
            return;
        }
        catch (Exception exception)
        {
            GameApp.debuggerException(exception);
        }
    }

    public void showAchievements()
    {
        if (isSignedIn() && b.c())
        {
            Intent intent = c.g.a(b);
            a.startActivityForResult(intent, 0);
        }
    }

    public void signIn(boolean flag)
    {
        int j = com.google.android.gms.common.f.a(a.getApplicationContext());
        if (j == 0)
        {
            g = true;
            connect();
        } else
        if (flag)
        {
            com.google.android.gms.common.f.a(j, a).show();
            return;
        }
    }

    public void signOut()
    {
        if (!b.c())
        {
            break MISSING_BLOCK_LABEL_32;
        }
        com.google.android.gms.games.c.b(b).a(new af(this));
        return;
        Exception exception;
        exception;
        GameApp.debuggerException(exception);
        return;
    }

    public void unlockAchievement(String s1)
    {
        try
        {
            c.g.a(b, s1);
            return;
        }
        catch (Exception exception)
        {
            GameApp.debuggerException(exception);
        }
    }
}

Exactement ce que je cherchais. Cependant vu la tête du code je vais y passer un moment :?

Code:
public GoogleServiceClient(GameApp gameapp)
    {
        e = "";
        f = "";
        a = gameapp;
        f f1 = new f(gameapp);
        f1.a(c.c);
        m m1 = c.b;
        f1.b.add(m1.a);
        f1.i.add(this);
        f1.j.add(this);
        f1.d = gameapp.f();
        s s1 = new s(f1.f, f1.h, new ee(f1.a, f1.b, f1.c, f1.d, f1.e), f1.g, f1.i, f1.j);
        b = s1;
        updateNativeInstance(this);
    }
 
Haut Bas