Jihad is to be carried on whether the Muslim ruler is good or bad
باب الْجِهَادُ مَاضٍ مَعَ الْبَرِّ وَالْفَاجِرِ
Sahih al-Bukhari, Book of Fighting for the Cause of Allah (Jihaad)(view book)
لِقَوْلِ النَّبِيِّ ﷺ: «الْخَيْلُ مَعْقُودٌ فِي نَوَاصِيهَا الْخَيْرُ إِلَى يَوْمِ الْقِيَامَةِ».
Sahih al-Bukhari 2852
Narrated 'Urwa Al-Bariqi:
The Prophet ﷺ said, "Good will remain (as a permanent quality) in the foreheads of horses (for Jihad) till the Day of Resurrection, for they bring about either a reward (in the Hereafter) or booty (in this world."
حَدَّثَنَا أَبُو نُعَيْمٍ، حَدَّثَنَا زَكَرِيَّاءُ، عَنْ عَامِرٍ، حَدَّثَنَا عُرْوَةُ الْبَارِقِيُّ، أَنَّ النَّبِيَّ ﷺ قَالَ " الْخَيْلُ مَعْقُودٌ فِي نَوَاصِيهَا الْخَيْرُ إِلَى يَوْمِ الْقِيَامَةِ الأَجْرُ وَالْمَغْنَمُ ".
Classification
Sahih (Authentic)