Writing custom malware for Android from scratch