Smali iterating over Arraylist












0















im trying to translate this java line to smali code



v1 = "tag"
p0 = Arraylist

p0.forEach(x -> Log.d(v1,x));


this is what i have come up with



const-string/jumbo v4, "tag"

invoke-virtual {p0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

move-result-object v1

:goto_4

invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

move-result v2

if-eqz v2, :cond_16

invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

move-result-object v0

check-cast v0, Ljava/lang/String;

invoke-static {v4, v0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

goto :goto_4

:cond_16


The App runs without crashing but the log entries are not generated



Edit: i leave this here because i think it would work and could be useful , i solved the problem by converting to String and cutting the string with a for-loop , i suspect the iterator is buggy



also thx to jesusfreke himself for looking over the code










share|improve this question




















  • 1





    I don't see anything immediately wrong with the smali. Does the app launch? Are you sure your injected code is even getting run?

    – JesusFreke
    Nov 14 '18 at 23:07











  • on api 21 it crashes with "failed compile-time verification" but i read that this can be fixed with an higher api and on api 25 the app runs and the code runs at least to above setting up the iterator

    – kluki
    Nov 14 '18 at 23:19













  • What errors do you see on api 21?

    – JesusFreke
    Nov 15 '18 at 3:55











  • it crashes with the error ~ verfier couldn't verify because is failed compile time verification but it crashes like also with for loops on api 21 and i read on here that this can be fixed by threading or moving up in api. Is there a guide for threading in smali because i need to do it anyway now because of WindowManager: WIN DEATH: Window

    – kluki
    Nov 17 '18 at 17:21













  • You need to find out why it's failing verification. Look back further in the logs, probably around the time you installed the apk. There should be some logs from ART saying exactly why the verification is failing.

    – JesusFreke
    Nov 17 '18 at 21:11
















0















im trying to translate this java line to smali code



v1 = "tag"
p0 = Arraylist

p0.forEach(x -> Log.d(v1,x));


this is what i have come up with



const-string/jumbo v4, "tag"

invoke-virtual {p0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

move-result-object v1

:goto_4

invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

move-result v2

if-eqz v2, :cond_16

invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

move-result-object v0

check-cast v0, Ljava/lang/String;

invoke-static {v4, v0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

goto :goto_4

:cond_16


The App runs without crashing but the log entries are not generated



Edit: i leave this here because i think it would work and could be useful , i solved the problem by converting to String and cutting the string with a for-loop , i suspect the iterator is buggy



also thx to jesusfreke himself for looking over the code










share|improve this question




















  • 1





    I don't see anything immediately wrong with the smali. Does the app launch? Are you sure your injected code is even getting run?

    – JesusFreke
    Nov 14 '18 at 23:07











  • on api 21 it crashes with "failed compile-time verification" but i read that this can be fixed with an higher api and on api 25 the app runs and the code runs at least to above setting up the iterator

    – kluki
    Nov 14 '18 at 23:19













  • What errors do you see on api 21?

    – JesusFreke
    Nov 15 '18 at 3:55











  • it crashes with the error ~ verfier couldn't verify because is failed compile time verification but it crashes like also with for loops on api 21 and i read on here that this can be fixed by threading or moving up in api. Is there a guide for threading in smali because i need to do it anyway now because of WindowManager: WIN DEATH: Window

    – kluki
    Nov 17 '18 at 17:21













  • You need to find out why it's failing verification. Look back further in the logs, probably around the time you installed the apk. There should be some logs from ART saying exactly why the verification is failing.

    – JesusFreke
    Nov 17 '18 at 21:11














0












0








0








im trying to translate this java line to smali code



v1 = "tag"
p0 = Arraylist

p0.forEach(x -> Log.d(v1,x));


this is what i have come up with



const-string/jumbo v4, "tag"

invoke-virtual {p0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

move-result-object v1

:goto_4

invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

move-result v2

if-eqz v2, :cond_16

invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

move-result-object v0

check-cast v0, Ljava/lang/String;

invoke-static {v4, v0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

goto :goto_4

:cond_16


The App runs without crashing but the log entries are not generated



Edit: i leave this here because i think it would work and could be useful , i solved the problem by converting to String and cutting the string with a for-loop , i suspect the iterator is buggy



also thx to jesusfreke himself for looking over the code










share|improve this question
















im trying to translate this java line to smali code



v1 = "tag"
p0 = Arraylist

p0.forEach(x -> Log.d(v1,x));


this is what i have come up with



const-string/jumbo v4, "tag"

invoke-virtual {p0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

move-result-object v1

:goto_4

invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

move-result v2

if-eqz v2, :cond_16

invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

move-result-object v0

check-cast v0, Ljava/lang/String;

invoke-static {v4, v0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

goto :goto_4

:cond_16


The App runs without crashing but the log entries are not generated



Edit: i leave this here because i think it would work and could be useful , i solved the problem by converting to String and cutting the string with a for-loop , i suspect the iterator is buggy



also thx to jesusfreke himself for looking over the code







java android logging smali






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 15 '18 at 1:41







kluki

















asked Nov 14 '18 at 22:07









klukikluki

177




177








  • 1





    I don't see anything immediately wrong with the smali. Does the app launch? Are you sure your injected code is even getting run?

    – JesusFreke
    Nov 14 '18 at 23:07











  • on api 21 it crashes with "failed compile-time verification" but i read that this can be fixed with an higher api and on api 25 the app runs and the code runs at least to above setting up the iterator

    – kluki
    Nov 14 '18 at 23:19













  • What errors do you see on api 21?

    – JesusFreke
    Nov 15 '18 at 3:55











  • it crashes with the error ~ verfier couldn't verify because is failed compile time verification but it crashes like also with for loops on api 21 and i read on here that this can be fixed by threading or moving up in api. Is there a guide for threading in smali because i need to do it anyway now because of WindowManager: WIN DEATH: Window

    – kluki
    Nov 17 '18 at 17:21













  • You need to find out why it's failing verification. Look back further in the logs, probably around the time you installed the apk. There should be some logs from ART saying exactly why the verification is failing.

    – JesusFreke
    Nov 17 '18 at 21:11














  • 1





    I don't see anything immediately wrong with the smali. Does the app launch? Are you sure your injected code is even getting run?

    – JesusFreke
    Nov 14 '18 at 23:07











  • on api 21 it crashes with "failed compile-time verification" but i read that this can be fixed with an higher api and on api 25 the app runs and the code runs at least to above setting up the iterator

    – kluki
    Nov 14 '18 at 23:19













  • What errors do you see on api 21?

    – JesusFreke
    Nov 15 '18 at 3:55











  • it crashes with the error ~ verfier couldn't verify because is failed compile time verification but it crashes like also with for loops on api 21 and i read on here that this can be fixed by threading or moving up in api. Is there a guide for threading in smali because i need to do it anyway now because of WindowManager: WIN DEATH: Window

    – kluki
    Nov 17 '18 at 17:21













  • You need to find out why it's failing verification. Look back further in the logs, probably around the time you installed the apk. There should be some logs from ART saying exactly why the verification is failing.

    – JesusFreke
    Nov 17 '18 at 21:11








1




1





I don't see anything immediately wrong with the smali. Does the app launch? Are you sure your injected code is even getting run?

– JesusFreke
Nov 14 '18 at 23:07





I don't see anything immediately wrong with the smali. Does the app launch? Are you sure your injected code is even getting run?

– JesusFreke
Nov 14 '18 at 23:07













on api 21 it crashes with "failed compile-time verification" but i read that this can be fixed with an higher api and on api 25 the app runs and the code runs at least to above setting up the iterator

– kluki
Nov 14 '18 at 23:19







on api 21 it crashes with "failed compile-time verification" but i read that this can be fixed with an higher api and on api 25 the app runs and the code runs at least to above setting up the iterator

– kluki
Nov 14 '18 at 23:19















What errors do you see on api 21?

– JesusFreke
Nov 15 '18 at 3:55





What errors do you see on api 21?

– JesusFreke
Nov 15 '18 at 3:55













it crashes with the error ~ verfier couldn't verify because is failed compile time verification but it crashes like also with for loops on api 21 and i read on here that this can be fixed by threading or moving up in api. Is there a guide for threading in smali because i need to do it anyway now because of WindowManager: WIN DEATH: Window

– kluki
Nov 17 '18 at 17:21







it crashes with the error ~ verfier couldn't verify because is failed compile time verification but it crashes like also with for loops on api 21 and i read on here that this can be fixed by threading or moving up in api. Is there a guide for threading in smali because i need to do it anyway now because of WindowManager: WIN DEATH: Window

– kluki
Nov 17 '18 at 17:21















You need to find out why it's failing verification. Look back further in the logs, probably around the time you installed the apk. There should be some logs from ART saying exactly why the verification is failing.

– JesusFreke
Nov 17 '18 at 21:11





You need to find out why it's failing verification. Look back further in the logs, probably around the time you installed the apk. There should be some logs from ART saying exactly why the verification is failing.

– JesusFreke
Nov 17 '18 at 21:11












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53309452%2fsmali-iterating-over-arraylist%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53309452%2fsmali-iterating-over-arraylist%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Xamarin.iOS Cant Deploy on Iphone

Glorious Revolution

Dulmage-Mendelsohn matrix decomposition in Python