Skip to content

Commit cdaf61e

Browse files
committed
Removing screenshot output
1 parent 57360df commit cdaf61e

File tree

4 files changed

+26
-25
lines changed

4 files changed

+26
-25
lines changed

.idea/gradle.xml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/release/app-release.apk

180 KB
Binary file not shown.

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<intent-filter>
1515
<action android:name="android.accessibilityservice.AccessibilityService" />
1616
</intent-filter>
17+
1718
<meta-data
1819
android:name="android.accessibilityservice"
1920
android:resource="@xml/accessibility_service_config" />

app/src/main/java/com/jwlilly/accessibilityinspector/AccessibilityInspector.java

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public void toggleShowNotImportant() {
157157
public void sendWithScreenshot() {
158158
try {
159159
JSONObject combinedJson = new JSONObject();
160-
combinedJson.put("screenshot", screenshot);
160+
//combinedJson.put("screenshot", screenshot);
161161
combinedJson.putOpt("views", jsonObject);
162162
Intent announcementIntent = new Intent(SocketService.BROADCAST_MESSAGE, null, this, SocketService.class);
163163
SocketService.data = compress(combinedJson.toString());
@@ -186,28 +186,29 @@ public void startCapture() {
186186
List<AccessibilityWindowInfo> windows = getWindows();
187187

188188
TreeDebug.logNodeTrees(windows, _this);
189-
takeScreenshot(Display.DEFAULT_DISPLAY,
190-
getApplicationContext().getMainExecutor(), new TakeScreenshotCallback() {
191-
@RequiresApi(api = Build.VERSION_CODES.R)
192-
@Override
193-
public void onSuccess(@NonNull ScreenshotResult screenshotResult) {
194-
195-
Log.i("ScreenShotResult","onSuccess");
196-
Bitmap bitmap = Bitmap.wrapHardwareBuffer(screenshotResult.getHardwareBuffer(),screenshotResult.getColorSpace());
197-
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
198-
bitmap.compress(Bitmap.CompressFormat.PNG, 50, byteArrayOutputStream);
199-
byte[] byteArray = byteArrayOutputStream.toByteArray();
200-
String encoded = Base64.encodeToString(byteArray, Base64.NO_WRAP);
201-
screenshot = encoded;
202-
sendWithScreenshot();
203-
}
204-
205-
@Override
206-
public void onFailure(int i) {
207-
Log.i("ScreenShotResult","onFailure code is "+ i);
208-
sendWithoutScreenshot();
209-
}
210-
});
189+
sendWithScreenshot();
190+
// takeScreenshot(Display.DEFAULT_DISPLAY,
191+
// getApplicationContext().getMainExecutor(), new TakeScreenshotCallback() {
192+
// @RequiresApi(api = Build.VERSION_CODES.R)
193+
// @Override
194+
// public void onSuccess(@NonNull ScreenshotResult screenshotResult) {
195+
//
196+
// Log.i("ScreenShotResult","onSuccess");
197+
// Bitmap bitmap = Bitmap.wrapHardwareBuffer(screenshotResult.getHardwareBuffer(),screenshotResult.getColorSpace());
198+
// ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
199+
// bitmap.compress(Bitmap.CompressFormat.PNG, 50, byteArrayOutputStream);
200+
// byte[] byteArray = byteArrayOutputStream.toByteArray();
201+
// String encoded = Base64.encodeToString(byteArray, Base64.NO_WRAP);
202+
// screenshot = encoded;
203+
// sendWithScreenshot();
204+
// }
205+
//
206+
// @Override
207+
// public void onFailure(int i) {
208+
// Log.i("ScreenShotResult","onFailure code is "+ i);
209+
// sendWithoutScreenshot();
210+
// }
211+
// });
211212
}
212213

213214
public static byte[] compress(String string) throws IOException {

0 commit comments

Comments
 (0)