The Germany captain, a Bayern Munich player since 2015, has signed a new deal through to summer 2029.