コードを変更せずに デバッグメニューで Androidアプリの動作を変更する

7166bc2cbc462ab5fd1987a76d0fe709?s=47 takahirom
December 08, 2017

コードを変更せずに デバッグメニューで Androidアプリの動作を変更する

7166bc2cbc462ab5fd1987a76d0fe709?s=128

takahirom

December 08, 2017
Tweet

Transcript

  1. 5.

    if (isShowTutorialTiming()) { showTutorial() } fun isShowTutorialTiming(): Boolean { //

    ࣍ͷλΠϛϯά·Ͱදࣔ͠ͳ͍ if (System.currentTimeMillis() < pref.getNextTutorialtiming()) { return false; } // 3ճ͔͠දࣔ͠ͳ͍ if (3 <= pref.getTutorialCount()) { return false; } return true; } ثُ٦زٔ،ٕ׾䌢ח邌爙׃׋ְ 儗וֲ׃תַׅ JT4IPX5VUPSJBM5JNJOHדUSVF׾鵤׃׋ְ
  2. 7.

    if (isShowTutorialTiming()) { showTutorial() } fun isShowTutorialTiming(): Boolean { //

    ࣍ͷλΠϛϯά·Ͱදࣔ͠ͳ͍ if (System.currentTimeMillis() < pref.getNextTutorialtiming()) { return false; } // 3ճ͔͠දࣔ͠ͳ͍ if (3 <= pref.getTutorialCount()) { return false; } return true; } ؝٦س׾湫ׅ
  3. 8.

    if (isShowTutorialTiming()) { showTutorial() } fun isShowTutorialTiming(): Boolean { if

    (pref.isAlwaysShowTutorialTiming()) { return true; } // ࣍ͷλΠϛϯά·Ͱදࣔ͠ͳ͍ if (System.currentTimeMillis() < pref.getNextTutorialtiming()) { return false; } // 3ճ͔͠දࣔ͠ͳ͍ if (3 <= pref.getTutorialCount()) { return false; } return true; } ؝٦س׾湫ׅ ❌ٔٔ٦أתד ؝٦سָⰅ׏ג׃תֲ
  4. 9.

    if (isShowTutorialTiming()) { showTutorial() } } fun isShowTutorialTiming(): Boolean {

    if (BuildConfig.DEBUG) { if (pref.isAlwaysShowTutorialTiming()) { return true; } } // ࣍ͷλΠϛϯά·Ͱදࣔ͠ͳ͍ if (System.currentTimeMillis() < pref.getNextTutorialtiming()) { return false; } // 3ճ͔͠දࣔ͠ͳ͍ if (3 <= pref.getTutorialCount()) { return false; } return true; } ؝٦س׾湫ׅ ❌醱꧟ז؝٦سָ فٗتؙءّٝח
  5. 11.

    @Aspect public class AspectExample { @Before("execution(* on*(..))") public void before()

    { System.out.println("before !!"); } } "TQFDU+ ֿ׸׌ֽדPOד㨣ת׷ًاحسָㄎל׸׋儗ח ؚٗ׾⳿ֿׅהָ⳿勻׷
  6. 12.

    @Around("execution(boolean com...MainActivity.isShowTutorialTiming(..))") public boolean isShowTutorialDebug(ProceedingJoinPoint jp) { return true; }

    "TQFDU+׾⢪׏ג׫׷ ⭕ֿ׸׌ֽדثُ٦زٔ،ٕ⳿ׇ׷ ⭕EFCVHؿٕؓتח縧ֽלرغحؚ儗ך׫黝䘔דֹ׷
  7. 13.

    "TQFDU+׾⢪׏ג׫׷ @Around("execution(boolean com...MainActivity.isShowTutorialTiming(..))") public boolean isShowTutorialDebug(ProceedingJoinPoint jp) { return true;

    } !"SPVOEדJT4IPX5VUPSJBM5JNJOHך⵸䖓חⳢ椚׾㙵׭鴥׬ ֿֿדכ׋׌ًاحسך鵤׶⦼חUSVF׾鵤׃גְ׷
  8. 14.

    @Around("execution(boolean com...MainActivity.isShowTutorialTiming(..))") public boolean isShowTutorialDebug(ProceedingJoinPoint jp) { return true; }

    "TQFDU+׾⢪׏ג׫׷ ❌ًاحسせך㢌刿ד堣腉׃זֻז׷ ❌رغحؚך׋ןחֿ׸׾剅ֻ
  9. 15.

    @Around("execution(* *.*(..)) && @annotation(com...DebugReturn)”) public boolean isShowTutorialDebug(ProceedingJoinPoint jp) { return

    true; } @DebugReturn fun isShowTutorialTiming(): Boolean { ... } "TQFDU+׾⢪׏ג׫׷ 暴㹀ך،ظذ٦ءّٝאְגְ׷ًاحسד USVF׾鵤ׅ״ֲח
  10. 16.

    @Around("execution(* *.*(..)) && @annotation(com...DebugReturn)”) public boolean isShowTutorialDebug(ProceedingJoinPoint jp) { return

    true; } @DebugReturn fun isShowTutorialTiming(): Boolean { ... } "TQFDU+׾⢪׏ג׫׷ ❌ֿ׸׌ה䌢חUSVFחז׏ג׃תֲ ❌رؿٕؓزך㹋鄲ָㄎן⳿ׇזְ
  11. 17.

    @Around("execution(* *.*(..)) && @annotation(com...DebugReturn)”) public Object debugReturnMethod(ProceedingJoinPoint jp) { //

    ΞϊςʔγϣϯͷதͷҾ਺(key)Λऔಘ͢Δॲཧ ... final DebugSetting debugSetting = DebugSetting.getInstance(); if (debugSetting.contains(key)) { return debugSetting.get(key); } return jp.proceed(); } @DebugReturn(“tutorial”) fun isShowTutorialTiming(): Boolean { ... } "TQFDU+׾⢪׏ג׫׷
  12. 18.

    @Around("execution(* *.*(..)) && @annotation(com...DebugReturn)”) public Object debugReturnMethod(ProceedingJoinPoint jp) { //

    ΞϊςʔγϣϯͷதͷҾ਺(key)Λऔಘ͢Δॲཧ ... final DebugSetting debugSetting = DebugSetting.getInstance(); if (debugSetting.contains(key)) { return debugSetting.get(key); } return jp.proceed(); } @DebugReturn(“tutorial”) fun isShowTutorialTiming(): Boolean { ... } "TQFDU+׾⢪׏ג׫׷ ،ظذ٦ءّٝחLFZ׾床ׅ
  13. 19.

    @Around("execution(* *.*(..)) && @annotation(com...DebugReturn)”) public Object debugReturnMethod(ProceedingJoinPoint jp) { //

    ΞϊςʔγϣϯͷதͷҾ਺(key)Λऔಘ͢Δॲཧ ... final DebugSetting debugSetting = DebugSetting.getInstance(); if (debugSetting.contains(key)) { return debugSetting.get(key); } return jp.proceed(); } "TQFDU+׾⢪׏ג׫׷ ،ظذ٦ءָّٝאְ׋ًاحسךⳢ椚 ׮ה׮הךثُ٦زٔ،ٕⴻ㹀ٗآحؙ ׾ 㹋遤 1SFGFSFODFח⥂䭯׃גְ׋鏣㹀׾⢪ֲ
  14. 20.

    @Around("execution(* *.*(..)) && @annotation(com...DebugReturn)”) public Object debugReturnMethod(ProceedingJoinPoint jp) { //

    ΞϊςʔγϣϯͷதͷҾ਺(key)Λऔಘ͢Δॲཧ ... final DebugSetting debugSetting = DebugSetting.getInstance(); if (debugSetting.contains(key)) { return debugSetting.get(key); } return jp.proceed(); } "TQFDU+׾⢪׏ג׫׷ 鏣㹀׾⥂㶷׃גְֶגծ鏣㹀ָ֮׸ל׉׸׾⢪ְ זֽ׸לծًاحسⰻך傀㶷ךⳢ椚׾遤ֲ