正在查看: CleanTube v9.9.5 应用的 SearchVideos.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: CleanTube v9.9.5 应用的 SearchVideos.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.sgebrelibanos.aderaser;
import V2.B;
import V2.D;
import V2.E;
import V2.z;
import W0.G0;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.c;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import c1.y;
import com.sgebrelibanos.aderaser.SearchVideos;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Locale;
import java.util.Objects;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import kotlin.Metadata;
import l1.AbstractC0896b;
import l3.b;
import o1.k;
@Metadata(d1 = {"\u0000N\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\u000e\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\n\n\u0002\u0018\u0002\n\u0002\b\u0006\u0018\u00002\u00020\u00012\u00020\u0002B\u0007¢\u0006\u0004\b\u0003\u0010\u0004J\u0019\u0010\b\u001a\u00020\u00072\b\u0010\u0006\u001a\u0004\u0018\u00010\u0005H\u0014¢\u0006\u0004\b\b\u0010\tJ+\u0010\u000f\u001a\u00020\u00072\u0006\u0010\u000b\u001a\u00020\n2\u0006\u0010\f\u001a\u00020\n2\n\b\u0001\u0010\u000e\u001a\u0004\u0018\u00010\rH\u0014¢\u0006\u0004\b\u000f\u0010\u0010J!\u0010\u0014\u001a\u00020\u00072\b\u0010\u0012\u001a\u0004\u0018\u00010\u00112\u0006\u0010\u0013\u001a\u00020\nH\u0016¢\u0006\u0004\b\u0014\u0010\u0015J\u0015\u0010\u0018\u001a\u00020\u00072\u0006\u0010\u0017\u001a\u00020\u0016¢\u0006\u0004\b\u0018\u0010\u0019J\u0019\u0010\u001b\u001a\u00020\u00072\b\u0010\u001a\u001a\u0004\u0018\u00010\rH\u0014¢\u0006\u0004\b\u001b\u0010\u001cR\"\u0010$\u001a\u00020\u001d8\u0006@\u0006X\u0086.¢\u0006\u0012\n\u0004\b\u001e\u0010\u001f\u001a\u0004\b \u0010!\"\u0004\b\"\u0010#R\u0014\u0010'\u001a\u00020\n8\u0002X\u0082D¢\u0006\u0006\n\u0004\b%\u0010&R\u001d\u0010-\u001a\b\u0012\u0004\u0012\u00020\u00160(8\u0006¢\u0006\f\n\u0004\b)\u0010*\u001a\u0004\b+\u0010,¨\u0006."}, d2 = {"Lcom/sgebrelibanos/aderaser/SearchVideos;", "Landroidx/appcompat/app/c;", "LW0/G0$a;", "<init>", "()V", "Landroid/os/Bundle;", "savedInstanceState", "Lc1/y;", "onCreate", "(Landroid/os/Bundle;)V", "", "requestCode", "resultCode", "Landroid/content/Intent;", "data", "onActivityResult", "(IILandroid/content/Intent;)V", "Landroid/view/View;", "view", "position", "a", "(Landroid/view/View;I)V", "", "query", "K0", "(Ljava/lang/String;)V", "intent", "onNewIntent", "(Landroid/content/Intent;)V", "LW0/G0;", "B", "LW0/G0;", "u0", "()LW0/G0;", "J0", "(LW0/G0;)V", "adapter", "C", "I", "REQUEST_CODE_SPEECH_INPUT", "Ljava/util/ArrayList;", "D", "Ljava/util/ArrayList;", "v0", "()Ljava/util/ArrayList;", "searchSuggestions", "app_release"}, k = 1, mv = {1, 7, 1}, xi = 48)
public final class SearchVideos extends c implements G0.a {
public G0 adapter;
private final int REQUEST_CODE_SPEECH_INPUT = 1;
private final ArrayList searchSuggestions = new ArrayList();
public static final class a implements TextWatcher {
final ConstraintLayout f10803a;
final RecyclerView f10804b;
final SearchVideos f10805c;
final EditText f10806d;
a(ConstraintLayout constraintLayout, RecyclerView recyclerView, SearchVideos searchVideos, EditText editText) {
this.f10803a = constraintLayout;
this.f10804b = recyclerView;
this.f10805c = searchVideos;
this.f10806d = editText;
}
@Override
public void afterTextChanged(Editable editable) {
k.f(editable, "s");
}
@Override
public void beforeTextChanged(CharSequence charSequence, int i4, int i5, int i6) {
k.f(charSequence, "s");
}
@Override
public void onTextChanged(CharSequence charSequence, int i4, int i5, int i6) {
k.f(charSequence, "s");
this.f10803a.setVisibility(8);
this.f10804b.setVisibility(0);
this.f10805c.getSearchSuggestions().clear();
this.f10805c.K0(this.f10806d.getText().toString());
}
}
public static final void A0(TextView textView, SearchVideos searchVideos, View view) {
k.f(searchVideos, "this$0");
w0(searchVideos, textView.getText().toString());
}
public static final void B0(TextView textView, SearchVideos searchVideos, View view) {
k.f(searchVideos, "this$0");
w0(searchVideos, textView.getText().toString());
}
public static final void C0(TextView textView, SearchVideos searchVideos, View view) {
k.f(searchVideos, "this$0");
w0(searchVideos, textView.getText().toString());
}
public static final void D0(TextView textView, SearchVideos searchVideos, View view) {
k.f(searchVideos, "this$0");
w0(searchVideos, textView.getText().toString());
}
public static final void E0(SearchVideos searchVideos, View view) {
k.f(searchVideos, "this$0");
searchVideos.finish();
}
public static final void F0(SearchVideos searchVideos, View view) {
k.f(searchVideos, "this$0");
Intent intent = new Intent("android.speech.action.RECOGNIZE_SPEECH");
intent.putExtra("android.speech.extra.LANGUAGE_MODEL", "free_form");
intent.putExtra("android.speech.extra.LANGUAGE", Locale.getDefault());
intent.putExtra("android.speech.extra.PROMPT", "Speech to Text");
try {
searchVideos.startActivityForResult(intent, searchVideos.REQUEST_CODE_SPEECH_INPUT);
} catch (Exception e4) {
Toast.makeText(searchVideos.getApplicationContext(), ' ' + e4.getMessage(), 0).show();
}
}
public static final void G0(SearchVideos searchVideos, EditText editText, View view) {
k.f(searchVideos, "this$0");
I0(searchVideos, editText);
}
public static final boolean H0(SearchVideos searchVideos, EditText editText, TextView textView, int i4, KeyEvent keyEvent) {
k.f(searchVideos, "this$0");
SharedPreferences sharedPreferences = searchVideos.getSharedPreferences("History", 0);
SharedPreferences.Editor edit = sharedPreferences.edit();
String string = sharedPreferences.getString("History_1", "");
String string2 = sharedPreferences.getString("History_2", "");
String string3 = sharedPreferences.getString("History_3", "");
String string4 = sharedPreferences.getString("History_4", "");
String string5 = sharedPreferences.getString("History_5", "");
edit.putString("History_1", editText.getText().toString());
edit.putString("History_2", string);
edit.putString("History_3", string2);
edit.putString("History_4", string3);
edit.putString("History_5", string4);
edit.putString("History_6", string5);
edit.apply();
editText.setFocusableInTouchMode(true);
editText.requestFocus();
searchVideos.setIntent(new Intent(searchVideos, (Class<?>) MainActivity.class));
searchVideos.getIntent().putExtra("query", editText.getText().toString());
searchVideos.setResult(7, searchVideos.getIntent());
searchVideos.startActivity(searchVideos.getIntent());
return true;
}
private static final void I0(SearchVideos searchVideos, EditText editText) {
searchVideos.setIntent(new Intent(searchVideos, (Class<?>) MainActivity.class));
searchVideos.getIntent().putExtra("query", editText.getText().toString());
Log.d("Search", "Search Query is " + ((Object) editText.getText()));
searchVideos.setResult(7, searchVideos.getIntent());
searchVideos.startActivity(searchVideos.getIntent());
}
public static final void L0(String str, final SearchVideos searchVideos) {
k.f(str, "$query");
k.f(searchVideos, "this$0");
try {
D e4 = new z().c(new B.a().r(new URL("https://suggestqueries-clients6.youtube.com/complete/search?client=youtube-reduced&hl=en&gs_ri=youtube-reduced&ds=yt&cp=3&gs_id=100&q=" + str + "&xhr=t&xssi=t&gl=us")).a()).e();
try {
if (!e4.F()) {
throw new IOException("Unexpected code " + e4);
}
E a4 = e4.a();
k.c(a4);
String k4 = a4.k();
Pattern compile = Pattern.compile("\\[\"(.*?)\"");
k.e(compile, "compile(\"\\\\[\\\"(.*?)\\\"\")");
Matcher matcher = compile.matcher(k4);
k.e(matcher, "regex.matcher(returnedResponse)");
int i4 = -1;
while (matcher.find()) {
i4++;
if (i4 != 0) {
searchVideos.searchSuggestions.add(b.a(matcher.group(1)));
searchVideos.runOnUiThread(new Runnable() {
@Override
public final void run() {
SearchVideos.M0(SearchVideos.this);
}
});
}
}
y yVar = y.f9045a;
AbstractC0896b.a(e4, null);
} finally {
}
} catch (Exception e5) {
e5.printStackTrace();
}
}
public static final void M0(SearchVideos searchVideos) {
k.f(searchVideos, "this$0");
searchVideos.u0().h();
}
private static final void w0(SearchVideos searchVideos, String str) {
searchVideos.setIntent(new Intent(searchVideos, (Class<?>) MainActivity.class));
searchVideos.getIntent().putExtra("query", str);
searchVideos.setResult(7, searchVideos.getIntent());
searchVideos.startActivity(searchVideos.getIntent());
}
private static final boolean x0(SearchVideos searchVideos) {
return (searchVideos.getResources().getConfiguration().uiMode & 48) == 32;
}
public static final void y0(TextView textView, SearchVideos searchVideos, View view) {
k.f(searchVideos, "this$0");
w0(searchVideos, textView.getText().toString());
}
public static final void z0(TextView textView, SearchVideos searchVideos, View view) {
k.f(searchVideos, "this$0");
w0(searchVideos, textView.getText().toString());
}
public final void J0(G0 g02) {
k.f(g02, "<set-?>");
this.adapter = g02;
}
public final void K0(final String query) {
k.f(query, "query");
this.searchSuggestions.clear();
new Thread(new Runnable() {
@Override
public final void run() {
SearchVideos.L0(query, this);
}
}).start();
}
@Override
public void a(View view, int position) {
SharedPreferences sharedPreferences = getSharedPreferences("History", 0);
SharedPreferences.Editor edit = sharedPreferences.edit();
String string = sharedPreferences.getString("History_1", "");
String string2 = sharedPreferences.getString("History_2", "");
String string3 = sharedPreferences.getString("History_3", "");
String string4 = sharedPreferences.getString("History_4", "");
String string5 = sharedPreferences.getString("History_5", "");
edit.putString("History_1", u0().v(position));
edit.putString("History_2", string);
edit.putString("History_3", string2);
edit.putString("History_4", string3);
edit.putString("History_5", string4);
edit.putString("History_6", string5);
edit.apply();
Intent intent = new Intent(this, (Class<?>) MainActivity.class);
intent.putExtra("query", u0().v(position));
startActivity(intent);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == this.REQUEST_CODE_SPEECH_INPUT && resultCode == -1 && data != null) {
ArrayList<String> stringArrayListExtra = data.getStringArrayListExtra("android.speech.extra.RESULTS");
EditText editText = (EditText) findViewById(2131362283);
Objects.requireNonNull(stringArrayListExtra);
String str = stringArrayListExtra.get(0);
if (str == null) {
str = "";
}
editText.setText(str, TextView.BufferType.EDITABLE);
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
ConstraintLayout constraintLayout;
ImageButton imageButton;
ImageButton imageButton2;
final EditText editText;
super.onCreate(savedInstanceState);
setContentView(2131558436);
EditText editText2 = (EditText) findViewById(2131362283);
View findViewById = findViewById(2131361900);
k.e(findViewById, "findViewById(R.id.backButton)");
ImageButton imageButton3 = (ImageButton) findViewById;
View findViewById2 = findViewById(2131362285);
k.e(findViewById2, "findViewById(R.id.search_button)");
ImageButton imageButton4 = (ImageButton) findViewById2;
View findViewById3 = findViewById(2131362436);
k.e(findViewById3, "findViewById(R.id.voice_search_button)");
ImageButton imageButton5 = (ImageButton) findViewById3;
ConstraintLayout constraintLayout2 = (ConstraintLayout) findViewById(2131362225);
ConstraintLayout constraintLayout3 = (ConstraintLayout) findViewById(2131362075);
ImageView imageView = (ImageView) findViewById(2131362076);
ImageView imageView2 = (ImageView) findViewById(2131362077);
ImageView imageView3 = (ImageView) findViewById(2131362078);
ImageView imageView4 = (ImageView) findViewById(2131362079);
ImageView imageView5 = (ImageView) findViewById(2131362080);
ImageView imageView6 = (ImageView) findViewById(2131362081);
final TextView textView = (TextView) findViewById(2131362088);
final TextView textView2 = (TextView) findViewById(2131362089);
final TextView textView3 = (TextView) findViewById(2131362090);
final TextView textView4 = (TextView) findViewById(2131362091);
final TextView textView5 = (TextView) findViewById(2131362092);
final TextView textView6 = (TextView) findViewById(2131362093);
ConstraintLayout constraintLayout4 = (ConstraintLayout) findViewById(2131362082);
ConstraintLayout constraintLayout5 = (ConstraintLayout) findViewById(2131362083);
ConstraintLayout constraintLayout6 = (ConstraintLayout) findViewById(2131362084);
ConstraintLayout constraintLayout7 = (ConstraintLayout) findViewById(2131362085);
ConstraintLayout constraintLayout8 = (ConstraintLayout) findViewById(2131362086);
ConstraintLayout constraintLayout9 = (ConstraintLayout) findViewById(2131362087);
SharedPreferences sharedPreferences = getSharedPreferences("History", 0);
sharedPreferences.edit();
String string = sharedPreferences.getString("History_1", "");
String string2 = sharedPreferences.getString("History_2", "");
String string3 = sharedPreferences.getString("History_3", "");
String string4 = sharedPreferences.getString("History_4", "");
String string5 = sharedPreferences.getString("History_5", "");
String string6 = sharedPreferences.getString("History_6", "");
View findViewById4 = findViewById(2131362281);
k.e(findViewById4, "findViewById(R.id.searchSuggestions)");
RecyclerView recyclerView = (RecyclerView) findViewById4;
recyclerView.setLayoutManager(new LinearLayoutManager(this));
J0(new G0(this, this.searchSuggestions));
u0().y(this);
recyclerView.setAdapter(u0());
textView.setText(string);
textView2.setText(string2);
textView3.setText(string3);
textView4.setText(string4);
textView5.setText(string5);
textView6.setText(string6);
if (string6 == null || string6.length() != 0) {
constraintLayout = constraintLayout3;
} else {
constraintLayout = constraintLayout3;
constraintLayout.setVisibility(8);
recyclerView.setVisibility(0);
}
constraintLayout4.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SearchVideos.y0(textView, this, view);
}
});
constraintLayout5.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SearchVideos.z0(textView2, this, view);
}
});
constraintLayout6.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SearchVideos.A0(textView3, this, view);
}
});
constraintLayout7.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SearchVideos.B0(textView4, this, view);
}
});
constraintLayout8.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SearchVideos.C0(textView5, this, view);
}
});
constraintLayout9.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SearchVideos.D0(textView6, this, view);
}
});
imageButton3.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SearchVideos.E0(SearchVideos.this, view);
}
});
if (x0(this)) {
constraintLayout2.setBackgroundResource(2131099696);
editText = editText2;
editText.setTextColor(androidx.core.content.a.b(getApplicationContext(), 2131099699));
editText.setHintTextColor(androidx.core.content.a.b(getApplicationContext(), 2131099750));
editText.setBackgroundResource(2131230853);
imageButton3.setImageResource(2131230872);
imageButton2 = imageButton4;
imageButton2.setImageResource(2131230889);
imageButton = imageButton5;
imageButton.setImageResource(2131230882);
imageView.setImageResource(2131230879);
imageView2.setImageResource(2131230879);
imageView3.setImageResource(2131230879);
imageView4.setImageResource(2131230879);
imageView5.setImageResource(2131230879);
imageView6.setImageResource(2131230879);
} else {
imageButton = imageButton5;
imageButton2 = imageButton4;
editText = editText2;
if (!x0(this)) {
constraintLayout2.setBackgroundResource(2131099699);
editText.setBackgroundResource(2131230998);
editText.setTextColor(androidx.core.content.a.b(getApplicationContext(), 2131099696));
editText.setHintTextColor(androidx.core.content.a.b(getApplicationContext(), 2131100078));
imageButton3.setImageResource(2131230871);
imageButton2.setImageResource(2131230888);
imageButton.setImageResource(2131230881);
imageView.setImageResource(2131230878);
imageView2.setImageResource(2131230878);
imageView3.setImageResource(2131230878);
imageView4.setImageResource(2131230878);
imageView5.setImageResource(2131230878);
imageView6.setImageResource(2131230878);
}
}
imageButton.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SearchVideos.F0(SearchVideos.this, view);
}
});
imageButton2.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SearchVideos.G0(SearchVideos.this, editText, view);
}
});
editText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public final boolean onEditorAction(TextView textView7, int i4, KeyEvent keyEvent) {
boolean H02;
H02 = SearchVideos.H0(SearchVideos.this, editText, textView7, i4, keyEvent);
return H02;
}
});
String stringExtra = getIntent().getStringExtra("quickQuery");
if (stringExtra != null) {
constraintLayout.setVisibility(8);
recyclerView.setVisibility(0);
K0(stringExtra);
editText.setText(stringExtra, TextView.BufferType.EDITABLE);
}
editText.addTextChangedListener(new a(constraintLayout, recyclerView, this, editText));
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
String stringExtra = intent != null ? intent.getStringExtra("quickQuery") : null;
ConstraintLayout constraintLayout = (ConstraintLayout) findViewById(2131362075);
View findViewById = findViewById(2131362281);
k.e(findViewById, "findViewById(R.id.searchSuggestions)");
RecyclerView recyclerView = (RecyclerView) findViewById;
EditText editText = (EditText) findViewById(2131362283);
Log.d("SearchVideos", "OnNewIntentCalled");
if (stringExtra != null) {
constraintLayout.setVisibility(8);
recyclerView.setVisibility(0);
K0(stringExtra);
editText.setText(stringExtra, TextView.BufferType.EDITABLE);
}
}
public final G0 u0() {
G0 g02 = this.adapter;
if (g02 != null) {
return g02;
}
k.s("adapter");
return null;
}
public final ArrayList getSearchSuggestions() {
return this.searchSuggestions;
}
}