How to disable FLAG_SECURE by modifying an apk filie? I want to mod an apk so that its FLAG_SECURE can be disabled. Can anyone please guide me in doing that? I have used Apk tool to decompile the app, I don't know which specific file to find in smali to disable this.
There not one specific file you have to edit. Instead you have to search all smali files for a specific call. Luckily the Smali syntax is very specific so that you can search easily using a full text search tool. I prefer Agent Ransack (Windows) or  grep -R (on command-line).
In detail you have to search the smali files for one of the following calls:
Landroid/view/Window;-&gt;setFlags(II)V
Landroid/view/Window;-&gt;addFlags(I)V

Before each call in the same line there is noted which registers contain the parameters.
addFlags
const/16 v2, 0x2000
invoke-virtual {v1, v2}, Landroid/view/Window;-&gt;addFlags(I)V

The second entry in the curly brackets in the interesting one (v2 in the example).
If this parameter is set to 0x2000. In detail this it a bit mask and if the 14th bit is set the screen-shot protection is applied to the current screen.
Effectively only the fourth position matters. If it is 2 or 6 (2+4) or A (8+2) or C(2+4+8) then the bit you are searching is set.
But in usually (in 99% of all cases you will find the value 0x2000)
Search the lines before the invoke-virtual if there is an command that sets the register we are looking for such as: const/16 v2, 0x2000
If there is the call and the second parameter has a parameter with the hexadecimal 2 at the mentioned position you can simply comment out the whole invoke-virtual ... line by placing a # in front of the line.
setFlags
const/16 v1, 0x2000
const/16 v2, 0x2000

invoke-virtual {v0, v1, v2}, Landroid/view/Window;-&gt;setFlags(II)V

For setFlags it is very similar just that the 0x2000 parameter has to be present in second v1 and the third v2 mentioned register in the curly brackets.
Do that with every occurrence of setFlags/addFlags invocations.
Again comment out the whole invoke-virtual ... line by placing a # in front of the line.
Rebuild APK
Then rebuild(apktool b ...) and sign the built APK with a custom certificate and you are ready to install the app.