|
| 1 | +package com.v2ray.ang.gfwknocker; |
| 2 | + |
| 3 | +import androidx.annotation.NonNull; |
| 4 | +import androidx.annotation.Nullable; |
| 5 | +import androidx.appcompat.app.ActionBar; |
| 6 | +import androidx.appcompat.app.AppCompatActivity; |
| 7 | + |
| 8 | +import android.content.Intent; |
| 9 | +import android.os.Bundle; |
| 10 | +import android.view.MenuItem; |
| 11 | +import android.view.View; |
| 12 | +import android.webkit.WebView; |
| 13 | +import android.widget.Button; |
| 14 | +import android.widget.TextView; |
| 15 | +import android.widget.Toast; |
| 16 | + |
| 17 | +import com.v2ray.ang.R; |
| 18 | +import com.v2ray.ang.ui.MainActivity; |
| 19 | +import com.v2ray.ang.util.AngConfigManager; |
| 20 | +import com.v2ray.ang.util.MmkvManager; |
| 21 | + |
| 22 | +public class GFW_youtube_config_Activity extends AppCompatActivity { |
| 23 | + |
| 24 | + |
| 25 | + @Override |
| 26 | + protected void onCreate(Bundle savedInstanceState) { |
| 27 | + super.onCreate(savedInstanceState); |
| 28 | + setContentView(R.layout.activity_gfw_youtube_config); |
| 29 | + |
| 30 | + ActionBar actionBar = getSupportActionBar(); |
| 31 | + if(actionBar!=null) { |
| 32 | + actionBar.setDisplayHomeAsUpEnabled(true); |
| 33 | + } |
| 34 | +// |
| 35 | +// String url_ADS_txt = mystrg.get_value("url_ADS_txt",getResources().getString(R.string.announcement_txt_url)); |
| 36 | +// String url_ADS_html = mystrg.get_value("url_ADS_html",getResources().getString(R.string.announcement_html_url)); |
| 37 | + |
| 38 | + |
| 39 | + Button btn = (Button) findViewById(R.id.btn_youtube_config); |
| 40 | + |
| 41 | + btn.setOnClickListener(new View.OnClickListener() { |
| 42 | + @Override |
| 43 | + public void onClick(View v) { |
| 44 | + |
| 45 | + String server = "vmess://ew0KICAidiI6ICIyIiwNCiAgInBzIjogIllvdXR1YmUgJiBUd2l0dGVyIiwNCiAgImFkZCI6ICJnZncueW91dHViZS5jb20iLA0KICAicG9ydCI6ICI0NDMiLA0KICAiaWQiOiAiZTA4NTUxMTktNGIxOC00MDQ1LWI5MDMtOGY2OTliMGM1NDE0IiwNCiAgImFpZCI6ICIwIiwNCiAgInNjeSI6ICJhdXRvIiwNCiAgIm5ldCI6ICJ0Y3AiLA0KICAidHlwZSI6ICJub25lIiwNCiAgImhvc3QiOiAiIiwNCiAgInBhdGgiOiAiIiwNCiAgInRscyI6ICIiLA0KICAic25pIjogIiIsDQogICJhbHBuIjogIiIsDQogICJmcCI6ICIiDQp9"; |
| 46 | + String mahsa_subid = MmkvManager.INSTANCE.import_Mahsa_Subscription("GFW-knocker"); |
| 47 | + AngConfigManager.INSTANCE.importBatchConfig(server, mahsa_subid , false); |
| 48 | + |
| 49 | + Toast.makeText(GFW_youtube_config_Activity.this,"enjoy direct Youtube & Twitter",Toast.LENGTH_LONG).show(); |
| 50 | + } |
| 51 | + }); |
| 52 | + |
| 53 | + |
| 54 | + } |
| 55 | + |
| 56 | + |
| 57 | + @Override |
| 58 | + public boolean onOptionsItemSelected(@NonNull MenuItem item){ |
| 59 | + if (item.getItemId() == android.R.id.home) { |
| 60 | + this.finish(); |
| 61 | + return true; |
| 62 | + } |
| 63 | + return super.onOptionsItemSelected(item); |
| 64 | + } |
| 65 | + |
| 66 | + |
| 67 | +} |
| 68 | + |
0 commit comments