bigsinger / AndroidIdChanger

Xposed Module for Changing Android Device Info
http://repo.xposed.info/module/com.bigsing.changer
538 stars 152 forks source link

BUG: Changes in UI save incorrect values in "phoneinfo.xml" #29

Closed lars18th closed 6 years ago

lars18th commented 6 years ago

Hi @bigsinger ,

In the last two versions (v1.14 & v1.15; even from others too, I don't remember), when changing the values using the UI and "saving" it, then the "phoneinfo.xml" file is corrupted. This is in the sense of some values are changed with others. Please, check it! Now I edit the file directly using nano in the shell and not using the UI (more easy for large text). However, if I change some simple value in the UI, then the file has changed others values too (with incorrect values).

Chan you fix it, please? Thank you!

lars18th commented 6 years ago

Hi,

After install v1.16 and do some changes and save it, all seems correct (related to values stored in "phoneinfo.xml").

So, I close this issue.

lars18th commented 6 years ago

Hi,

I reopen this issue. When changing values in the UI, the values in the "phoneinfo.xml" changes in multiple variables.

Please, check the saving code. The only workaround at time is manually editing the file.

lars18th commented 6 years ago

Hi @bigsinger ,

I do one change with the v1.18 and I feel the problem is solved. I close then the issue because I feel it's fixed.

Thank you!

lars18th commented 6 years ago

Hi @bigsinger ,

I reopen it! I do a "SAVE" with v1.20 after manual editing of "phoneinfo.xml" (and the right values are shown in the UI), but the generated file "reorders" the values. For example, the content of "SerialNo" is saved in "CPU_ABI2"... and a lot of other values are changed!

I suspect you have a trouble with the "map hash" function that you use. Perhaps it's modified at some point and will b invalid. Please, review the code.

Until that, I suggest to only change the "phoneinfo.xml" content manually!

bigsinger commented 6 years ago

i see. it's the bug with RecyclerView's item not map hash. u can replay the bug like this:

mod one item value and then scroll the view,then save, the values are wrong. if just save without scrolling, the values are right.

any idea?

lars18th commented 6 years ago

Hi @bigsinger ,

Confirmed! Doing the scroll the values are wrong. So, you found the problem. I'll see about how to fix it.

lars18th commented 6 years ago

Hi @bigsinger ,

To "overcome" the RecyclerView's item "bug" (not a real bug, but a default unknown behaviour) is this:

  1. First assign tag to that view whose visibility you want to maintain. Example:

    holder.myImageView.setTag(myTeamLists.get(position));
    MyDTOClass checkWetherToShow=(MyDTOClass)holder.myImageView.getTag();
  2. Now apply your condition and toggle the visibility (the key seems to be the "else part"). Example:

    if (checkWetherToShow.getHasToShowImage()){
        holder.myImageView.setVisibility(View.VISIBLE);
    }else{
        holder.myImageView.setVisibility(View.GONE);
    }

I hope you can fix it in the next v1.21 release! :smile:

lars18th commented 6 years ago

Hi @bigsinger ,

You have tested my suggestion for fixing this issue?

Regards!

bigsinger commented 6 years ago

yes, not working

lars18th commented 6 years ago

yes, not working

:worried:

Then we need to search more. Can you share the part of the code using the RecyclerView ?

lars18th commented 6 years ago

Hi @bigsinger ,

Please, see the App commented in #35 . You can use it as an example. It uses the same RecyclerView for the list of packages. Perhaps you can use the code as an example for you.

lars18th commented 6 years ago

Hi @bigsinger ,

Any news about this bug?

lars18th commented 6 years ago

Thank you @bigsinger ! This is really fixed in v1.21. Great! :smile: