Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .Jules/palette.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 2024-05-13 - [Accessibility vs Metadata]
**Learning:** Adding `android:contentDescription` to a `TextView` that already contains meaningful, user-actionable text (like a shell command) can be counter-productive. It causes screen readers to read the description *instead* of the content, effectively hiding the actual data from the user.
**Action:** Only use `contentDescription` for non-textual elements (images, icons) or when the textual content is ambiguous. For actionable text, ensure the text itself is descriptive or use `android:hint` if appropriate.
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,15 @@

import androidx.appcompat.app.AppCompatActivity;

import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import com.bytedance.shadowhook.ShadowHook;
import com.bytedance.shadowhook.systest.SysTest;
Expand All @@ -46,6 +51,21 @@ public class MainActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

TextView logcatCommand = findViewById(R.id.logcat_command);
logcatCommand.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clip = ClipData.newPlainText("logcat_command", ((TextView) v).getText());
if (clipboard != null) {
clipboard.setPrimaryClip(clip);
Toast.makeText(MainActivity.this, "Command copied to clipboard", Toast.LENGTH_SHORT).show();
return true;
}
return false;
}
});
}

public void onUnitTestHookSymAddrClick(View view) {
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
android:orientation="vertical">

<TextView style="@style/Theme.TextView.Top"
android:id="@+id/logcat_command"
android:text="adb logcat -b main -s shadowhook_tag" />

<TextView style="@style/Theme.TextView.Title"
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'com.android.application' version '7.4.2' apply false
id 'com.android.library' version '7.4.2' apply false
id 'com.android.application' version '8.2.2' apply false
id 'com.android.library' version '8.2.2' apply false
}

task clean(type: Delete) {
Expand All @@ -12,7 +12,7 @@ ext {
compileSdkVersion = 34
targetSdkVersion = 34
buildToolsVersion = '34.0.0'
javaVersion = JavaVersion.VERSION_1_7
javaVersion = JavaVersion.VERSION_1_8
ndkVersion = "23.2.8568313"
cmakeVersion = "3.22.1"
abiFilters = "armeabi-v7a,arm64-v8a"
Expand Down
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ android.useAndroidX=true
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
#android.prefabVersion=2.0.0
android.disableAutomaticComponentCreation=true
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Dec 30 21:41:31 CST 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME