ZStore v1.7版本的 MD5 值为:ca9bb200afd8d690876bd39318f8215c
以下内容为反编译后的 UploadActivity.java 源代码,内容仅作参考
package com.zackiestudios.zstore;
import android.animation.TimeInterpolator;
import android.app.ProgressDialog;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.ColorStateList;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.Typeface;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.RippleDrawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.text.Editable;
import android.text.InputFilter;
import android.text.TextWatcher;
import android.transition.AutoTransition;
import android.transition.TransitionManager;
import android.util.SparseBooleanArray;
import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.DecelerateInterpolator;
import android.webkit.ValueCallback;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.ScrollView;
import android.widget.Spinner;
import android.widget.SpinnerAdapter;
import android.widget.Switch;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.cardview.widget.CardView;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import com.applovin.mediation.MaxAd;
import com.applovin.mediation.MaxError;
import com.applovin.mediation.MaxReward;
import com.applovin.mediation.MaxRewardedAdListener;
import com.applovin.mediation.ads.MaxInterstitialAd;
import com.applovin.mediation.ads.MaxRewardedAd;
import com.google.android.gms.tasks.Continuation;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.android.gms.tasks.Task;
import com.google.android.material.textfield.TextInputLayout;
import com.google.firebase.FirebaseApp;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.ChildEventListener;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.GenericTypeIndicator;
import com.google.firebase.database.core.ServerValues;
import com.google.firebase.storage.FileDownloadTask;
import com.google.firebase.storage.FirebaseStorage;
import com.google.firebase.storage.OnProgressListener;
import com.google.firebase.storage.StorageReference;
import com.google.firebase.storage.UploadTask;
import com.zackiestudios.zstore.RequestNetwork;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Random;
import java.util.Timer;
import java.util.TimerTask;
public class UploadActivity extends AppCompatActivity {
private static final int FILECHOOSER_RESULTCODE = 1;
public static final int REQUEST_SELECT_FILE = 100;
private EditText Inter;
private EditText Rewarded1;
private ChildEventListener _Ads_child_listener;
private ChildEventListener _Users_child_listener;
private OnCompleteListener<AuthResult> _auth_create_user_listener;
private OnCompleteListener<Void> _auth_reset_password_listener;
private OnCompleteListener<AuthResult> _auth_sign_in_listener;
private OnSuccessListener _icon_delete_success_listener;
private OnProgressListener _icon_download_progress_listener;
private OnSuccessListener<FileDownloadTask.TaskSnapshot> _icon_download_success_listener;
private OnFailureListener _icon_failure_listener;
private OnProgressListener _icon_upload_progress_listener;
private OnCompleteListener<Uri> _icon_upload_success_listener;
private ChildEventListener _notification_child_listener;
private ChildEventListener _project_child_listener;
private RequestNetwork.RequestListener _rn_request_listener;
private OnSuccessListener _screenshot1_delete_success_listener;
private OnProgressListener _screenshot1_download_progress_listener;
private OnSuccessListener<FileDownloadTask.TaskSnapshot> _screenshot1_download_success_listener;
private OnFailureListener _screenshot1_failure_listener;
private OnProgressListener _screenshot1_upload_progress_listener;
private OnCompleteListener<Uri> _screenshot1_upload_success_listener;
private OnSuccessListener _screenshot2_delete_success_listener;
private OnProgressListener _screenshot2_download_progress_listener;
private OnSuccessListener<FileDownloadTask.TaskSnapshot> _screenshot2_download_success_listener;
private OnFailureListener _screenshot2_failure_listener;
private OnProgressListener _screenshot2_upload_progress_listener;
private OnCompleteListener<Uri> _screenshot2_upload_success_listener;
private OnSuccessListener _screenshot3_delete_success_listener;
private OnProgressListener _screenshot3_download_progress_listener;
private OnSuccessListener<FileDownloadTask.TaskSnapshot> _screenshot3_download_success_listener;
private OnFailureListener _screenshot3_failure_listener;
private OnProgressListener _screenshot3_upload_progress_listener;
private OnCompleteListener<Uri> _screenshot3_upload_success_listener;
private OnSuccessListener _screenshot4_delete_success_listener;
private OnProgressListener _screenshot4_download_progress_listener;
private OnSuccessListener<FileDownloadTask.TaskSnapshot> _screenshot4_download_success_listener;
private OnFailureListener _screenshot4_failure_listener;
private OnProgressListener _screenshot4_upload_progress_listener;
private OnCompleteListener<Uri> _screenshot4_upload_success_listener;
private OnSuccessListener _screenshot5_delete_success_listener;
private OnProgressListener _screenshot5_download_progress_listener;
private OnSuccessListener<FileDownloadTask.TaskSnapshot> _screenshot5_download_success_listener;
private OnFailureListener _screenshot5_failure_listener;
private OnProgressListener _screenshot5_upload_progress_listener;
private OnCompleteListener<Uri> _screenshot5_upload_success_listener;
private OnSuccessListener _screenshot6_delete_success_listener;
private OnProgressListener _screenshot6_download_progress_listener;
private OnSuccessListener<FileDownloadTask.TaskSnapshot> _screenshot6_download_success_listener;
private OnFailureListener _screenshot6_failure_listener;
private OnProgressListener _screenshot6_upload_progress_listener;
private OnCompleteListener<Uri> _screenshot6_upload_success_listener;
private FirebaseAuth auth;
private OnCompleteListener<Void> auth_deleteUserListener;
private OnCompleteListener<Void> auth_emailVerificationSentListener;
private OnCompleteListener<AuthResult> auth_googleSignInListener;
private OnCompleteListener<AuthResult> auth_phoneAuthListener;
private OnCompleteListener<Void> auth_updateEmailListener;
private OnCompleteListener<Void> auth_updatePasswordListener;
private OnCompleteListener<Void> auth_updateProfileListener;
private CardView cardview1;
private CardView cardview2;
private TimerTask checkRes;
private ProgressDialog coreprog;
private TextView dc_limit;
private EditText description;
private EditText download_url;
private ImageView imageview1;
private ImageView imageview14;
private ImageView imageview15;
private ImageView imageview16;
private ImageView imageview17;
private ImageView imageview2;
private ImageView imageview20;
private ImageView imageview24;
private ImageView imageview25;
private ImageView imageview26;
private ImageView imageview28;
private ImageView imageview4;
private ImageView imageview5;
private ImageView img_icon;
MaxInterstitialAd inter1;
private LinearLayout linear1;
private LinearLayout linear11;
private LinearLayout linear15;
private LinearLayout linear19;
private LinearLayout linear20;
private LinearLayout linear21;
private LinearLayout linear22;
private LinearLayout linear24;
private LinearLayout linear4;
private LinearLayout linear_base;
private ValueCallback<Uri> mUploadMessage;
MaxRewardedAd rewarded;
private RequestNetwork rn;
private LinearLayout scr1;
private LinearLayout scr2;
private LinearLayout scr3;
private LinearLayout scr4;
private LinearLayout scr5;
private LinearLayout scr6;
private ImageView screenshot__1;
private ImageView screenshot__2;
private ImageView screenshot__3;
private ImageView screenshot__4;
private ImageView screenshot__5;
private ImageView screenshot__6;
private EditText size;
private Spinner spinner1;
private Switch switch_comment;
private TextInputLayout textinputlayout_description;
private TextInputLayout textinputlayout_downloadurl;
private TextInputLayout textinputlayout_size;
private TextInputLayout textinputlayout_title;
private TextInputLayout textinputlayout_yt_url;
private TextView textview1;
private TextView textview10;
private TextView textview12;
private TextView textview14;
private TextView textview15;
private TextView textview16;
private TextView textview17;
private TextView textview18;
private TextView textview20;
private TextView textview21;
private TextView textview23;
private TextView textview26;
private TextView textview29;
private TextView textview3;
private EditText title;
private TextView title_limit;
private LinearLayout toolbar;
public ValueCallback<Uri[]> uploadMessage;
private SharedPreferences users;
private ScrollView vscroll1;
private WebView webview1;
private TextView yt_limit;
private EditText yt_url;
public final int REQ_CD_ICONN = 101;
public final int REQ_CD_S1 = 102;
public final int REQ_CD_S2 = 103;
public final int REQ_CD_S3 = 104;
public final int REQ_CD_S4 = 105;
public final int REQ_CD_S5 = 106;
public final int REQ_CD_S6 = 107;
public final int REQ_CD_PROJECT_PICK = 108;
private Timer _timer = new Timer();
private FirebaseDatabase _firebase = FirebaseDatabase.getInstance();
private FirebaseStorage _firebase_storage = FirebaseStorage.getInstance();
private String premium_key = "";
private HashMap<String, Object> data_map = new HashMap<>();
private String icon_path = "";
private String categories = "";
private String screenshot_1 = "";
private String screenshot_2 = "";
private String screenshot_3 = "";
private String screenshot_4 = "";
private String screenshot_5 = "";
private String screenshot_6 = "";
private String total_projects = "";
private String notification_key = "";
private String normal_key = "";
private String sc1 = "";
private String sc2 = "";
private String sc3 = "";
private String sc4 = "";
private String sc5 = "";
private String sc6 = "";
private String fileUrl = "";
private boolean isFinding = false;
private double file_sizes = 0.0d;
private String uid = "";
private String key = "";
private String total_download = "";
private String total_like = "";
private String Date = "";
private String Like = "";
private String Comment = "";
private String Reward = "";
private String Interstitial = "";
private ArrayList<String> spinner_data = new ArrayList<>();
private DatabaseReference project = this._firebase.getReference("projects/normal");
private DatabaseReference Users = this._firebase.getReference("Users");
private StorageReference screenshot1 = this._firebase_storage.getReference("screenshots/screenshot1");
private StorageReference screenshot2 = this._firebase_storage.getReference("screenshots/screenshot2");
private StorageReference screenshot3 = this._firebase_storage.getReference("screenshots/screenshot3");
private StorageReference screenshot4 = this._firebase_storage.getReference("screenshots/screenshot4");
private StorageReference screenshot5 = this._firebase_storage.getReference("screenshots/screenshot5");
private StorageReference screenshot6 = this._firebase_storage.getReference("screenshots/screenshot6");
private StorageReference icon = this._firebase_storage.getReference("icon");
private Calendar c = Calendar.getInstance();
private Intent iconn = new Intent("android.intent.action.GET_CONTENT");
private Intent s1 = new Intent("android.intent.action.GET_CONTENT");
private Intent s2 = new Intent("android.intent.action.GET_CONTENT");
private Intent s3 = new Intent("android.intent.action.GET_CONTENT");
private Intent s4 = new Intent("android.intent.action.GET_CONTENT");
private Intent s5 = new Intent("android.intent.action.GET_CONTENT");
private Intent s6 = new Intent("android.intent.action.GET_CONTENT");
private Intent project_pick = new Intent("android.intent.action.GET_CONTENT");
private DatabaseReference notification = this._firebase.getReference("other/notification");
private DatabaseReference Ads = this._firebase.getReference("Net");
public void _wbuExtra() {
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.upload);
initialize(bundle);
FirebaseApp.initializeApp(this);
if (ContextCompat.checkSelfPermission(this, "android.permission.READ_EXTERNAL_STORAGE") == -1 || ContextCompat.checkSelfPermission(this, "android.permission.WRITE_EXTERNAL_STORAGE") == -1) {
ActivityCompat.requestPermissions(this, new String[]{"android.permission.READ_EXTERNAL_STORAGE", "android.permission.WRITE_EXTERNAL_STORAGE"}, 1000);
} else {
initializeLogic();
}
}
@Override
public void onRequestPermissionsResult(int i, String[] strArr, int[] iArr) {
super.onRequestPermissionsResult(i, strArr, iArr);
if (i == 1000) {
initializeLogic();
}
}
private void initialize(Bundle bundle) {
this.linear_base = (LinearLayout) findViewById(R.id.linear_base);
this.cardview1 = (CardView) findViewById(R.id.cardview1);
this.vscroll1 = (ScrollView) findViewById(R.id.vscroll1);
this.toolbar = (LinearLayout) findViewById(R.id.toolbar);
this.imageview1 = (ImageView) findViewById(R.id.imageview1);
this.linear24 = (LinearLayout) findViewById(R.id.linear24);
this.imageview2 = (ImageView) findViewById(R.id.imageview2);
this.Rewarded1 = (EditText) findViewById(R.id.Rewarded1);
this.linear1 = (LinearLayout) findViewById(R.id.linear1);
this.Inter = (EditText) findViewById(R.id.Inter);
this.textview1 = (TextView) findViewById(R.id.textview1);
this.linear11 = (LinearLayout) findViewById(R.id.linear11);
this.textinputlayout_title = (TextInputLayout) findViewById(R.id.textinputlayout_title);
this.title_limit = (TextView) findViewById(R.id.title_limit);
this.textinputlayout_description = (TextInputLayout) findViewById(R.id.textinputlayout_description);
this.dc_limit = (TextView) findViewById(R.id.dc_limit);
this.textinputlayout_yt_url = (TextInputLayout) findViewById(R.id.textinputlayout_yt_url);
this.yt_limit = (TextView) findViewById(R.id.yt_limit);
this.textinputlayout_size = (TextInputLayout) findViewById(R.id.textinputlayout_size);
this.textview3 = (TextView) findViewById(R.id.textview3);
this.linear19 = (LinearLayout) findViewById(R.id.linear19);
this.textview23 = (TextView) findViewById(R.id.textview23);
this.linear20 = (LinearLayout) findViewById(R.id.linear20);
this.textinputlayout_downloadurl = (TextInputLayout) findViewById(R.id.textinputlayout_downloadurl);
this.linear22 = (LinearLayout) findViewById(R.id.linear22);
WebView webView = (WebView) findViewById(R.id.webview1);
this.webview1 = webView;
webView.getSettings().setJavaScriptEnabled(true);
this.webview1.getSettings().setSupportZoom(true);
this.linear21 = (LinearLayout) findViewById(R.id.linear21);
this.cardview2 = (CardView) findViewById(R.id.cardview2);
this.textview29 = (TextView) findViewById(R.id.textview29);
this.img_icon = (ImageView) findViewById(R.id.img_icon);
this.title = (EditText) findViewById(R.id.title);
this.description = (EditText) findViewById(R.id.description);
this.yt_url = (EditText) findViewById(R.id.yt_url);
this.size = (EditText) findViewById(R.id.size);
this.scr1 = (LinearLayout) findViewById(R.id.scr1);
this.scr2 = (LinearLayout) findViewById(R.id.scr2);
this.scr3 = (LinearLayout) findViewById(R.id.scr3);
this.scr4 = (LinearLayout) findViewById(R.id.scr4);
this.scr5 = (LinearLayout) findViewById(R.id.scr5);
this.scr6 = (LinearLayout) findViewById(R.id.scr6);
this.linear4 = (LinearLayout) findViewById(R.id.linear4);
this.screenshot__1 = (ImageView) findViewById(R.id.screenshot__1);
this.textview15 = (TextView) findViewById(R.id.textview15);
this.imageview14 = (ImageView) findViewById(R.id.imageview14);
this.screenshot__2 = (ImageView) findViewById(R.id.screenshot__2);
this.textview16 = (TextView) findViewById(R.id.textview16);
this.imageview15 = (ImageView) findViewById(R.id.imageview15);
this.screenshot__3 = (ImageView) findViewById(R.id.screenshot__3);
this.textview17 = (TextView) findViewById(R.id.textview17);
this.imageview16 = (ImageView) findViewById(R.id.imageview16);
this.screenshot__4 = (ImageView) findViewById(R.id.screenshot__4);
this.textview18 = (TextView) findViewById(R.id.textview18);
this.imageview20 = (ImageView) findViewById(R.id.imageview20);
this.screenshot__5 = (ImageView) findViewById(R.id.screenshot__5);
this.textview20 = (TextView) findViewById(R.id.textview20);
this.imageview24 = (ImageView) findViewById(R.id.imageview24);
this.screenshot__6 = (ImageView) findViewById(R.id.screenshot__6);
this.textview26 = (TextView) findViewById(R.id.textview26);
this.imageview28 = (ImageView) findViewById(R.id.imageview28);
this.imageview4 = (ImageView) findViewById(R.id.imageview4);
this.textview10 = (TextView) findViewById(R.id.textview10);
this.imageview5 = (ImageView) findViewById(R.id.imageview5);
this.imageview17 = (ImageView) findViewById(R.id.imageview17);
this.spinner1 = (Spinner) findViewById(R.id.spinner1);
this.download_url = (EditText) findViewById(R.id.download_url);
this.imageview25 = (ImageView) findViewById(R.id.imageview25);
this.textview21 = (TextView) findViewById(R.id.textview21);
this.imageview26 = (ImageView) findViewById(R.id.imageview26);
this.linear15 = (LinearLayout) findViewById(R.id.linear15);
this.switch_comment = (Switch) findViewById(R.id.switch_comment);
this.textview14 = (TextView) findViewById(R.id.textview14);
this.textview12 = (TextView) findViewById(R.id.textview12);
this.iconn.setType("image/*");
this.iconn.putExtra("android.intent.extra.ALLOW_MULTIPLE", true);
this.s1.setType("image/*");
this.s1.putExtra("android.intent.extra.ALLOW_MULTIPLE", true);
this.s2.setType("image/*");
this.s2.putExtra("android.intent.extra.ALLOW_MULTIPLE", true);
this.s3.setType("image/*");
this.s3.putExtra("android.intent.extra.ALLOW_MULTIPLE", true);
this.s4.setType("image/*");
this.s4.putExtra("android.intent.extra.ALLOW_MULTIPLE", true);
this.s5.setType("image/*");
this.s5.putExtra("android.intent.extra.ALLOW_MULTIPLE", true);
this.s6.setType("image/*");
this.s6.putExtra("android.intent.extra.ALLOW_MULTIPLE", true);
this.auth = FirebaseAuth.getInstance();
this.users = getSharedPreferences("users", 0);
this.project_pick.setType("*/*");
this.project_pick.putExtra("android.intent.extra.ALLOW_MULTIPLE", true);
this.rn = new RequestNetwork(this);
this.imageview1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
UploadActivity.this.finish();
}
});
this.imageview2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (!UploadActivity.this.title.getText().toString().trim().equals("")) {
if (!UploadActivity.this.description.getText().toString().trim().equals("")) {
if (!UploadActivity.this.screenshot_1.equals("")) {
if (!UploadActivity.this.categories.equals("Select Category")) {
if (!UploadActivity.this.icon_path.equals("")) {
if (UploadActivity.this.download_url.getText().toString().trim().equals("")) {
SketchwareUtil.showMessage(UploadActivity.this.getApplicationContext(), "Envie o arquivo");
return;
}
UploadActivity.this.c = Calendar.getInstance();
UploadActivity.this.icon.child(new SimpleDateFormat("ddyyhhmmss").format(UploadActivity.this.c.getTime()).concat(".jpg")).putFile(Uri.fromFile(new File(UploadActivity.this.icon_path))).addOnFailureListener(UploadActivity.this._icon_failure_listener).addOnProgressListener(UploadActivity.this._icon_upload_progress_listener).continueWithTask(new Continuation<UploadTask.TaskSnapshot, Task<Uri>>() {
@Override
public Task<Uri> then(Task<UploadTask.TaskSnapshot> task) throws Exception {
return UploadActivity.this.icon.child(new SimpleDateFormat("ddyyhhmmss").format(UploadActivity.this.c.getTime()).concat(".jpg")).getDownloadUrl();
}
}).addOnCompleteListener(UploadActivity.this._icon_upload_success_listener);
return;
}
SketchwareUtil.showMessage(UploadActivity.this.getApplicationContext(), "Envie um ícone");
return;
}
SketchwareUtil.showMessage(UploadActivity.this.getApplicationContext(), "Selecione a Categoria");
return;
}
SketchwareUtil.showMessage(UploadActivity.this.getApplicationContext(), "Enviw pelo menos uma captura de tela");
return;
}
SketchwareUtil.showMessage(UploadActivity.this.getApplicationContext(), "Adicione uma descrição");
return;
}
SketchwareUtil.showMessage(UploadActivity.this.getApplicationContext(), "Adicione o nome do aplicativo");
}
});
this.linear22.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
UploadActivity.this.webview1.loadUrl("javascript:document.getElementById('fileInput').click()");
}
});
this.webview1.setWebViewClient(new WebViewClient() {
@Override
public void onPageStarted(WebView webView2, String str, Bitmap bitmap) {
super.onPageStarted(webView2, str, bitmap);
}
@Override
public void onPageFinished(WebView webView2, String str) {
super.onPageFinished(webView2, str);
}
});
this.img_icon.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
UploadActivity uploadActivity = UploadActivity.this;
uploadActivity.startActivityForResult(uploadActivity.iconn, 101);
}
});
this.scr1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
UploadActivity uploadActivity = UploadActivity.this;
uploadActivity.startActivityForResult(uploadActivity.s1, 102);
}
});
this.scr2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
UploadActivity uploadActivity = UploadActivity.this;
uploadActivity.startActivityForResult(uploadActivity.s2, 103);
}
});
this.scr3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
UploadActivity uploadActivity = UploadActivity.this;
uploadActivity.startActivityForResult(uploadActivity.s3, 104);
}
});
this.scr4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
UploadActivity uploadActivity = UploadActivity.this;
uploadActivity.startActivityForResult(uploadActivity.s4, 105);
}
});
this.scr5.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
UploadActivity uploadActivity = UploadActivity.this;
uploadActivity.startActivityForResult(uploadActivity.s5, 106);
}
});
this.scr6.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
UploadActivity uploadActivity = UploadActivity.this;
uploadActivity.startActivityForResult(uploadActivity.s6, 107);
}
});
this.linear4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (!UploadActivity.this.sc1.equals("")) {
if (!UploadActivity.this.sc2.equals("")) {
if (!UploadActivity.this.sc3.equals("")) {
if (!UploadActivity.this.sc4.equals("")) {
if (!UploadActivity.this.sc5.equals("")) {
if (UploadActivity.this.sc6.equals("")) {
UploadActivity uploadActivity = UploadActivity.this;
uploadActivity.startActivityForResult(uploadActivity.s6, 107);
return;
}
return;
}
UploadActivity uploadActivity2 = UploadActivity.this;
uploadActivity2.startActivityForResult(uploadActivity2.s5, 106);
return;
}
UploadActivity uploadActivity3 = UploadActivity.this;
uploadActivity3.startActivityForResult(uploadActivity3.s4, 105);
return;
}
UploadActivity uploadActivity4 = UploadActivity.this;
uploadActivity4.startActivityForResult(uploadActivity4.s3, 104);
return;
}
UploadActivity uploadActivity5 = UploadActivity.this;
uploadActivity5.startActivityForResult(uploadActivity5.s2, 103);
return;
}
UploadActivity uploadActivity6 = UploadActivity.this;
uploadActivity6.startActivityForResult(uploadActivity6.s1, 102);
}
});
this.imageview14.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (UploadActivity.this.sc2.equals("")) {
UploadActivity.this.sc1 = "";
UploadActivity.this.scr1.setVisibility(8);
}
}
});
this.imageview15.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (UploadActivity.this.sc3.equals("")) {
UploadActivity.this.sc2 = "";
UploadActivity.this.scr2.setVisibility(8);
}
}
});
this.imageview16.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (UploadActivity.this.sc4.equals("")) {
UploadActivity.this.sc3 = "";
UploadActivity.this.scr3.setVisibility(8);
}
}
});
this.imageview20.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (UploadActivity.this.sc5.equals("")) {
UploadActivity.this.sc4 = "";
UploadActivity.this.scr4.setVisibility(8);
}
}
});
this.imageview24.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (UploadActivity.this.sc6.equals("")) {
UploadActivity.this.sc5 = "";
UploadActivity.this.scr5.setVisibility(8);
}
}
});
this.imageview28.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
UploadActivity.this.sc6 = "";
UploadActivity.this.scr6.setVisibility(8);
UploadActivity.this.linear4.setVisibility(0);
}
});
this.spinner1.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long j) {
if (i == 0) {
UploadActivity.this.categories = "Selecione a Categoria";
}
if (i == 1) {
UploadActivity.this.categories = "Livros & Referências";
}
if (i == 2) {
UploadActivity.this.categories = "Negócios";
}
if (i == 3) {
UploadActivity.this.categories = "Comunicação";
}
if (i == 4) {
UploadActivity.this.categories = "Educação";
}
if (i == 5) {
UploadActivity.this.categories = "Entretenimento";
}
if (i == 6) {
UploadActivity.this.categories = "Exemplo & Tutorial";
}
if (i == 7) {
UploadActivity.this.categories = "Jogos";
}
if (i == 8) {
UploadActivity.this.categories = "Vários dispositivos";
}
if (i == 9) {
UploadActivity.this.categories = "Música & Áudio";
}
if (i == 10) {
UploadActivity.this.categories = "Outro";
}
if (i == 11) {
UploadActivity.this.categories = "Fotografia";
}
if (i == 12) {
UploadActivity.this.categories = "Produtividade";
}
if (i == 13) {
UploadActivity.this.categories = "Social";
}
if (i == 14) {
UploadActivity.this.categories = "Ferramentas";
}
if (i == 15) {
UploadActivity.this.categories = "UI & UX";
}
if (i == 16) {
UploadActivity.this.categories = "Videografia";
}
}
});
this.imageview26.setOnClickListener(new AnonymousClass20());
ChildEventListener childEventListener = new ChildEventListener() {
@Override
public void onChildMoved(DataSnapshot dataSnapshot, String str) {
}
@Override
public void onChildAdded(DataSnapshot dataSnapshot, String str) {
GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
};
dataSnapshot.getKey();
}
@Override
public void onChildChanged(DataSnapshot dataSnapshot, String str) {
GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
};
dataSnapshot.getKey();
}
@Override
public void onChildRemoved(DataSnapshot dataSnapshot) {
GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
};
dataSnapshot.getKey();
}
@Override
public void onCancelled(DatabaseError databaseError) {
databaseError.getCode();
databaseError.getMessage();
}
};
this._project_child_listener = childEventListener;
this.project.addChildEventListener(childEventListener);
ChildEventListener childEventListener2 = new ChildEventListener() {
@Override
public void onChildMoved(DataSnapshot dataSnapshot, String str) {
}
@Override
public void onChildAdded(DataSnapshot dataSnapshot, String str) {
GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
};
String key = dataSnapshot.getKey();
HashMap hashMap = (HashMap) dataSnapshot.getValue(genericTypeIndicator);
if (FirebaseAuth.getInstance().getCurrentUser().getUid().equals(key) && hashMap.containsKey("projects")) {
UploadActivity.this.total_projects = hashMap.get("projects").toString();
}
}
@Override
public void onChildChanged(DataSnapshot dataSnapshot, String str) {
GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
};
dataSnapshot.getKey();
}
@Override
public void onChildRemoved(DataSnapshot dataSnapshot) {
GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
};
dataSnapshot.getKey();
}
@Override
public void onCancelled(DatabaseError databaseError) {
databaseError.getCode();
databaseError.getMessage();
}
};
this._Users_child_listener = childEventListener2;
this.Users.addChildEventListener(childEventListener2);
this._screenshot1_upload_progress_listener = new OnProgressListener<UploadTask.TaskSnapshot>() {
@Override
public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {
taskSnapshot.getBytesTransferred();
taskSnapshot.getTotalByteCount();
}
};
this._screenshot1_download_progress_listener = new OnProgressListener<FileDownloadTask.TaskSnapshot>() {
@Override
public void onProgress(FileDownloadTask.TaskSnapshot taskSnapshot) {
taskSnapshot.getBytesTransferred();
taskSnapshot.getTotalByteCount();
}
};
this._screenshot1_upload_success_listener = new OnCompleteListener<Uri>() {
@Override
public void onComplete(Task<Uri> task) {
UploadActivity.this.screenshot_1 = task.getResult().toString();
if (UploadActivity.this.sc2.equals("")) {
UploadActivity.this._uploads();
return;
}
UploadActivity.this.c = Calendar.getInstance();
UploadActivity.this.screenshot2.child(new SimpleDateFormat("ddyyhhmmss").format(UploadActivity.this.c.getTime()).concat(".jpg")).putFile(Uri.fromFile(new File(UploadActivity.this.screenshot_2))).addOnFailureListener(UploadActivity.this._screenshot2_failure_listener).addOnProgressListener(UploadActivity.this._screenshot2_upload_progress_listener).continueWithTask(new Continuation<UploadTask.TaskSnapshot, Task<Uri>>() {
@Override
public Task<Uri> then(Task<UploadTask.TaskSnapshot> task2) throws Exception {
return UploadActivity.this.screenshot2.child(new SimpleDateFormat("ddyyhhmmss").format(UploadActivity.this.c.getTime()).concat(".jpg")).getDownloadUrl();
}
}).addOnCompleteListener(UploadActivity.this._screenshot2_upload_success_listener);
}
};
this._screenshot1_download_success_listener = new OnSuccessListener<FileDownloadTask.TaskSnapshot>() {
@Override
public void onSuccess(FileDownloadTask.TaskSnapshot taskSnapshot) {
taskSnapshot.getTotalByteCount();
}
};
this._screenshot1_delete_success_listener = new OnSuccessListener() {
@Override
public void onSuccess(Object obj) {
}
};
this._screenshot1_failure_listener = new OnFailureListener() {
@Override
public void onFailure(Exception exc) {
exc.getMessage();
}
};
this._screenshot2_upload_progress_listener = new OnProgressListener<UploadTask.TaskSnapshot>() {
@Override
public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {
taskSnapshot.getBytesTransferred();
taskSnapshot.getTotalByteCount();
}
};
this._screenshot2_download_progress_listener = new OnProgressListener<FileDownloadTask.TaskSnapshot>() {
@Override
public void onProgress(FileDownloadTask.TaskSnapshot taskSnapshot) {
taskSnapshot.getBytesTransferred();
taskSnapshot.getTotalByteCount();
}
};
this._screenshot2_upload_success_listener = new OnCompleteListener<Uri>() {
@Override
public void onComplete(Task<Uri> task) {
UploadActivity.this.screenshot_2 = task.getResult().toString();
if (UploadActivity.this.sc3.equals("")) {
UploadActivity.this._uploads();
return;
}
UploadActivity.this.c = Calendar.getInstance();
UploadActivity.this.screenshot3.child(new SimpleDateFormat("ddyyhhmmss").format(UploadActivity.this.c.getTime()).concat(".jpg")).putFile(Uri.fromFile(new File(UploadActivity.this.screenshot_3))).addOnFailureListener(UploadActivity.this._screenshot3_failure_listener).addOnProgressListener(UploadActivity.this._screenshot3_upload_progress_listener).continueWithTask(new Continuation<UploadTask.TaskSnapshot, Task<Uri>>() {
@Override
public Task<Uri> then(Task<UploadTask.TaskSnapshot> task2) throws Exception {
return UploadActivity.this.screenshot3.child(new SimpleDateFormat("ddyyhhmmss").format(UploadActivity.this.c.getTime()).concat(".jpg")).getDownloadUrl();
}
}).addOnCompleteListener(UploadActivity.this._screenshot3_upload_success_listener);
}
};
this._screenshot2_download_success_listener = new OnSuccessListener<FileDownloadTask.TaskSnapshot>() {
@Override
public void onSuccess(FileDownloadTask.TaskSnapshot taskSnapshot) {
taskSnapshot.getTotalByteCount();
}
};
this._screenshot2_delete_success_listener = new OnSuccessListener() {
@Override
public void onSuccess(Object obj) {
}
};
this._screenshot2_failure_listener = new OnFailureListener() {
@Override
public void onFailure(Exception exc) {
exc.getMessage();
}
};
this._screenshot3_upload_progress_listener = new OnProgressListener<UploadTask.TaskSnapshot>() {
@Override
public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {
taskSnapshot.getBytesTransferred();
taskSnapshot.getTotalByteCount();
}
};
this._screenshot3_download_progress_listener = new OnProgressListener<FileDownloadTask.TaskSnapshot>() {
@Override
public void onProgress(FileDownloadTask.TaskSnapshot taskSnapshot) {
taskSnapshot.getBytesTransferred();
taskSnapshot.getTotalByteCount();
}
};
this._screenshot3_upload_success_listener = new OnCompleteListener<Uri>() {
@Override
public void onComplete(Task<Uri> task) {
UploadActivity.this.screenshot_3 = task.getResult().toString();
if (UploadActivity.this.sc4.equals("")) {
UploadActivity.this._uploads();
return;
}
UploadActivity.this.c = Calendar.getInstance();
UploadActivity.this.screenshot4.child(new SimpleDateFormat("ddyyhhmmss").format(UploadActivity.this.c.getTime()).concat(".jpg")).putFile(Uri.fromFile(new File(UploadActivity.this.screenshot_4))).addOnFailureListener(UploadActivity.this._screenshot4_failure_listener).addOnProgressListener(UploadActivity.this._screenshot4_upload_progress_listener).continueWithTask(new Continuation<UploadTask.TaskSnapshot, Task<Uri>>() {
@Override
public Task<Uri> then(Task<UploadTask.TaskSnapshot> task2) throws Exception {
return UploadActivity.this.screenshot4.child(new SimpleDateFormat("ddyyhhmmss").format(UploadActivity.this.c.getTime()).concat(".jpg")).getDownloadUrl();
}
}).addOnCompleteListener(UploadActivity.this._screenshot4_upload_success_listener);
}
};
this._screenshot3_download_success_listener = new OnSuccessListener<FileDownloadTask.TaskSnapshot>() {
@Override
public void onSuccess(FileDownloadTask.TaskSnapshot taskSnapshot) {
taskSnapshot.getTotalByteCount();
}
};
this._screenshot3_delete_success_listener = new OnSuccessListener() {
@Override
public void onSuccess(Object obj) {
}
};
this._screenshot3_failure_listener = new OnFailureListener() {
@Override
public void onFailure(Exception exc) {
exc.getMessage();
}
};
this._screenshot4_upload_progress_listener = new OnProgressListener<UploadTask.TaskSnapshot>() {
@Override
public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {
taskSnapshot.getBytesTransferred();
taskSnapshot.getTotalByteCount();
}
};
this._screenshot4_download_progress_listener = new OnProgressListener<FileDownloadTask.TaskSnapshot>() {
@Override
public void onProgress(FileDownloadTask.TaskSnapshot taskSnapshot) {
taskSnapshot.getBytesTransferred();
taskSnapshot.getTotalByteCount();
}
};
this._screenshot4_upload_success_listener = new OnCompleteListener<Uri>() {
@Override
public void onComplete(Task<Uri> task) {
UploadActivity.this.screenshot_4 = task.getResult().toString();
if (UploadActivity.this.sc5.equals("")) {
UploadActivity.this._uploads();
return;
}
UploadActivity.this.c = Calendar.getInstance();
UploadActivity.this.screenshot5.child(new SimpleDateFormat("ddyyhhmmss").format(UploadActivity.this.c.getTime()).concat(".jpg")).putFile(Uri.fromFile(new File(UploadActivity.this.screenshot_5))).addOnFailureListener(UploadActivity.this._screenshot5_failure_listener).addOnProgressListener(UploadActivity.this._screenshot5_upload_progress_listener).continueWithTask(new Continuation<UploadTask.TaskSnapshot, Task<Uri>>() {
@Override
public Task<Uri> then(Task<UploadTask.TaskSnapshot> task2) throws Exception {
return UploadActivity.this.screenshot5.child(new SimpleDateFormat("ddyyhhmmss").format(UploadActivity.this.c.getTime()).concat(".jpg")).getDownloadUrl();
}
}).addOnCompleteListener(UploadActivity.this._screenshot5_upload_success_listener);
}
};
this._screenshot4_download_success_listener = new OnSuccessListener<FileDownloadTask.TaskSnapshot>() {
@Override
public void onSuccess(FileDownloadTask.TaskSnapshot taskSnapshot) {
taskSnapshot.getTotalByteCount();
}
};
this._screenshot4_delete_success_listener = new OnSuccessListener() {
@Override
public void onSuccess(Object obj) {
}
};
this._screenshot4_failure_listener = new OnFailureListener() {
@Override
public void onFailure(Exception exc) {
exc.getMessage();
}
};
this._screenshot5_upload_progress_listener = new OnProgressListener<UploadTask.TaskSnapshot>() {
@Override
public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {
taskSnapshot.getBytesTransferred();
taskSnapshot.getTotalByteCount();
}
};
this._screenshot5_download_progress_listener = new OnProgressListener<FileDownloadTask.TaskSnapshot>() {
@Override
public void onProgress(FileDownloadTask.TaskSnapshot taskSnapshot) {
taskSnapshot.getBytesTransferred();
taskSnapshot.getTotalByteCount();
}
};
this._screenshot5_upload_success_listener = new OnCompleteListener<Uri>() {
@Override
public void onComplete(Task<Uri> task) {
UploadActivity.this.screenshot_5 = task.getResult().toString();
if (UploadActivity.this.sc6.equals("")) {
UploadActivity.this._uploads();
return;
}
UploadActivity.this.c = Calendar.getInstance();
UploadActivity.this.screenshot6.child(new SimpleDateFormat("ddyyhhmmss").format(UploadActivity.this.c.getTime()).concat(".jpg")).putFile(Uri.fromFile(new File(UploadActivity.this.screenshot_6))).addOnFailureListener(UploadActivity.this._screenshot6_failure_listener).addOnProgressListener(UploadActivity.this._screenshot6_upload_progress_listener).continueWithTask(new Continuation<UploadTask.TaskSnapshot, Task<Uri>>() {
@Override
public Task<Uri> then(Task<UploadTask.TaskSnapshot> task2) throws Exception {
return UploadActivity.this.screenshot6.child(new SimpleDateFormat("ddyyhhmmss").format(UploadActivity.this.c.getTime()).concat(".jpg")).getDownloadUrl();
}
}).addOnCompleteListener(UploadActivity.this._screenshot6_upload_success_listener);
}
};
this._screenshot5_download_success_listener = new OnSuccessListener<FileDownloadTask.TaskSnapshot>() {
@Override
public void onSuccess(FileDownloadTask.TaskSnapshot taskSnapshot) {
taskSnapshot.getTotalByteCount();
}
};
this._screenshot5_delete_success_listener = new OnSuccessListener() {
@Override
public void onSuccess(Object obj) {
}
};
this._screenshot5_failure_listener = new OnFailureListener() {
@Override
public void onFailure(Exception exc) {
exc.getMessage();
}
};
this._screenshot6_upload_progress_listener = new OnProgressListener<UploadTask.TaskSnapshot>() {
@Override
public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {
taskSnapshot.getBytesTransferred();
taskSnapshot.getTotalByteCount();
}
};
this._screenshot6_download_progress_listener = new OnProgressListener<FileDownloadTask.TaskSnapshot>() {
@Override
public void onProgress(FileDownloadTask.TaskSnapshot taskSnapshot) {
taskSnapshot.getBytesTransferred();
taskSnapshot.getTotalByteCount();
}
};
this._screenshot6_upload_success_listener = new OnCompleteListener<Uri>() {
@Override
public void onComplete(Task<Uri> task) {
UploadActivity.this.screenshot_6 = task.getResult().toString();
UploadActivity.this._uploads();
}
};
this._screenshot6_download_success_listener = new OnSuccessListener<FileDownloadTask.TaskSnapshot>() {
@Override
public void onSuccess(FileDownloadTask.TaskSnapshot taskSnapshot) {
taskSnapshot.getTotalByteCount();
}
};
this._screenshot6_delete_success_listener = new OnSuccessListener() {
@Override
public void onSuccess(Object obj) {
}
};
this._screenshot6_failure_listener = new OnFailureListener() {
@Override
public void onFailure(Exception exc) {
exc.getMessage();
}
};
this._icon_upload_progress_listener = new OnProgressListener<UploadTask.TaskSnapshot>() {
@Override
public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {
taskSnapshot.getBytesTransferred();
taskSnapshot.getTotalByteCount();
UploadActivity.this._Custom_Loading(true);
}
};
this._icon_download_progress_listener = new OnProgressListener<FileDownloadTask.TaskSnapshot>() {
@Override
public void onProgress(FileDownloadTask.TaskSnapshot taskSnapshot) {
taskSnapshot.getBytesTransferred();
taskSnapshot.getTotalByteCount();
}
};
this._icon_upload_success_listener = new OnCompleteListener<Uri>() {
@Override
public void onComplete(Task<Uri> task) {
UploadActivity.this.icon_path = task.getResult().toString();
UploadActivity.this.c = Calendar.getInstance();
UploadActivity.this.screenshot1.child(new SimpleDateFormat("ddyyhhmmss").format(UploadActivity.this.c.getTime()).concat(".jpg")).putFile(Uri.fromFile(new File(UploadActivity.this.screenshot_1))).addOnFailureListener(UploadActivity.this._screenshot1_failure_listener).addOnProgressListener(UploadActivity.this._screenshot1_upload_progress_listener).continueWithTask(new Continuation<UploadTask.TaskSnapshot, Task<Uri>>() {
@Override
public Task<Uri> then(Task<UploadTask.TaskSnapshot> task2) throws Exception {
return UploadActivity.this.screenshot1.child(new SimpleDateFormat("ddyyhhmmss").format(UploadActivity.this.c.getTime()).concat(".jpg")).getDownloadUrl();
}
}).addOnCompleteListener(UploadActivity.this._screenshot1_upload_success_listener);
}
};
this._icon_download_success_listener = new OnSuccessListener<FileDownloadTask.TaskSnapshot>() {
@Override
public void onSuccess(FileDownloadTask.TaskSnapshot taskSnapshot) {
taskSnapshot.getTotalByteCount();
}
};
this._icon_delete_success_listener = new OnSuccessListener() {
@Override
public void onSuccess(Object obj) {
}
};
this._icon_failure_listener = new OnFailureListener() {
@Override
public void onFailure(Exception exc) {
exc.getMessage();
}
};
this._rn_request_listener = new RequestNetwork.RequestListener() {
@Override
public void onErrorResponse(String str, String str2) {
}
@Override
public void onResponse(String str, String str2, HashMap<String, Object> hashMap) {
}
};
ChildEventListener childEventListener3 = new ChildEventListener() {
@Override
public void onChildMoved(DataSnapshot dataSnapshot, String str) {
}
@Override
public void onChildAdded(DataSnapshot dataSnapshot, String str) {
GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
};
dataSnapshot.getKey();
}
@Override
public void onChildChanged(DataSnapshot dataSnapshot, String str) {
GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
};
dataSnapshot.getKey();
}
@Override
public void onChildRemoved(DataSnapshot dataSnapshot) {
GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
};
dataSnapshot.getKey();
}
@Override
public void onCancelled(DatabaseError databaseError) {
databaseError.getCode();
databaseError.getMessage();
}
};
this._notification_child_listener = childEventListener3;
this.notification.addChildEventListener(childEventListener3);
ChildEventListener childEventListener4 = new ChildEventListener() {
@Override
public void onChildMoved(DataSnapshot dataSnapshot, String str) {
}
@Override
public void onChildAdded(DataSnapshot dataSnapshot, String str) {
GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
};
dataSnapshot.getKey();
HashMap hashMap = (HashMap) dataSnapshot.getValue(genericTypeIndicator);
if (hashMap.containsKey("B2")) {
UploadActivity.this.Inter.setText(hashMap.get("B2").toString());
}
if (hashMap.containsKey("C3")) {
UploadActivity.this.Rewarded1.setText(hashMap.get("C3").toString());
}
}
@Override
public void onChildChanged(DataSnapshot dataSnapshot, String str) {
GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
};
dataSnapshot.getKey();
}
@Override
public void onChildRemoved(DataSnapshot dataSnapshot) {
GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
};
dataSnapshot.getKey();
}
@Override
public void onCancelled(DatabaseError databaseError) {
databaseError.getCode();
databaseError.getMessage();
}
};
this._Ads_child_listener = childEventListener4;
this.Ads.addChildEventListener(childEventListener4);
this.auth_updateEmailListener = new OnCompleteListener<Void>() {
@Override
public void onComplete(Task<Void> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this.auth_updatePasswordListener = new OnCompleteListener<Void>() {
@Override
public void onComplete(Task<Void> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this.auth_emailVerificationSentListener = new OnCompleteListener<Void>() {
@Override
public void onComplete(Task<Void> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this.auth_deleteUserListener = new OnCompleteListener<Void>() {
@Override
public void onComplete(Task<Void> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this.auth_phoneAuthListener = new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(Task<AuthResult> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this.auth_updateProfileListener = new OnCompleteListener<Void>() {
@Override
public void onComplete(Task<Void> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this.auth_googleSignInListener = new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(Task<AuthResult> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this._auth_create_user_listener = new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(Task<AuthResult> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this._auth_sign_in_listener = new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(Task<AuthResult> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this._auth_reset_password_listener = new OnCompleteListener<Void>() {
@Override
public void onComplete(Task<Void> task) {
task.isSuccessful();
}
};
}
public class AnonymousClass20 implements View.OnClickListener {
AnonymousClass20() {
}
@Override
public void onClick(View view) {
UploadActivity.this.c = Calendar.getInstance();
UploadActivity.this.webview1.evaluateJavascript("document.getElementById(\"fileName\").value = ".concat("\"".concat(new SimpleDateFormat("ddyyhhmmss").format(UploadActivity.this.c.getTime()).concat(".apk").concat("\""))), null);
UploadActivity.this.webview1.evaluateJavascript("document.getElementById(\"folderName\").value =".concat("\"".concat("projects/".concat("\""))), null);
UploadActivity.this.checkRes = new TimerTask() {
@Override
public void run() {
UploadActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
UploadActivity.this.webview1.evaluateJavascript("document.getElementById(\"uploadBtn\").click()", null);
UploadActivity.this._Custom_Loading(true);
SketchwareUtil.showMessage(UploadActivity.this.getApplicationContext(), "Enviando...");
UploadActivity.this._checkResponse();
}
});
}
};
UploadActivity.this._timer.schedule(UploadActivity.this.checkRes, 500L);
}
}
private void initializeLogic() {
getWindow().getDecorView().setSystemUiVisibility(8192);
getWindow().setStatusBarColor(-1);
_category();
_removeScollBar(this.vscroll1);
this.scr1.setVisibility(8);
this.scr2.setVisibility(8);
this.scr3.setVisibility(8);
this.scr4.setVisibility(8);
this.scr5.setVisibility(8);
this.scr6.setVisibility(8);
this.webview1.setVisibility(8);
this.img_icon.setBackground(new GradientDrawable() {
public GradientDrawable getIns(int i, int i2, int i3, int i4) {
setCornerRadius(i);
setStroke(i2, i3);
setColor(i4);
return this;
}
}.getIns(15, 0, -12434878, -13154481));
this.linear11.setBackground(new GradientDrawable() {
public GradientDrawable getIns(int i, int i2, int i3, int i4) {
setCornerRadius(i);
setStroke(i2, i3);
setColor(i4);
return this;
}
}.getIns(15, 2, -12434878, 0));
this.linear19.setBackground(new GradientDrawable() {
public GradientDrawable getIns(int i, int i2, int i3, int i4) {
setCornerRadius(i);
setStroke(i2, i3);
setColor(i4);
return this;
}
}.getIns(20, 2, -12434878, 0));
this.linear20.setBackground(new GradientDrawable() {
public GradientDrawable getIns(int i, int i2, int i3, int i4) {
setCornerRadius(i);
setStroke(i2, i3);
setColor(i4);
return this;
}
}.getIns(20, 2, -12434878, 0));
this.linear22.setBackground(new GradientDrawable() {
public GradientDrawable getIns(int i, int i2, int i3, int i4) {
setCornerRadius(i);
setStroke(i2, i3);
setColor(i4);
return this;
}
}.getIns(20, 2, -12434878, 0));
this.textview1.setTypeface(Typeface.createFromAsset(getAssets(), "fonts/product.ttf"), 0);
_AdvancedEdittext(this.description, 1500.0d, this.dc_limit, "");
_AdvancedEdittext(this.yt_url, 11.0d, this.yt_limit, "#1361F5");
_AdvancedEdittext(this.title, 50.0d, this.title_limit, "");
_ImageViewColorFilter(this.imageview17, "#424242");
_ImageViewColorFilter(this.imageview25, "#424242");
this.categories = "Selecione a Categoria";
_loadHtml();
}
@Override
public void onActivityResult(int i, int i2, Intent intent) {
ValueCallback<Uri[]> valueCallback;
super.onActivityResult(i, i2, intent);
if (i != 1) {
switch (i) {
case 100:
if (Build.VERSION.SDK_INT < 21 || (valueCallback = this.uploadMessage) == null) {
return;
}
valueCallback.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(i2, intent));
this.uploadMessage = null;
if (intent == null) {
SketchwareUtil.showMessage(getApplicationContext(), "Arquivo não selecionado");
return;
}
AnonymousClass83 anonymousClass83 = new AnonymousClass83();
this.checkRes = anonymousClass83;
this._timer.schedule(anonymousClass83, 500L);
return;
case 101:
if (i2 == -1) {
ArrayList arrayList = new ArrayList();
if (intent != null) {
if (intent.getClipData() != null) {
for (int i3 = 0; i3 < intent.getClipData().getItemCount(); i3++) {
arrayList.add(FileUtil.convertUriToFilePath(getApplicationContext(), intent.getClipData().getItemAt(i3).getUri()));
}
} else {
arrayList.add(FileUtil.convertUriToFilePath(getApplicationContext(), intent.getData()));
}
}
String str = (String) arrayList.get(0);
this.icon_path = str;
this.img_icon.setImageBitmap(FileUtil.decodeSampleBitmapFromPath(str, 1024, 1024));
return;
}
return;
case 102:
if (i2 == -1) {
ArrayList arrayList2 = new ArrayList();
if (intent != null) {
if (intent.getClipData() != null) {
for (int i4 = 0; i4 < intent.getClipData().getItemCount(); i4++) {
arrayList2.add(FileUtil.convertUriToFilePath(getApplicationContext(), intent.getClipData().getItemAt(i4).getUri()));
}
} else {
arrayList2.add(FileUtil.convertUriToFilePath(getApplicationContext(), intent.getData()));
}
}
String str2 = (String) arrayList2.get(0);
this.screenshot_1 = str2;
this.imageview14.setImageBitmap(FileUtil.decodeSampleBitmapFromPath(str2, 1024, 1024));
this.screenshot__1.setImageBitmap(FileUtil.decodeSampleBitmapFromPath(this.screenshot_1, 1024, 1024));
this.scr1.setVisibility(0);
this.sc1 = "ss1";
_TransitionManager(this.linear1, 200.0d);
return;
}
return;
case 103:
if (i2 == -1) {
ArrayList arrayList3 = new ArrayList();
if (intent != null) {
if (intent.getClipData() != null) {
for (int i5 = 0; i5 < intent.getClipData().getItemCount(); i5++) {
arrayList3.add(FileUtil.convertUriToFilePath(getApplicationContext(), intent.getClipData().getItemAt(i5).getUri()));
}
} else {
arrayList3.add(FileUtil.convertUriToFilePath(getApplicationContext(), intent.getData()));
}
}
String str3 = (String) arrayList3.get(0);
this.screenshot_2 = str3;
this.imageview15.setImageBitmap(FileUtil.decodeSampleBitmapFromPath(str3, 1024, 1024));
this.screenshot__2.setImageBitmap(FileUtil.decodeSampleBitmapFromPath(this.screenshot_2, 1024, 1024));
this.scr2.setVisibility(0);
this.sc2 = "ss2";
_TransitionManager(this.linear1, 200.0d);
return;
}
return;
case 104:
if (i2 == -1) {
ArrayList arrayList4 = new ArrayList();
if (intent != null) {
if (intent.getClipData() != null) {
for (int i6 = 0; i6 < intent.getClipData().getItemCount(); i6++) {
arrayList4.add(FileUtil.convertUriToFilePath(getApplicationContext(), intent.getClipData().getItemAt(i6).getUri()));
}
} else {
arrayList4.add(FileUtil.convertUriToFilePath(getApplicationContext(), intent.getData()));
}
}
String str4 = (String) arrayList4.get(0);
this.screenshot_3 = str4;
this.imageview16.setImageBitmap(FileUtil.decodeSampleBitmapFromPath(str4, 1024, 1024));
this.screenshot__3.setImageBitmap(FileUtil.decodeSampleBitmapFromPath(this.screenshot_3, 1024, 1024));
this.scr3.setVisibility(0);
this.sc3 = "ss3";
_TransitionManager(this.linear1, 200.0d);
return;
}
return;
case 105:
if (i2 == -1) {
ArrayList arrayList5 = new ArrayList();
if (intent != null) {
if (intent.getClipData() != null) {
for (int i7 = 0; i7 < intent.getClipData().getItemCount(); i7++) {
arrayList5.add(FileUtil.convertUriToFilePath(getApplicationContext(), intent.getClipData().getItemAt(i7).getUri()));
}
} else {
arrayList5.add(FileUtil.convertUriToFilePath(getApplicationContext(), intent.getData()));
}
}
String str5 = (String) arrayList5.get(0);
this.screenshot_4 = str5;
this.imageview20.setImageBitmap(FileUtil.decodeSampleBitmapFromPath(str5, 1024, 1024));
this.screenshot__4.setImageBitmap(FileUtil.decodeSampleBitmapFromPath(this.screenshot_4, 1024, 1024));
this.scr4.setVisibility(0);
this.sc4 = "ss4";
_TransitionManager(this.linear1, 200.0d);
return;
}
return;
case 106:
if (i2 == -1) {
ArrayList arrayList6 = new ArrayList();
if (intent != null) {
if (intent.getClipData() != null) {
for (int i8 = 0; i8 < intent.getClipData().getItemCount(); i8++) {
arrayList6.add(FileUtil.convertUriToFilePath(getApplicationContext(), intent.getClipData().getItemAt(i8).getUri()));
}
} else {
arrayList6.add(FileUtil.convertUriToFilePath(getApplicationContext(), intent.getData()));
}
}
String str6 = (String) arrayList6.get(0);
this.screenshot_5 = str6;
this.imageview24.setImageBitmap(FileUtil.decodeSampleBitmapFromPath(str6, 1024, 1024));
this.screenshot__5.setImageBitmap(FileUtil.decodeSampleBitmapFromPath(this.screenshot_5, 1024, 1024));
this.scr5.setVisibility(0);
this.sc5 = "ss5";
_TransitionManager(this.linear1, 200.0d);
return;
}
return;
case 107:
if (i2 == -1) {
ArrayList arrayList7 = new ArrayList();
if (intent != null) {
if (intent.getClipData() != null) {
for (int i9 = 0; i9 < intent.getClipData().getItemCount(); i9++) {
arrayList7.add(FileUtil.convertUriToFilePath(getApplicationContext(), intent.getClipData().getItemAt(i9).getUri()));
}
} else {
arrayList7.add(FileUtil.convertUriToFilePath(getApplicationContext(), intent.getData()));
}
}
String str7 = (String) arrayList7.get(0);
this.screenshot_6 = str7;
this.imageview28.setImageBitmap(FileUtil.decodeSampleBitmapFromPath(str7, 1024, 1024));
this.screenshot__6.setImageBitmap(FileUtil.decodeSampleBitmapFromPath(this.screenshot_6, 1024, 1024));
this.scr6.setVisibility(0);
this.sc6 = "ss6";
_TransitionManager(this.linear1, 200.0d);
return;
}
return;
case 108:
if (i2 == -1) {
ArrayList arrayList8 = new ArrayList();
if (intent != null) {
if (intent.getClipData() != null) {
for (int i10 = 0; i10 < intent.getClipData().getItemCount(); i10++) {
arrayList8.add(FileUtil.convertUriToFilePath(getApplicationContext(), intent.getClipData().getItemAt(i10).getUri()));
}
return;
}
arrayList8.add(FileUtil.convertUriToFilePath(getApplicationContext(), intent.getData()));
return;
}
return;
}
return;
default:
return;
}
}
if (this.mUploadMessage == null) {
return;
}
this.mUploadMessage.onReceiveValue((intent == null || i2 != -1) ? null : intent.getData());
this.mUploadMessage = null;
}
public class AnonymousClass83 extends TimerTask {
AnonymousClass83() {
}
@Override
public void run() {
UploadActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
UploadActivity.this.webview1.evaluateJavascript("document.getElementById(\"fileInput\").files[0].size", new ValueCallback<String>() {
@Override
public void onReceiveValue(String str) {
UploadActivity.this.file_sizes = Double.parseDouble(str.replace("\"", ""));
if (UploadActivity.this.file_sizes < 1024.0d) {
UploadActivity.this.size.setText(String.valueOf(UploadActivity.this.file_sizes).substring(0, 5).concat(" B"));
return;
}
if (1024.0d < UploadActivity.this.file_sizes && UploadActivity.this.file_sizes < 1048576.0d) {
UploadActivity.this.size.setText(String.valueOf(UploadActivity.this.file_sizes / 1024.0d).substring(0, 5).concat(" KB"));
return;
}
if (1048576.0d < UploadActivity.this.file_sizes && UploadActivity.this.file_sizes < 1.073741824E9d) {
UploadActivity.this.size.setText(String.valueOf(UploadActivity.this.file_sizes / 1048576.0d).substring(0, 4).concat(" MB"));
} else if (1.073741824E9d < UploadActivity.this.file_sizes) {
UploadActivity.this.size.setText(String.valueOf(UploadActivity.this.file_sizes / 1.073741824E9d).substring(0, 4).concat("GB"));
}
}
});
UploadActivity.this.webview1.evaluateJavascript("document.getElementById(\"fileInput\").files[0].name", new ValueCallback<String>() {
@Override
public void onReceiveValue(String str) {
UploadActivity.this.textview21.setText(str.replace("\"", ""));
SketchwareUtil.showMessage(UploadActivity.this.getApplicationContext(), "Arquivo selecionado");
}
});
}
});
}
}
public void _AdvancedEdittext(TextView textView, final double d, final TextView textView2, String str) {
try {
StringBuilder sb = new StringBuilder(String.valueOf(String.valueOf(textView.getText().toString().length())));
sb.append("/");
int i = (int) d;
sb.append(String.valueOf(i));
textView2.setText(sb.toString());
((EditText) textView).setFilters(new InputFilter[]{new InputFilter.LengthFilter(i)});
textView.addTextChangedListener(new TextWatcher() {
@Override
public void afterTextChanged(Editable editable) {
}
@Override
public void beforeTextChanged(CharSequence charSequence, int i2, int i3, int i4) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i2, int i3, int i4) {
String charSequence2 = charSequence.toString();
textView2.setText(String.valueOf(String.valueOf(charSequence2.length())) + "/" + String.valueOf((int) d));
}
});
} catch (Exception unused) {
}
try {
((EditText) textView).getBackground().mutate().setColorFilter(Color.parseColor("#" + str.replace("#", "")), PorterDuff.Mode.SRC_ATOP);
} catch (Exception unused2) {
}
}
public void _rippleRoundStroke(View view, String str, String str2, double d, double d2, String str3) {
GradientDrawable gradientDrawable = new GradientDrawable();
gradientDrawable.setColor(Color.parseColor(str));
gradientDrawable.setCornerRadius((float) d);
gradientDrawable.setStroke((int) d2, Color.parseColor("#" + str3.replace("#", "")));
view.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{Color.parseColor(str2)}), gradientDrawable, null));
}
public void _TransitionManager(View view, double d) {
AutoTransition autoTransition = new AutoTransition();
autoTransition.setDuration((long) d);
autoTransition.setInterpolator((TimeInterpolator) new DecelerateInterpolator());
TransitionManager.beginDelayedTransition((LinearLayout) view, autoTransition);
}
public void _ImageViewColorFilter(ImageView imageView, String str) {
imageView.setColorFilter(Color.parseColor(str), PorterDuff.Mode.SRC_IN);
}
public void _Custom_Loading(boolean z) {
if (z) {
if (this.coreprog == null) {
ProgressDialog progressDialog = new ProgressDialog(this);
this.coreprog = progressDialog;
progressDialog.setCancelable(false);
this.coreprog.setCanceledOnTouchOutside(false);
this.coreprog.requestWindowFeature(1);
this.coreprog.getWindow().setBackgroundDrawable(new ColorDrawable(0));
}
this.coreprog.setMessage(null);
this.coreprog.show();
View inflate = getLayoutInflater().inflate(R.layout.custom_dialog, (ViewGroup) null);
LinearLayout linearLayout = (LinearLayout) inflate.findViewById(R.id.linear_base);
GradientDrawable gradientDrawable = new GradientDrawable();
gradientDrawable.setColor(0);
gradientDrawable.setCornerRadius(25.0f);
linearLayout.setBackground(gradientDrawable);
this.coreprog.setContentView(inflate);
return;
}
ProgressDialog progressDialog2 = this.coreprog;
if (progressDialog2 != null) {
progressDialog2.dismiss();
}
}
public void _removeScollBar(View view) {
view.setVerticalScrollBarEnabled(false);
view.setHorizontalScrollBarEnabled(false);
}
public void _category() {
this.spinner_data.add("Selecione a Categoria");
this.spinner_data.add("Livros & Referências");
this.spinner_data.add("Negócios");
this.spinner_data.add("Comunicação");
this.spinner_data.add("Educação");
this.spinner_data.add("Entretenimento");
this.spinner_data.add("Exemplo & Tutorial");
this.spinner_data.add("Jogos");
this.spinner_data.add("Vários dispositivos");
this.spinner_data.add("Música & Áudio");
this.spinner_data.add("Outro");
this.spinner_data.add("Fotografia");
this.spinner_data.add("Produtividade");
this.spinner_data.add("Social");
this.spinner_data.add("Ferramentas");
this.spinner_data.add("UI & UX");
this.spinner_data.add("Videografia");
this.spinner1.setAdapter((SpinnerAdapter) new ArrayAdapter(getBaseContext(), android.R.layout.simple_spinner_dropdown_item, this.spinner_data));
this.spinner1.setSelection(0);
}
public void _uploads() {
this.c = Calendar.getInstance();
this.normal_key = this.project.push().getKey();
HashMap<String, Object> hashMap = new HashMap<>();
this.data_map = hashMap;
hashMap.put("icon", this.icon_path);
this.data_map.put("title", this.title.getText().toString().trim());
this.data_map.put("download_url", this.download_url.getText().toString().trim());
this.data_map.put("size", this.size.getText().toString().trim());
this.data_map.put("verify", "false");
this.data_map.put("uid", FirebaseAuth.getInstance().getCurrentUser().getUid());
this.data_map.put("key", this.normal_key);
this.data_map.put("likes", "0");
this.data_map.put("comments", "0");
this.data_map.put("downloads", "0");
this.data_map.put("name", this.users.getString("name", ""));
this.data_map.put("category", this.categories);
this.data_map.put("editors_choice", "false");
this.data_map.put("trending", "false");
this.data_map.put("latest", "true");
this.data_map.put("description", this.description.getText().toString().trim());
this.data_map.put("video", this.yt_url.getText().toString().trim());
this.data_map.put("screen1", this.screenshot_1);
this.data_map.put("screen2", this.screenshot_2);
this.data_map.put("screen3", this.screenshot_3);
this.data_map.put("screen4", this.screenshot_4);
this.data_map.put("screen5", this.screenshot_5);
this.data_map.put("screen6", this.screenshot_6);
this.data_map.put("time", new SimpleDateFormat("dd MMMM yyyy").format(this.c.getTime()));
if (this.switch_comment.isChecked()) {
this.data_map.put("comments_disable", "true");
} else {
this.data_map.put("comments_disable", "false");
}
this.project.child(this.normal_key).updateChildren(this.data_map);
this.data_map.clear();
HashMap<String, Object> hashMap2 = new HashMap<>();
this.data_map = hashMap2;
hashMap2.put("projects", String.valueOf((long) (Double.parseDouble(this.total_projects) + 1.0d)));
this.Users.child(FirebaseAuth.getInstance().getCurrentUser().getUid()).updateChildren(this.data_map);
this.data_map.clear();
this.notification_key = this.notification.push().getKey();
HashMap<String, Object> hashMap3 = new HashMap<>();
this.data_map = hashMap3;
hashMap3.put("notification_content", "Um novo aplicativo: ".concat(this.title.getText().toString().trim().concat(" foi adicionado a ZStore.")));
this.data_map.put("uid", FirebaseAuth.getInstance().getCurrentUser().getUid());
this.data_map.put("Type", "Project");
this.data_map.put("project_key", this.normal_key);
this.data_map.put("mode", "Free");
this.data_map.put(ServerValues.NAME_OP_TIMESTAMP, String.valueOf(this.c.getTimeInMillis()));
this.data_map.put("key", this.notification_key);
this.notification.child(this.notification_key).updateChildren(this.data_map);
_Custom_Loading(false);
SketchwareUtil.showMessage(getApplicationContext(), "Aplicativo publicado com sucesso!");
finish();
}
public void _checkResponse() {
if (this.isFinding) {
return;
}
this.isFinding = true;
AnonymousClass85 anonymousClass85 = new AnonymousClass85();
this.checkRes = anonymousClass85;
this._timer.scheduleAtFixedRate(anonymousClass85, 0L, 1500L);
AnonymousClass86 anonymousClass86 = new AnonymousClass86();
this.checkRes = anonymousClass86;
this._timer.scheduleAtFixedRate(anonymousClass86, 0L, 500L);
}
public class AnonymousClass85 extends TimerTask {
AnonymousClass85() {
}
@Override
public void run() {
UploadActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
UploadActivity.this.webview1.evaluateJavascript("document.getElementById(\"dUrl\").innerText", new ValueCallback<String>() {
@Override
public void onReceiveValue(String str) {
UploadActivity.this.fileUrl = str.replace("\"", "");
if (UploadActivity.this.fileUrl.equals("null")) {
return;
}
UploadActivity.this.isFinding = false;
UploadActivity.this.download_url.setText(UploadActivity.this.fileUrl);
UploadActivity.this.checkRes.cancel();
SketchwareUtil.showMessage(UploadActivity.this.getApplicationContext(), "Envio concluído!");
UploadActivity.this._Custom_Loading(false);
UploadActivity.this._loadHtml();
}
});
}
});
}
}
public class AnonymousClass86 extends TimerTask {
AnonymousClass86() {
}
@Override
public void run() {
UploadActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
UploadActivity.this.webview1.evaluateJavascript("document.getElementById(\"progress\").innerText", new ValueCallback<String>() {
@Override
public void onReceiveValue(String str) {
if (Double.parseDouble(str.replace("\"", "")) == 100.0d) {
UploadActivity.this.checkRes.cancel();
SketchwareUtil.showMessage(UploadActivity.this.getApplicationContext(), "Progresso Completo!");
}
}
});
}
});
}
}
public void _loadHtml() {
this.webview1.setWebChromeClient(new WebChromeClient() {
protected void openFileChooser(ValueCallback valueCallback, String str) {
UploadActivity.this.mUploadMessage = valueCallback;
Intent intent = new Intent("android.intent.action.GET_CONTENT");
intent.addCategory("android.intent.category.OPENABLE");
intent.setType("image/*");
UploadActivity.this.startActivityForResult(Intent.createChooser(intent, "File Browser"), 1);
}
@Override
public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> valueCallback, WebChromeClient.FileChooserParams fileChooserParams) {
if (UploadActivity.this.uploadMessage != null) {
UploadActivity.this.uploadMessage.onReceiveValue(null);
UploadActivity.this.uploadMessage = null;
}
UploadActivity.this.uploadMessage = valueCallback;
try {
UploadActivity.this.startActivityForResult(fileChooserParams.createIntent(), 100);
return true;
} catch (ActivityNotFoundException unused) {
UploadActivity.this.uploadMessage = null;
Toast.makeText(UploadActivity.this.getApplicationContext(), "Cannot Open File Chooser", 1).show();
return false;
}
}
protected void openFileChooser(ValueCallback<Uri> valueCallback, String str, String str2) {
UploadActivity.this.mUploadMessage = valueCallback;
Intent intent = new Intent("android.intent.action.GET_CONTENT");
intent.addCategory("android.intent.category.OPENABLE");
intent.setType("image/*");
UploadActivity.this.startActivityForResult(Intent.createChooser(intent, "File Browser"), 1);
}
protected void openFileChooser(ValueCallback<Uri> valueCallback) {
UploadActivity.this.mUploadMessage = valueCallback;
Intent intent = new Intent("android.intent.action.GET_CONTENT");
intent.addCategory("android.intent.category.OPENABLE");
intent.setType("image/*");
UploadActivity.this.startActivityForResult(Intent.createChooser(intent, "File Chooser"), 1);
}
});
this.webview1.getSettings().setJavaScriptEnabled(true);
this.webview1.loadUrl("data:text/html,".concat("<input type=\"file\" id=\"fileInput\" />\n<button id = \"uploadBtn\" type=\"button\" onclick=\"uploadFile()\">Upload</button>\n<br />\n<input id = \"fileName\" type = \"text\" placeholder = \"filename\" value = \"test.zip\"/>\n<br />\n<input id = \"folderName\" type = \"text\" placeholder = \"foldername\" value = \"test/testfol/\" />\n<p id = \"dUrl\">null</p>\n<p id = \"progress\">0</p>\n\n<script src=\"https://www.gstatic.com/firebasejs/8.6.5/firebase-app.js\"></script>\n<script src=\"https://www.gstatic.com/firebasejs/8.6.5/firebase-storage.js\"></script>\n<script>\n // Your web app's Firebase configuration\n const firebaseConfig = {\n apiKey: \"AIzaSyBbq27T6GGxJO0pPgo4h7f7pbvKj494Bcg\",\n authDomain: \"sketchware-project-store-e8bea.firebaseapp.com\",\n databaseURL: \"https://sketchware-project-store-e8bea-default-rtdb.firebaseio.com\",\n projectId: \"sketchware-project-store-e8bea\",\n storageBucket: \"sketchware-project-store-e8bea.appspot.com\",\n messagingSenderId: \"133752920784\",\n appId: \"1:133752920784:web:82714d6703b2578b5a5cd5\",\n measurementId: \"G-9WY8XPG895\"\n};\n\n firebase.initializeApp(firebaseConfig);\n\n function uploadFile() {\n // Get the file input element from the HTML document\n const fileInput = document.getElementById(\"fileInput\");\n\tconst progressText = document.getElementById(\"progress\");\n\n // Get the file object from the file input element\n const file = fileInput.files[0];\n\n // Create a reference to the Firebase Storage bucket\n const storage = firebase.storage();\n const storageRef = storage.ref();\n\n // Create a reference to the file location in Firebase Storage\n const fileName = document.getElementById(\"fileName\").value; //file.name;\n\tconst folderName = document.getElementById(\"folderName\").value; //\"files/newFile/\";\n const fileRef = storageRef.child(`${folderName}${fileName}`);\n\n // Upload the file to Firebase Storage\n const uploadTask = fileRef.put(file);\n\n // Set up an event listener to track the upload progress\n uploadTask.on(\n \"state_changed\",\n (snapshot) => {\n // Track the upload progress here\n const progress =\n (snapshot.bytesTransferred / snapshot.totalBytes) * 100;\n\t\t progressText.innerText = progress;\n //console.log(`Upload progress: ${progress}%`);\n },\n (error) => {\n // Handle errors here\n console.error(error);\n },\n async () => {\n // Handle successful upload here\n //console.log('Upload successful!');\n\n // Get the download URL of the uploaded file\n const downloadURL = await fileRef.getDownloadURL();\n document.getElementById(\"dUrl\").innerText = downloadURL;\n console.log(downloadURL);\n\n // Do something with the download URL, such as displaying it to the user\n // or storing it in a database\n }\n );\n }\n</script>\n"));
}
public void _Rewarded_Android_By_HarshTek() {
this.rewarded = MaxRewardedAd.getInstance("dbc2b232e2f4481d", this);
this.rewarded.setListener(new MaxRewardedAdListener() {
@Override
public void onAdClicked(MaxAd maxAd) {
}
@Override
public void onAdHidden(MaxAd maxAd) {
}
@Override
public void onAdLoaded(MaxAd maxAd) {
}
@Override
public void onRewardedVideoCompleted(MaxAd maxAd) {
}
@Override
public void onRewardedVideoStarted(MaxAd maxAd) {
}
@Override
public void onUserRewarded(MaxAd maxAd, MaxReward maxReward) {
}
@Override
public void onAdDisplayed(MaxAd maxAd) {
UploadActivity.this._Rewarded_Android_By_HarshTek();
}
@Override
public void onAdLoadFailed(String str, MaxError maxError) {
maxError.getMessage();
SketchwareUtil.showMessage(UploadActivity.this.getApplicationContext(), "Erro ao carregar anúncios!");
}
@Override
public void onAdDisplayFailed(MaxAd maxAd, MaxError maxError) {
maxError.getMessage();
SketchwareUtil.showMessage(UploadActivity.this.getApplicationContext(), "Erro ao carregar anúncios!");
}
});
this.rewarded.loadAd();
}
@Deprecated
public void showMessage(String str) {
Toast.makeText(getApplicationContext(), str, 0).show();
}
@Deprecated
public int getLocationX(View view) {
int[] iArr = new int[2];
view.getLocationInWindow(iArr);
return iArr[0];
}
@Deprecated
public int getLocationY(View view) {
int[] iArr = new int[2];
view.getLocationInWindow(iArr);
return iArr[1];
}
@Deprecated
public int getRandom(int i, int i2) {
return new Random().nextInt((i2 - i) + 1) + i;
}
@Deprecated
public ArrayList<Double> getCheckedItemPositionsToArray(ListView listView) {
ArrayList<Double> arrayList = new ArrayList<>();
SparseBooleanArray checkedItemPositions = listView.getCheckedItemPositions();
for (int i = 0; i < checkedItemPositions.size(); i++) {
if (checkedItemPositions.valueAt(i)) {
arrayList.add(Double.valueOf(checkedItemPositions.keyAt(i)));
}
}
return arrayList;
}
@Deprecated
public float getDip(int i) {
return TypedValue.applyDimension(1, i, getResources().getDisplayMetrics());
}
@Deprecated
public int getDisplayWidthPixels() {
return getResources().getDisplayMetrics().widthPixels;
}
@Deprecated
public int getDisplayHeightPixels() {
return getResources().getDisplayMetrics().heightPixels;
}
}