Let's start with first and third part of sentence:
なにがあろうと、
Whatever happens,
このお菓子は手ばなすもんか。
I will definitely not let go of this sweet.
Next second part of sentence:
たとえ警察につかまったって、
たとえ (possible spellings with kanji: 仮令, 縦え, 縦令), often paired with ~ても / ~でも, とも, (~た / ~だ)って, means "even if, no matter (what), if, though, although, supposing, supposing that".
This って attached to past tense ~た / ~だ is synonym of ~ても / ~でも, and is って 4.2. in this dictionary:
(接続助詞、終助詞)
2.(た、だなどに付いて)譲歩を表す。ても、でも。たところで、だとしても。
So 「たとえ警察につかまったって、」 can be translated as "even if I get caught by police".
Whole sentence:
なにがあろうと、たとえ警察につかまったって、このお菓子は手ばなすもんか。
Whatever happens, even if I get caught by police, I will definitely not let go of this sweet.