.APK file does not contain all necessary files and files I was looking for were stored here:
/data/data/<game packageid>/files/<version of app>

But that time I didn’t know that and as result I came to conclusion that this thing is done from code. And I decided to decompile game logic. This particular game uses LUA language for most things. This is quite simple language, but it is compiled to byte code and needs to be decompiled back to source code. I immediately found this https://github.com/viruscamp/luadec and I did attempt to decompile simple file but it instantly failed. After some research and looking at simplest file I found that it has only one instruction: Return and it

So, my next step was to read real file, skip first 7 bytes and call decrypt function. To do this I wrote following code:

bool DecryptFile(const char* inputFileName, const char* outputFileName)
{
    FILE* fileHandle = fopen(inputFileName, "rb");
    if (fileHandle == nullptr)
    {
        LOGW("DH: Failed to open input file '%s'", inputFileName);
        return false;
    }
…

And to my surprise code failed on fopen. I checked errno and found that it is EACCES. It means that application does not have enough rights to read this file. I spent few hours trying to figure out where should I place my file, so my application will be able to read it. And one of the most confusing and annoying part about Android is lack of consistency. On one phone has is here, another phone will have it there and on Samsung it is always in third place. Anyway, after few hours I figured it out. I placed them at this location:
/storage/emulated/0/Android/data/com.Android2/files

You can download xxtea for your preferred language from here:

https://github.com/xxtea

Then write small program that reads encrypted file then skip first 7 bytes and call xxtea_decrypt. But when I wrote program that does this - function failed. I tried different languages thinking that there could be bug in one particular implementation but function still failing. This was my second big disappointment. For some time, I didn’t know what to do. In desperation I started looking at decrypt function and accidentally I found this:

0x96cc28fc:  movw    r1, #55894      ; 0xda56
0x96cc2900:  movw    r2, #31161      ; 0x79b9
0x96cc2904:  movt    r1, #46412      ; 0xb54c
0x96cc2908:  movt    r2, #40503      ; 0x9e37

I don’t know where I got it, but I know than name of debugger should be lldb. And after searching internet I found that I need to run some commands on Android itself. Basically, you run some application (debugger server) on Android and you run another application on your PC (client). It took me some time but finally I found that Visual Studio has some command line tool in Tools|Android menu but it turns that it just regular Windows command line tool with some predefined environment. After more searching, I realized that I have to type following to start Android command line:

adb shell

Next step would be to start application and attach debugger server to

I was playing one mobile game for some time and one day I wanted to check how something is done in this game. That day I didn’t know that my curiosity will start long adventure full of interesting discoveries. And I decided to share it as whole thing was quite interesting and surprising (at least for me).

As everybody knows applications for Android are supplied in form of single file with APK extension and it is actually zip file. And my initial thought was extract content of APK file and check it. Quick search revealed many sites that have APK file for that game. So, I downloaded it and extracted. Then was first surprise. Pretty much everything interesting was encrypted.

Ok let’s review what happens from my last update on Skype 8 that I did April 26th. I did install 2 or 3 updates to Skype 8 and well, saga about Skype problems continues.

Few days ago, I was seeing strange problem: my wife calling me on Skype, but I didn’t hear any ringing on my phone or my desktop app. And after my wife stopped calling then I will see notification about missed call. This was happening for about 2 days. Really strange and annoying because my wife is wasting time and I’m not aware about her calling me until I check Skype window.

Then another problem shown up. Now when my wife calling me, only my phone is

In this post I will explain how to install OpenWrt on TP-Link Archer C7 but in general it can apply to any router.

Perparation

Before you start upgrading your router to OpenWrt you have to check following things:

  • Make sure that are still will be able to connect to internet when your router is offline. For example, you can connect your phone to your computer, or you can create hotspot on your phone and connect to it. This is necessary because you may need to troubleshoot or ask some questions etc. So, go ahead, power off your router and make sure that still able to connect to internet. If you are using your phone and have data limit, please do not use youtube or something like that as it consumes a lot of traffic. If you have to use youtube then reduce quality of video a lot.
  • Save all setting you have on your current router. It could be username and password for your internet provider. Perhaps your current Wi-Fi settings. Just in case you can go thru all settings and make screenshot of every single page. You never know.
  • Also, before you start you need to check how to revert to factory firmware. My understanding that for Archer C7 you just need to flash factory firmware: https://openwrt.org/toh/tp-link/archer-c5-c7-wdr7500#return_to_factory_firmware. It is good idea to download original firmware before you start upgrading to OpenWrt. Just in case.

As I mentioned in my previous post, I did order TP-Link Archer C7 router and finally it arrived. And I decided to create small unboxing post :)

Router arrived in nice looking box:

Back side:

After I removed plastic film from box I finally can see that I have i have US model and hardware version is 5:

This is latest version and it is even still supported by TP-Link. Here is box content:

as you can router is

Recently I decided to upgrade one of my routers and I begin my search. Number one requirement for my new router is compatibility with free open source firmware called OpenWrt. I wrote more about why you should use it here.

I don’t want to buy expensive router for $200. About half of the price of such router are features that I can get for free from OpenWrt. Also, many these routers are quite powerful and hot, and my router will be in room that is not ventilated well and close to quite hot cable modem.

As result here is list of requirements for new router:

  • Price between $50-$90
  • It should not be hot
  • Minimum 16MB of flash. It is space is used for OpenWrt and any additional packages. The more flash you have the more stuff you can install. My current router has 8MB of flash and in some cases, it became limiting factor.
  • At least 64Mb of RAM, so I will not be limited by it now or in future
  • Gigabit ports because 100 megabits are not enough in 2019. My internet speed already is 200 megabits
  • Router should support WLAN 5.0GHz ac
  • Router should have USB port as I could use it to store some data. It is optional, but it is great to have because to save something permanently you have to write it to router’s flash memory and it will wear. can replace USB flash drive, but I cannot replace flash inside of the router