Pretty simple -- they shot someone playing the game on a smart phone. There are too many focus errors and overexposures in the clip for it to be anything else. If you thing after effects was involved, you're mistaken.
There's someone who shot himself playing the game on a smartphone. Then he opened and game hack generator that gave him more gold and gems to his game, Then he can back to the game and as you can see the gold and gems started to increase until they reach 999,999 each one of them.
When I asked few people how they done that they said that they won't tell me but they did say that they edit the video with After Effect+Photoshop.
If there are really elements replaced in the screen in editing then it involves roto, to separate the fingers from the added elements, tracking to match the movement of the phone, color grading and lighting effects to match the look of the live elements on the screen and a bunch of time. A simple screen replacement with the entire screen replaced with a synthetically generated one could easily take several hours or even several days per minute. If only 2 or 3 seconds needs to be replaced then just those 2 or 3 seconds would be a single project that was then seamlessly edited back into the shot. I do that kind of stuff all the time. Just the other day I had to fix a problem with a shot and replace something on the screen that was only in the scene for 9 frames so my first step was to cut those 9 frames into a separate project, fix the problem, then replace the nine frames in the original. That is how you efficiently work on visual effects.
There is no single click automatic easy solution to accomplish what you think is going on in those sample videos. It's all very hard work that requires a very good understanding of how compositing works and the tools to do the job. After Effects is a powerful tool with a steep learning curve that could accomplish the task fairly easily but not quickly in the hands of an experienced user.