App.java 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. package com.quansu.heifengwuliu;
  2. import com.litesuits.orm.LiteOrm;
  3. import com.quansu.heifengwuliu.config.Config;
  4. import com.quansu.heifengwuliu.utils.WeChatUtil;
  5. import com.ysnows.base.base.BApp;
  6. import com.ysnows.base.ccretrofit.CCRetrofit;
  7. import com.ysnows.base.config.IConfig;
  8. import com.ysnows.base.route.IUpdate;
  9. import com.ysnows.base.route.IJpush;
  10. public class App extends BApp {
  11. private static App app = null;
  12. public static LiteOrm configOrm;
  13. private IConfig config;
  14. @Override
  15. protected void init() {
  16. app = this;
  17. CCRetrofit.instance()
  18. .create(IUpdate.class)
  19. .init()
  20. .subscribe();
  21. //一键登录
  22. CCRetrofit.instance()
  23. .with(this)
  24. .create(IJpush.class)
  25. .init()
  26. .subscribe();
  27. // CCRetrofit.instance()
  28. // .with(this)
  29. // .create(IJpush.class)
  30. // .initPush()
  31. // .subscribe();
  32. //注册微信
  33. WeChatUtil.Companion.regToWx(this);
  34. // CCRetrofit.instance()
  35. // .create(IUmeng.class)
  36. // .init()
  37. // .subscribe();
  38. }
  39. public static App getApp() {
  40. return app;
  41. }
  42. public static LiteOrm getLiteOrm() {
  43. return liteOrm;
  44. }
  45. public static LiteOrm getConfigOrm() {
  46. return configOrm;
  47. }
  48. public static void setConfigOrm(LiteOrm configOrm) {
  49. App.configOrm = configOrm;
  50. }
  51. @Override
  52. public IConfig config() {
  53. if (config == null) {
  54. config = new Config();
  55. }
  56. return config;
  57. }
  58. }