Android 字符串编码解密挑战 - 解锁隐藏信息
package com.example.ilililililil; \nimport android.os.Bundle; \nimport android.view.View; \nimport android.widget.Button; \nimport android.widget.EditText; \nimport android.widget.Toast; \nimport androidx.appcompat.app.AppCompatActivity; \n\npublic class MainActivity extends AppCompatActivity { \n public static Encoder encoder; \n public static MainActlvity mainActlvity; \n\n /* access modifiers changed from: protected / \n public void onCreate(Bundle bundle) { \n super.onCreate(bundle); \n setContentView((int) R.layout.activity_main); \n encoder = new Encoder(); \n mainActlvity = new MainActlvity(); \n ((Button) findViewById(R.id.button)).setOnClickListener(new View.OnClickListener((EditText) findViewById(R.id.edit_text)) { \n public final / synthetic / EditText f$1; \n\n { \n this.f$1 = r2; \n } \n\n public final void onClick(View view) { \n MainActivity.this.lambda$onCreate$0$MainActivity(this.f$1, view); \n } \n }); \n } \n\n public / synthetic */ void lambda$onCreate$0$MainActivity(EditText editText, View view) { \n System.out.println(encoder.encode(editText.getText().toString())); \n if (encoder.encode(editText.getText().toString()).equals("棿棢棢棲棥棷棊棐棁棚棨棨棵棢棌")) { \n Toast.makeText(this, "YES", 0).show(); \n } else { \n Toast.makeText(this, "NO", 0).show(); \n } \n } \n} \npackage com.example.ilililililil; \n\npublic class Encoder { \n private int key = 123456789; \n\n public String encode(String str) { \n StringBuilder sb = new StringBuilder(); \n for (char c : str.toCharArray()) { \n sb.append((char) (c ^ this.key)); \n } \n return sb.toString(); \n } \n} \nflag: YES
原文地址: https://www.cveoy.top/t/topic/pWRN 著作权归作者所有。请勿转载和采集!