ad-free icon indicating copy to clipboard operation
ad-free copied to clipboard

Extend AccuradioDetector to bigcontentview

Open abertschi opened this issue 1 year ago • 10 comments

AccuradioDetector only parses contentview, extend it to include (now deprecated) bigcontentview.

https://developer.android.com/reference/android/app/Notification#bigContentView

</android.service.notification.StatusBarNotification><android.service.notification.StatusBarNotification>
  <groupKey>0|com.slipstream.accuradio|101|null|10295</groupKey>
  <id>101</id>
  <initialPid>5166</initialPid>
  <key>0|com.slipstream.accuradio|101|null|10295</key>
  <notification>
    <allPendingIntents>
      <mArray>
        <android.app.PendingIntent>
          <mTarget class="android.content.IIntentSender$Stub$Proxy">
            <mRemote class="android.os.BinderProxy"/>
          </mTarget>
          <mWhitelistToken class="android.os.BinderProxy"/>
        </android.app.PendingIntent>
        <android.app.PendingIntent>
          <mTarget class="android.content.IIntentSender$Stub$Proxy">
            <mRemote class="android.os.BinderProxy"/>
          </mTarget>
          <mWhitelistToken class="android.os.BinderProxy" reference="../../android.app.PendingIntent/mWhitelistToken"/>
        </android.app.PendingIntent>
      </mArray>
      <mHashes>
        <int>98166312</int>
        <int>215441217</int>
      </mHashes>
      <mIdentityHashCode>false</mIdentityHashCode>
      <mSize>2</mSize>
    </allPendingIntents>
    <audioAttributes>
      <mContentType>4</mContentType>
      <mFlags>2048</mFlags>
      <mFormattedTags></mFormattedTags>
      <mSource>-1</mSource>
      <mTags/>
      <mUsage>5</mUsage>
    </audioAttributes>
    <audioStreamType>-1</audioStreamType>
    <bigContentView>
      <mActions>
        <android.widget.RemoteViews_-ReflectionAction>
          <viewId>2131296728</viewId>
          <methodName>setVisibility</methodName>
          <value class="int">8</value>
        </android.widget.RemoteViews_-ReflectionAction>
        <android.widget.RemoteViews_-ReflectionAction>
          <viewId>2131296758</viewId>
          <methodName>setVisibility</methodName>
          <value class="int">8</value>
        </android.widget.RemoteViews_-ReflectionAction>
        <android.widget.RemoteViews_-ReflectionAction>
          <viewId>2131296800</viewId>
          <methodName>setVisibility</methodName>
          <value class="int">8</value>
        </android.widget.RemoteViews_-ReflectionAction>
        <android.widget.RemoteViews_-ReflectionAction>
          <viewId>2131296703</viewId>
          <methodName>setText</methodName>
          <value class="string"></value>
        </android.widget.RemoteViews_-ReflectionAction>
        <android.widget.RemoteViews_-ReflectionAction>
          <viewId>2131296702</viewId>
          <methodName>setText</methodName>
          <value class="string">Music will resume shortly...</value>
        </android.widget.RemoteViews_-ReflectionAction>
        <android.widget.RemoteViews_-ReflectionAction>
          <viewId>2131296399</viewId>
          <methodName>setText</methodName>
          <value class="string">1980s Hits</value>
        </android.widget.RemoteViews_-ReflectionAction>
        <android.widget.RemoteViews_-ReflectionAction>
          <viewId>2131296810</viewId>
          <methodName>setImageResource</methodName>
          <value class="int">2131230805</value>
        </android.widget.RemoteViews_-ReflectionAction>
        <android.widget.RemoteViews_-SetOnClickResponse>
          <viewId>2131296758</viewId>
        </android.widget.RemoteViews_-SetOnClickResponse>
      </mActions>
      <mApplication>
        <banner>0</banner>
        <icon>2131230927</icon>
        <labelRes>2131755044</labelRes>
        <logo>0</logo>
        <name>com.slipstream.accuradio.AccuRadioApplication</name>
        <packageName>com.slipstream.accuradio</packageName>
        <showUserIcon>-10000</showUserIcon>
        <appComponentFactory>androidx.core.app.CoreComponentFactory</appComponentFactory>
        <category>-1</category>
        <className>com.slipstream.accuradio.AccuRadioApplication</className>
        <compatibleWidthLimitDp>0</compatibleWidthLimitDp>
        <compileSdkVersion>31</compileSdkVersion>
        <compileSdkVersionCodename>12</compileSdkVersionCodename>
        <credentialProtectedDataDir>/data/user/0/com.slipstream.accuradio</credentialProtectedDataDir>
        <dataDir>/data/user/0/com.slipstream.accuradio</dataDir>
        <descriptionRes>0</descriptionRes>
        <deviceProtectedDataDir>/data/user_de/0/com.slipstream.accuradio</deviceProtectedDataDir>
        <enabled>true</enabled>
        <enabledSetting>0</enabledSetting>
        <flags>551075396</flags>
        <fullBackupContent>0</fullBackupContent>
        <installLocation>-1</installLocation>
        <largestWidthLimitDp>0</largestWidthLimitDp>
        <longVersionCode>83</longVersionCode>
        <mHiddenApiPolicy>-1</mHiddenApiPolicy>
        <maxAspectRatio>0.0</maxAspectRatio>
        <minSdkVersion>23</minSdkVersion>

#83 @unseenlarks

abertschi avatar Nov 29 '23 14:11 abertschi

  • Additionally, we can add a feature to use reflection and compare all string fields to match one of the user entries in Generic Text Detector. This will make the Generic Text Detector work with custom notification content that uses unconventional fields to store text but comes with a performance/ battery penalty.

abertschi avatar Nov 29 '23 14:11 abertschi

thank you for looking into this. :)

unseenlarks avatar Nov 29 '23 14:11 unseenlarks

Fixed in #94

abertschi avatar Dec 08 '23 21:12 abertschi

much appreciated, will grab the .apk ASAP.

unseenlarks avatar Dec 08 '23 22:12 unseenlarks

also i use the device in dark mode and the smaller notifications the app gives (for example when enabling developer mode, then a tracer for a specific app), are hard to read.

Can you post a screenshot showing what is hard to read?

abertschi avatar Dec 11 '23 17:12 abertschi

And ideally a screenshot of the notification when the ad occurs (and not being detected). Will look again at the tracing dump file. It's a bit hard to troubleshoot as the issue seems device/ OS specific. I did not have this issue on my phone. What phone do you have?

abertschi avatar Dec 11 '23 17:12 abertschi

The new generic text detector should now be able to detect any text in the notification, supposing the text is text and not an image. Enabling best effort and user defined text detector (with the ad string) does not fix the issue?

abertschi avatar Dec 11 '23 17:12 abertschi

The most recent tracing file does not contain an Ad with the text: "Music will resume shortly..". Did you record the old tracing file with the same version of Android 13? If so we do not need a new tracing file. Otherwise, could you create another tracing file and ensure that you can capture an ad?. many thanks :)

abertschi avatar Dec 11 '23 17:12 abertschi

moto g32 running Android 13. the log i originally sent in November had the device still on Android 12.

i set battery optimisation to unrestricted, and always-on notifications to on, but the settings didn't apply until i restarted the device.

after that, the notification appeared, as shown on screenshot, but ad was not muted. maybe this app's developers have managed something, to make the ad not register as one? adfree

text i can't read is shown here. text

sharing the log again, in case it contains something new after the reboot. adfree-accuradio.txt

unseenlarks avatar Dec 11 '23 17:12 unseenlarks

i don't know if it will help, but for this log i restarted the station three times, so three "Music will resume shortly..." ads would play. adfree-accuradio.txt

unseenlarks avatar Dec 11 '23 18:12 unseenlarks