Complex sentence: Germany was denied submarines by the terms of the Treaty of Versailles and secret production was not legitimized until the Anglo-German Naval Agreement of 1935 under which the UK accepted German parity in submarine numbers with the Royal Navy.
Split into simpler sentences: Germany was denied submarines by the terms of the Treaty of Versailles, but secretly produced them anyway. This was not legitimized until the Anglo-German Naval Agreement of 1935, under which the UK accepted German parity in submarine numbers with the Royal Navy.