Skip to content

Instantly share code, notes, and snippets.

View Aeonitis's full-sized avatar
🎯
Focusing

Aeonitis

🎯
Focusing
View GitHub Profile
@Aeonitis
Aeonitis / ghidraSetup.sh
Created February 28, 2023 17:04
Build/Run Ghidra locally on Mac/MacOS/M1/M2 without Eclipse
#!/bin/bash
#----------------------------------------
# Ghidra Setup script to locally build the app and create a new run script for MacOS/IntelliJ
# It was rejected as an a Pull Request + Feature here: https://github.com/NationalSecurityAgency/ghidra/issues/5040
#----------------------------------------
# READ THIS FIRST -----------------------
# 1. Copy this file under your created Mac directory under <root>/Ghidra/RuntimeScripts/Mac/
#
# 2. Install Java 17+ & Gradle 7.3+
@Aeonitis
Aeonitis / Android - Utilizing BroadcastReceiver
Last active February 14, 2017 23:01
Android - Utilizing BroadcastReceiver to check for Device status updates [i.e. Location (GPS&Net)/Network (Wifi&Mobile)/Battery (Boot&Low)] in Realtime
BroadcastReceiver is an application component in which you can send broadcasts (via intents) from one component and receive it in another.
Simply put, it is a great way of preparing your app to listen out for changes to your mobile in realtime actively (by users) or passively (Operating System).
In this example we will demonstrate how to implement both a minimal and optimal implementation of the BroadcastReceiver.
This solution below checks specifically for Device Location State updates.
Minimal Solution:
Go to URL https://github.com/Aeonitis/lh-and/commit/6a4c271736a32ef107e88fd5575108787cbdf25e
or search for my commit '6a4c271736a32ef107e88fd5575108787cbdf25e' on Github, in case I changed my repo name
Optimal Solution (using interfaces):
@Aeonitis
Aeonitis / MainActivity.java
Created January 3, 2017 18:45
Android - Check Network State in your app, Notifying you when an app is online/offline
/**
* This would be the activity which registers the receiver class via it's interface
*/
public class MainActivity implements NetworkStateReceiver.NetworkStateReceiverListener {
private NetworkStateReceiver networkStateReceiver; // Receiver that detects network state changes
@Override
protected void onCreate(Bundle savedInstanceState) {
/***/
@Aeonitis
Aeonitis / Android - Screen Overlay Detected Resolution
Last active October 28, 2023 06:05
Resolve Android 'Screen Overlay Detected' issue
Message of Issue: "Screen overlay detected - To change this permission setting you first have to turn off the screen overlay from Settings > Apps"
Scope of issue: This only applies to Android M (6.0/API v23) Or Over
Explanation: Other apps installed on the users device may be utilizing a screen overlay on your phone (e.g. Twilight, Red Moon, etc...)
Screen overlays are virtual layers that cover part or all of screen while another app is in the foreground.
It may be dangerous for android to allow you to to change a sensitive setting while an overlay is active because you may prone to 'tap-jacking'
(i.e. a malicious application displays a fake user interface that seems like it can be interacted with, but actually passes interaction events such as finger taps to a hidden user interface behind it.).
Therefore to improve security, android doesn't allow you to change sensitive settings while an active overlay is detected, unless the user permits the app to do so.
Source: https://commonsware.com/blog/2016/03/24/