Skip to content

Commit

Permalink
feat: 规则维护更新 (#193)
Browse files Browse the repository at this point in the history
* feat(百度贴吧): 信息流广告

* feat(微信): 小程序部分广告

* feat: update NEGATION_PART_RULE_BUTTON

* feat: 使用取反表达式 代替 !~=

讨论参考:

gkd-kit/selector#14

https://gkd.li/selector/

* fix: 修复错误取反语法

* fix: 使用取反表达式 代替部分 !=
  • Loading branch information
aoguai committed Jul 3, 2024
1 parent f6421a9 commit 552c66f
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 21 deletions.
14 changes: 13 additions & 1 deletion src/apps/com.baidu.tieba.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,19 @@ export default defineGkdApp({
],
},
{
preKeys: 0,
key: 1,
quickFind: true,
matches:
'@FrameLayout[clickable=true] <n RelativeLayout + * [text="广告"]',
snapshotUrls: [
'https://i.gkd.li/i/16038470',
'https://i.gkd.li/i/16038471',
'https://i.gkd.li/i/16038472',
],
},
{
preKeys: [0, 1],
key: 10,
name: '关闭原因-【不感兴趣】',
matches:
'@View[text=null] - TextView[text="选择不喜欢理由"][index=0]',
Expand Down
6 changes: 3 additions & 3 deletions src/apps/com.jingdong.app.mall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ export default defineGkdApp({
key: 0,
name: '参与调研',
matches:
'FrameLayout + RelativeLayout > RelativeLayout > ImageView[visibleToUser=true] + ImageView[desc!="返回"][visibleToUser=true]',
'FrameLayout + RelativeLayout > RelativeLayout > ImageView[visibleToUser=true] + ImageView[!(desc="返回")][visibleToUser=true]',
snapshotUrls: [
'https://i.gkd.li/import/12642270',
'https://i.gkd.li/import/12774910', // 使用 [desc!="返回"] 进行限定,防止在进入商品详情页时点击返回按钮
'https://i.gkd.li/import/12774910', // 使用 [!(desc="返回")] 进行限定,防止在进入商品详情页时点击返回按钮
'https://i.gkd.li/i/15110548', // 避免误触
],
},
Expand Down Expand Up @@ -114,7 +114,7 @@ export default defineGkdApp({
key: 2,
activityIds: 'com.jingdong.app.mall.MainFrameActivity',
matches:
'[id="android:id/content"] > RelativeLayout > RelativeLayout > *[childCount=2] > ImageView[index=1][clickable=true][desc!="拍照购"]',
'[id="android:id/content"] > RelativeLayout > RelativeLayout > *[childCount=2] > ImageView[index=1][clickable=true][!(desc="拍照购")]',
snapshotUrls: [
'https://i.gkd.li/import/13241883',
'https://i.gkd.li/import/13259029',
Expand Down
2 changes: 1 addition & 1 deletion src/apps/com.taobao.taobao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export default defineGkdApp({
name: '商品详情右侧悬浮广告',
activityIds: 'com.taobao.browser.BrowserActivity',
matches:
'View[childCount=2] > @Image[text!=""][clickable=true] + View[childCount>1]',
'View[childCount=2] > @Image[!(text="")][clickable=true] + View[childCount>1]',
snapshotUrls: [
'https://i.gkd.li/import/13521702',
'https://i.gkd.li/import/14236602', // 防止误触
Expand Down
2 changes: 2 additions & 0 deletions src/apps/com.tencent.mm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ export default defineGkdApp({
{
key: 10,
name: '全屏广告-小程序部分广告',
desc: '包括部分开屏广告',
enable: false,
matchTime: 10000,
activityIds: [
Expand All @@ -322,6 +323,7 @@ export default defineGkdApp({
key: 0,
name: '开屏广告',
actionDelay: 800, // 过早点击首次大概率跳不过
forcedTime: 10000,
quickFind: true,
matches: [
'[text="广告"][visibleToUser=true]',
Expand Down
4 changes: 2 additions & 2 deletions src/apps/com.tencent.mobileqq.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default defineGkdApp({
key: 0,
name: '顶部横幅',
matches:
'ImageView[longClickable!=true][vid!="chat_item_head_icon"][visibleToUser=true] <n *[left=0][vid!="root"][visibleToUser=true] >n TextView[clickable=false][text.length>0][text!~="(?is).*([01]?[0-9]|2[0-3])[::][0-5][0-9].*"][text!$="G"&&text!$="M"&&text!$="k"][visibleToUser=true] <<n * > [name$="ImageView"||name$="Button"][desc="关闭"||(desc=null&&text=null)][childCount=0][visibleToUser=true][clickable=true][longClickable!=true][left>0][vid!="chat_item_head_icon"][visibleToUser=true]',
'ImageView[longClickable!=true][vid!="chat_item_head_icon"][visibleToUser=true] <n *[left=0][vid!="root"][visibleToUser=true] >n TextView[clickable=false][text.length>0][!(text~="(?is).*([01]?[0-9]|2[0-3])[::][0-5][0-9].*")][text!$="G"&&text!$="M"&&text!$="k"][visibleToUser=true] <<n * > [name$="ImageView"||name$="Button"][desc="关闭"||(desc=null&&text=null)][childCount=0][visibleToUser=true][clickable=true][longClickable!=true][left>0][vid!="chat_item_head_icon"][visibleToUser=true]',
excludeMatches: [
'[id^="com.tencent.mobileqq.qzone"]', // QQ空间
],
Expand Down Expand Up @@ -551,7 +551,7 @@ export default defineGkdApp({
{
key: 0,
matches:
'ImageView < * < FrameLayout +2 * >3 TextView[text*="红包"] - @ViewGroup[childCount=5] > TextView[text!="已领取"]',
'ImageView < * < FrameLayout +2 * >3 TextView[text*="红包"] - @ViewGroup[childCount=5] > TextView[!(text="已领取")]',
exampleUrls:
'https://m.gkd.li/57941037/7a933a7f-dc5a-4eb7-8a6f-fe3cc4e8fb5e',
snapshotUrls: 'https://i.gkd.li/import/14221309',
Expand Down
2 changes: 1 addition & 1 deletion src/apps/com.zhihu.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export default defineGkdApp({
{
key: 0,
matches:
'@[text="×"||(name*=".Image"&&clickable=true)][index!=0][visibleToUser=true] <n [vid!="msg_view"] > [name!*="WebView"][(text$="热度"||text$="广告"||text="创作者小助手"||(text^="知乎"&&text!*="·"))||(text="查看详情")][text.length>2&&text.length<20]',
'@[text="×"||(name*=".Image"&&clickable=true)][index!=0][visibleToUser=true] <n [!(vid="msg_view")] > [name!*="WebView"][(text$="热度"||text$="广告"||text="创作者小助手"||(text^="知乎"&&text!*="·"))||(text="查看详情")][text.length>2&&text.length<20]',
snapshotUrls: [
'https://i.gkd.li/import/14178980',
'https://i.gkd.li/import/14206949',
Expand Down
Loading

0 comments on commit 552c66f

Please sign in to comment.