Practical security policy enforcement for Android apps via bytecode rewriting and in-place reference monitor