This page keeps deeper implementation details out of the main README, while documenting how Kitsunping is structured internally.
installer/post-fs-data.sh: early boot stage
installer/service.sh: late boot stage
sys.boot_completed=1.installer/uninstall.sh: uninstall stage
addon/daemon/daemon.shwifi.score and mobile.score from link/IP/egress, and enriches Wi‑Fi scoring with RSSI + optional probes.cache/signal_quality.json.policy/executor/executor.shresetprop.cache/policy.event.json for future UI/APK polling, now including props_failed + props_failed_list so clients know exactly which properties were rejected.ts, target, applied_profile, props_applied, props_failed, props_failed_list, calibrate_state, calibrate_ts, event) is treated as stable so an eventual broadcast intent can reuse it.Key time-based controls used by the daemon and executor:
kitsunping.daemon.interval: main daemon loop interval (seconds).persist.kitsunping.event_debounce_sec: event debounce window (seconds), auto-raised to at least the loop interval.SIGNAL_POLL_INTERVAL: mobile signal sampling cadence (loops).NET_PROBE_INTERVAL: Wi-Fi probe cadence (loops).CALIBRATE_COOLDOWN: minimum seconds between calibrations.CALIBRATE_LOW_STREAK: consecutive low-score count required to allow calibration.CALIBRATE_DELAY: delay passed into calibrate_network_settings.CALIBRATE_TIMEOUT: maximum runtime for calibration.CALIBRATE_SETTLE_MARGIN: reserved post-run settle window.policy/engine/network_policy.shcache/daemon.state + cache/daemon.last and chooses a profile via policy/rules/decide_profile.sh.cache/policy.request (informational) and triggers the executor via a PROFILE_CHANGED context.calibration/data/ (compat wrapper in addon/Net_Calibrate/calibrate.sh)
unknown.json fallback when carrier/country cannot be detected.Stored under cache/:
daemon.state: last computed state (iface/transport + wifi.* + mobile.* + composite values)daemon.pid: daemon process IDdaemon.last: last emitted event (text)event.last.json: last event (JSON)signal_quality.json: radio sampling output (JSON)policy.request: informational “desired profile” written by the daemonpolicy.target: target profile written by the executor before applyingpolicy.current: last applied profile written by the executorpolicy.event.json: executor summary (for APK polling)calibrate.state, calibrate.ts, calibrate.streak: calibration lifecyclecalibrate.best.env, calibrate.best.meta: calibration cache (provider-keyed BEST_* values)Kitsunping tries to be resilient across ROMs:
ping / ip when available.jq, bc) and checks executability.check_and_prepare_ping() now performs two quick probes: a loopback ping (validates CAP_NET_RAW) and an external ping (default 8.8.8.8).setcap cap_net_raw+ep <ping> or restorecon -RF <dir> so bundled binaries retain the proper context on enforcing ROMs.The CALIBRATE_TIMEOUT value was reduced from 1200 seconds to 600 seconds. This decision was made after analyzing the calibration process, which takes a maximum of 462 seconds under all configurations. The new value provides a reasonable buffer while optimizing the timeout duration for better performance.