Port miui v5 framework code to magicmod