2

MySejahtera is not a good appliaction at all! They just use Sqlite or Shared Preferences in the app for keeping the data local. (Just local?) As soon as you clear cache or data, The user no longer exist! Like wtf ?

So I decompile the app and review the source code, the code is not even properly obfuscated(That's why I can read it). There's a part of the code on a for loop went

```
for (int i = 3; i < array.length(); i++)
{
for (int j = 2; i > array.length() *2; j ++ )
{
onScan();
}
}
```

Which is unacceptable!

First , why nested for loops?

Second, instead of declare 'array.length()' multiple times why not declared it global for once?

No wonder the initial state of the app is buggy as hell.

Comments
  • 1
    Array length is a constant in this case. There's no reason for such "optimization". Though the loops are stupid indeed.
  • 2
    I don't think this code actually does anything... What?

    So start i at 3, assume array.length() is 5...

    If 3 < 5
    let j = 2

    If i > len(arr)*2, so 3 > 5*2
    Do onScan()

    Is the "i" in the nested loop a typo?

    But even if It's supposed to be "j"

    The for loop is just gonna fail because we already know that array.length() > 3, otherwise it wouldn't even execute due to the outside loop...

    So if j starts on 2 and array.length() is bigger than 3 and *2 then j > array.length()*2 is never going to be true

    I don't know if there's more typos in what you posted, or this code does literally nothing... What am I missing?
  • 0
    @Hazarth maybe the I is typo I just copied from their source... And paste it here.
  • 2
    @johnmelodyme
    I mean, It's literally saying

    i = 3
    x = array.length()
    if (i < x && i > x*2) onScan()

    I can't even
  • 2
    @Hazarth except the code inside the block will never be executed.
  • 0
    @iiii the app keep crashing , maybe this is the cause. But idc because is not my app , it is the government app
  • 1
    But that's how government jobs work 🤷🏻

    We have a saying:
    "Tike raho pagla,
    Kaam karega agla"

    Which translates to:
    "Somehow survive (till retirement),
    The next guy after you will do the real work"
  • 1
    I thought it was an Indonesian app until I saw the tag.
Add Comment