RF Sentinel (RFSentinel): free, open-source police detector app for Android. Spots police body cams, Flock ALPR cameras, AirTag trackers, Remote ID drones, smart glasses and fake cell towers from Bluetooth LE and WiFi. No root.
Kotlin airtagalprandroidandroid-autoanti-surveillancebluetooth-low-energybody-cameracounter-surveillancedrone-detectionflock-safetyimsi-catcher-detectorpolice-detectorpolice-scannerprivacyremote-idrtl-sdrsdrsurveillance-detectiontracker-detectionwifi
"""Generates RF Sentinel's adaptive launcher icon (DedSec-inspired, original art).
One geometry source -> Android vector drawables (foreground, background,
monochrome) plus an SVG preview (tools/icon-preview.html, not published). Canvas is the
108x108 adaptive-icon grid; everything meaningful sits inside the 66x66 safe
zone (21..87), since launchers crop to roughly the middle 72x72.
Design: a cyan neon "(( o ))" broadcast eye with a faint magenta ghost
(chromatic aberration), a white-hot core, one glitch slice, a targeting
reticle, a terminal cursor and a few corrupted pixels, on black with CRT
scanlines.
Run: python tools/gen_icon.py
"""
import math
import os
ROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')
RES = os.path.join(ROOT, 'app', 'src', 'main', 'res')
BG = '#050507'
CYAN = '#00F0D8'
MAGENTA = '#FF2E88'
WHITE = '#F2FFFD'
CX, CY = 54.0, 54.0
def arc(r, a0, a1):
"""Circular arc around (CX, CY); angles in degrees, 0 = right, clockwise."""
x0 = CX + r * math.cos(math.radians(a0)); y0 = CY + r * math.sin(math.radians(a0))
x1 = CX + r * math.cos(math.radians(a1)); y1 = CY + r * math.sin(math.radians(a1))
large = 1 if abs(a1 - a0) > 180 else 0
return f'M{x0:.2f},{y0:.2f} A{r},{r} 0 {large} 1 {x1:.2f},{y1:.2f}'
def circle(r, cx=CX, cy=CY):
return f'M{cx - r:.2f},{cy:.2f} a{r},{r} 0 1 1 {2 * r:.2f},0 a{r},{r} 0 1 1 {-2 * r:.2f},0 Z'
# ---- Geometry ----------------------------------------------------------------------
WAVES = [ # (path, stroke width)
(arc(11.0, 136, 224), 3.6), (arc(11.0, -44, 44), 3.6),
(arc(18.5, 145, 215), 3.6), (arc(18.5, -35, 35), 3.6),
]
RING = (circle(6.3), 1.8) # iris ring
CORE_R = 3.6 # white-hot core
RETICLE_W = 2.6
def corner(x, y, dx, dy, L=7.5):
return f'M{x + dx * L:.1f},{y} L{x},{y} L{x},{y + dy * L:.1f}'
RETICLE = [corner(28, 28, 1, 1), corner(80, 28, -1, 1), corner(28, 80, 1, -1), corner(80, 80, -1, -1)]
SLICE = (32.0, 56.6, 44.0, 2.4) # x, y, w, h of the glitch band
SLICE_DX = 3.2 # sideways displacement inside the band
CURSOR = (49.5, 70.5, 9.0, 2.2) # terminal "_" under the eye
PIXELS = [ # corrupted pixel blocks (x, y, w, h, colour)
(31.0, 63.5, 3.0, 1.5, MAGENTA),
(72.0, 43.0, 3.5, 1.5, CYAN),
(74.0, 65.5, 1.8, 1.5, WHITE),
]
GHOST = (-1.3, 0.5, 0.75) # magenta ghost offset x, y and opacity
# ---- Android vector drawables ------------------------------------------------------
HEADER = ('<?xml version="1.0" encoding="utf-8"?>\n'
'<!-- Generated by tools/gen_icon.py - edit the script, not this file. -->\n'
'<vector xmlns:android="http://schemas.android.com/apk/res/android"\n'
' android:width="108dp" android:height="108dp"\n'
' android:viewportWidth="108" android:viewportHeight="108">\n')
def v_stroke(d, color, w, cap='round', alpha=None, ind=' '):
a = f' android:strokeAlpha="{alpha}"' if alpha is not None else ''
return (f'{ind}<path android:pathData="{d}" android:strokeColor="{color}" android:strokeWidth="{w}"'
f' android:strokeLineCap="{cap}" android:fillColor="#00000000"{a} />\n')
def v_fill(d, color, alpha=None, ind=' '):
a = f' android:fillAlpha="{alpha}"' if alpha is not None else ''
return f'{ind}<path android:pathData="{d}" android:fillColor="{color}"{a} />\n'
def v_rect(x, y, w, h, color, alpha=None, ind=' '):
return v_fill(f'M{x},{y}h{w}v{h}h{-w}z', color, alpha, ind)
def v_glyph(color, dx=0.0, dy=0.0, alpha=None, ind=' '):
out = f'{ind}<group android:translateX="{dx}" android:translateY="{dy}">\n'
inner = ind + ' '
for d, w in WAVES:
out += v_stroke(d, color, w, alpha=alpha, ind=inner)
out += v_stroke(RING[0], color, RING[1], alpha=alpha, ind=inner)
out += f'{ind}</group>\n'
return out
def foreground():
out = HEADER
for d in RETICLE:
out += v_stroke(d, CYAN, RETICLE_W, cap='square')
gx, gy, ga = GHOST
out += v_glyph(MAGENTA, gx, gy, ga)
out += v_glyph(CYAN)
out += v_fill(circle(CORE_R), WHITE)
x, y, w, h = SLICE
out += v_rect(x, y, w, h, BG)
out += ' <group>\n'
out += f' <clip-path android:pathData="M{x},{y}h{w}v{h}h{-w}z" />\n'
out += v_glyph(CYAN, SLICE_DX, 0, ind=' ')
out += ' </group>\n'
cx, cy, cw, ch = CURSOR
out += v_rect(cx, cy, cw, ch, MAGENTA)
for px, py, pw, ph, c in PIXELS:
out += v_rect(px, py, pw, ph, c, 0.85)
return out + '</vector>\n'
def background():
out = HEADER + v_fill('M0,0h108v108h-108z', BG)
out += v_fill(circle(28), CYAN, 0.06) + v_fill(circle(18), CYAN, 0.05)
for y in range(0, 108, 3):
out += v_rect(0, y, 108, 0.8, CYAN, 0.05)
return out + '</vector>\n'
def monochrome():
"""Themed-icon layer (Android 13+): one colour; the launcher tints it."""
out = HEADER
for d in RETICLE:
out += v_stroke(d, '#FFFFFF', RETICLE_W, cap='square')
out += v_glyph('#FFFFFF') + v_fill(circle(CORE_R), '#FFFFFF')
cx, cy, cw, ch = CURSOR
return out + v_rect(cx, cy, cw, ch, '#FFFFFF') + '</vector>\n'
# ---- SVG preview (same geometry) ---------------------------------------------------
def s_glyph(color, dx=0.0, dy=0.0, alpha=1.0):
g = f'<g transform="translate({dx},{dy})" opacity="{alpha}">'
for d, w in WAVES:
g += f'<path d="{d}" stroke="{color}" stroke-width="{w}" stroke-linecap="round" fill="none"/>'
g += f'<path d="{RING[0]}" stroke="{color}" stroke-width="{RING[1]}" fill="none"/>'
return g + '</g>'
def svg(shape, size):
uid = f'{shape}{size}'
bg = f'<rect width="108" height="108" fill="{BG}"/>'
bg += f'<path d="{circle(28)}" fill="{CYAN}" opacity="0.06"/><path d="{circle(18)}" fill="{CYAN}" opacity="0.05"/>'
bg += ''.join(f'<rect x="0" y="{y}" width="108" height="0.8" fill="{CYAN}" opacity="0.05"/>' for y in range(0, 108, 3))
fg = ''.join(f'<path d="{d}" stroke="{CYAN}" stroke-width="{RETICLE_W}" stroke-linecap="square" fill="none"/>' for d in RETICLE)
gx, gy, ga = GHOST
fg += s_glyph(MAGENTA, gx, gy, ga) + s_glyph(CYAN) + f'<path d="{circle(CORE_R)}" fill="{WHITE}"/>'
x, y, w, h = SLICE
fg += f'<rect x="{x}" y="{y}" width="{w}" height="{h}" fill="{BG}"/>'
fg += f'<clipPath id="sl{uid}"><rect x="{x}" y="{y}" width="{w}" height="{h}"/></clipPath>'
fg += f'<g clip-path="url(#sl{uid})">{s_glyph(CYAN, SLICE_DX, 0)}</g>'
cx, cy, cw, ch = CURSOR
fg += f'<rect x="{cx}" y="{cy}" width="{cw}" height="{ch}" fill="{MAGENTA}"/>'
fg += ''.join(f'<rect x="{px}" y="{py}" width="{pw}" height="{ph}" fill="{c}" opacity="0.85"/>' for px, py, pw, ph, c in PIXELS)
mask = ('<circle cx="54" cy="54" r="36"/>' if shape == 'circle'
else '<rect x="18" y="18" width="72" height="72" rx="22"/>')
return (f'<svg xmlns="http://www.w3.org/2000/svg" viewBox="18 18 72 72" width="{size}" height="{size}">'
f'<clipPath id="m{uid}">{mask}</clipPath><g clip-path="url(#m{uid})">{bg}{fg}</g></svg>')
if __name__ == '__main__':
for name, body in [('ic_launcher_foreground', foreground()), ('ic_launcher_background', background()),
('ic_launcher_monochrome', monochrome())]:
with open(os.path.join(RES, 'drawable', name + '.xml'), 'w', encoding='utf-8', newline='\n') as f:
f.write(body)
with open(os.path.join(RES, 'mipmap-anydpi', 'ic_launcher.xml'), 'w', encoding='utf-8', newline='\n') as f:
f.write('<?xml version="1.0" encoding="utf-8"?>\n'
'<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">\n'
' <background android:drawable="@drawable/ic_launcher_background" />\n'
' <foreground android:drawable="@drawable/ic_launcher_foreground" />\n'
' <monochrome android:drawable="@drawable/ic_launcher_monochrome" />\n'
'</adaptive-icon>\n')
out = os.path.join(ROOT, 'tools', 'icon-preview.html')
with open(out, 'w', encoding='utf-8', newline='\n') as f:
f.write('<!doctype html><html><head><title>Icon preview</title></head>'
'<body style="margin:0;background:#1b1b1f;display:flex;gap:36px;padding:36px;align-items:center">'
+ svg('circle', 240) + svg('squircle', 240)
+ '<div style="background:#dfe3ea;padding:24px;border-radius:24px;display:flex;gap:20px">'
+ svg('circle', 64) + svg('squircle', 64) + '</div></body></html>')
print('icon written; preview:', os.path.abspath(out))