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 @@
## 2026-07-03 - [Android Sample App Feedback Pattern]
**Learning:** For Android apps involving background or native operations (like library loading or hooking), immediate visual feedback via Toasts and button state updates (disabling + text change) significantly improves perceived responsiveness and prevents redundant interactions.
**Action:** Always implement 'click-disable-update' logic for one-way state transitions like library loading, and use Toasts to bridge the gap between UI actions and silent native/background processes.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import com.bytedance.shadowhook.ShadowHook;
import com.bytedance.shadowhook.systest.SysTest;
Expand All @@ -50,37 +52,49 @@ protected void onCreate(Bundle savedInstanceState) {

public void onUnitTestHookSymAddrClick(View view) {
NativeHandler.nativeHookSymAddr(Build.VERSION.SDK_INT);
Toast.makeText(this, "Hook by symbol address", Toast.LENGTH_SHORT).show();
}

public void onUnitTestHookSymNameClick(View view) {
NativeHandler.nativeHookSymName(Build.VERSION.SDK_INT);
Toast.makeText(this, "Hook by symbol name", Toast.LENGTH_SHORT).show();
}

public void onUnitTestUnhookClick(View view) {
NativeHandler.nativeUnhook();
Toast.makeText(this, "Unhooked", Toast.LENGTH_SHORT).show();
}

public void onUnitTestLoadClick(View view) {
if(!hookee2Loaded) {
hookee2Loaded = true;
System.loadLibrary("hookee2");

Button btn = (Button)view;
btn.setText("libhookee2.so loaded");
btn.setEnabled(false);
Toast.makeText(this, "libhookee2.so loaded", Toast.LENGTH_SHORT).show();
}
}

public void onUnitTestRunClick(View view) {
NativeHandler.nativeRun(hookee2Loaded);
Toast.makeText(this, "Unit test run", Toast.LENGTH_SHORT).show();
}

public void onSystemTestHookClick(View view) {
SysTest.hook();
Toast.makeText(this, "System test hook", Toast.LENGTH_SHORT).show();
}

public void onSystemTestUnhookClick(View view) {
SysTest.unhook();
Toast.makeText(this, "System test unhook", Toast.LENGTH_SHORT).show();
}

public void onSystemTestRunClick(View view) {
SysTest.run();
Toast.makeText(this, "System test run", Toast.LENGTH_SHORT).show();
}

public void onGetRecordsClick(View view) {
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