God accepted Abel's sacrifice, because Abel brought the blood of another.
Cain didn't, and his sacrifice was not accepted.
Just read Jude 1.
Also, understand that Salvation is a Gift. There are no works that we can do, to earn it or keep it.
Its all of God, through Christ, freely given.
The same Blood of Jesus that saved you, keeps you saved.
You are going to have to find a different verse. Jude does not prove your point. Cain was allowed to live as an example of a bad attitude. One with the rage of envy, enough to kill another human. Jude says nothing about works or deeds. If Abel is your example of works salvation, it sorta defeats your point that salvation is not of works. The point had nothing to do with offerings. God did accept one. Not for any particular reason. God’s favor did not condemn Cain. Your proof would be Hebrews 11:4
4 By
trusting, Hevel offered a greater sacrifice than Kayin; because of this, he was attested as righteous, with God giving him this testimony on the ground of his gifts. Through having
trusted, he still continues to speak, even though he is dead.
It was not the offering that mattered. It was the trust/faith in God. It was the attitude of trust. Cain had an attitude of distrust, and envy.