The text explains Blackbeard's tactics: "They often learnt a ship's nationality and then raised that country's flag in order to appear friendly. This way Blackbeard's ship could get close to the other ship."
Thus, the answer is:
D showing the same flag as the other ship.