Instead of replacing things with sed. This was a bit brittle with the changes in 3.7.6/3.7.7, and this approach keeps compatibility with older SDK versions.