You cannot do that. Or at best, you options will be severely limited.
The F-117 used the F-16's flight controls avionics. Not from the F-15. But from the F-16. Even so, that did not mean we can swap the flight controls computer (FLCC) between the two platforms. What we did was took the FLCS from the F-16 and modified it to compensate for the F-117's flying idiosyncrasies, and every airframe have its quirks. The F-117 was no different. The F-16's FLCS was flexible enough to be modded. General Dynamics did not planned it that way. They just happened to design the entire package, airframe + avionics, in a combination that became unexpectedly versatile.
What you asked for, there are many unknowns. To start, you must have baseline data of the J-31's aerodynamics, at least from wind tunnel testing. Then you must have data from as wide a variety of FLCS as possible on the ranges of each system, such as AOA limits, surface deflection degrees and rates, and the list is long.
Go back to the F-16's FLCS for a moment. The F-16 have mechanical speedbrakes, but the F-117 does not. Unmodified, if the computer did not 'see' a pair of speedbrakes, it would assume that there is something wrong with the entire aircraft and default to certain basic flight control algorithms. We had to disable that part of the FLCC in order to perform in the F-117. The F-16 have leading edge (LE) flaps, the F-117 does not. The differences between the two airframes are long, but the fact that the F-16's FLCS was used is testament to the genius from General Dynamics.
While what you asked for is not technically impossible, it will be costly in terms of exploration if a foreign avionics package can be adapted to the J-31. If you throw enough money at the challenge, you will succeed. So how much money does Pakistan have ?